tests: Switch to $SPDK_TEST_STORAGE for writing out bigger tmp files
Change-Id: Ic400a470373fe59e89b2400af4f4264872281d64 Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2368 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
1430096aed
commit
fe711156e8
@ -4,7 +4,7 @@ testdir=$(readlink -f $(dirname $0))
|
||||
rootdir=$(readlink -f $testdir/../..)
|
||||
rpc_server=/var/tmp/spdk-raid.sock
|
||||
rpc_py="$rootdir/scripts/rpc.py -s $rpc_server"
|
||||
tmp_file=/tmp/raidrandtest
|
||||
tmp_file=$SPDK_TEST_STORAGE/raidrandtest
|
||||
|
||||
source $rootdir/test/common/autotest_common.sh
|
||||
source $testdir/nbd_common.sh
|
||||
|
@ -11,8 +11,8 @@ conf_file="$testdir/bdev.json"
|
||||
: > "$conf_file"
|
||||
|
||||
function cleanup() {
|
||||
rm -f "/tmp/aiofile"
|
||||
rm -f "/tmp/spdk-pmem-pool"
|
||||
rm -f "$SPDK_TEST_STORAGE/aiofile"
|
||||
rm -f "$SPDK_TEST_STORAGE/spdk-pmem-pool"
|
||||
rm -f "$conf_file"
|
||||
|
||||
if [[ $test_type == rbd ]]; then
|
||||
@ -44,8 +44,8 @@ function setup_bdev_conf() {
|
||||
#$rpc_py bdev_set_qos_limit --rw_mbytes_per_sec 100 Malloc3
|
||||
#$rpc_py bdev_set_qos_limit --rw_ios_per_sec 20000 Malloc0
|
||||
if [[ $(uname -s) != "FreeBSD" ]]; then
|
||||
dd if=/dev/zero of=/tmp/aiofile bs=2048 count=5000
|
||||
"$rpc_py" bdev_aio_create "/tmp/aiofile" AIO0 2048
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/aiofile" bs=2048 count=5000
|
||||
"$rpc_py" bdev_aio_create "$SPDK_TEST_STORAGE/aiofile" AIO0 2048
|
||||
fi
|
||||
}
|
||||
|
||||
@ -124,9 +124,9 @@ function setup_crypto_qat_conf() {
|
||||
|
||||
function setup_pmem_conf() {
|
||||
if hash pmempool; then
|
||||
rm -f /tmp/spdk-pmem-pool
|
||||
pmempool create blk --size=32M 512 /tmp/spdk-pmem-pool
|
||||
"$rpc_py" bdev_pmem_create -n Pmem0 "/tmp/spdk-pmem-pool"
|
||||
rm -f "$SPDK_TEST_STORAGE/spdk-pmem-pool"
|
||||
pmempool create blk --size=32M 512 "$SPDK_TEST_STORAGE/spdk-pmem-pool"
|
||||
"$rpc_py" bdev_pmem_create -n Pmem0 "$SPDK_TEST_STORAGE/spdk-pmem-pool"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
@ -64,7 +64,7 @@ function nbd_get_count() {
|
||||
function nbd_dd_data_verify() {
|
||||
local nbd_list=($1)
|
||||
local operation=$2
|
||||
local tmp_file=/tmp/nbdrandtest
|
||||
local tmp_file=$SPDK_TEST_STORAGE/nbdrandtest
|
||||
|
||||
if [ "$operation" = "write" ]; then
|
||||
# data write
|
||||
|
@ -10,7 +10,7 @@ testdir=$(readlink -f $(dirname $0))
|
||||
rootdir=$(readlink -f $testdir/../..)
|
||||
rpc_server=/var/tmp/spdk-blobfs.sock
|
||||
rpc_py="$rootdir/scripts/rpc.py -s $rpc_server"
|
||||
tmp_file=/tmp/blobfs_file
|
||||
tmp_file=$SPDK_TEST_STORAGE/blobfs_file
|
||||
conf_file=/tmp/blobfs.conf
|
||||
bdevname=BlobfsBdev
|
||||
mount_dir=/tmp/spdk_tmp_mount
|
||||
|
@ -665,9 +665,9 @@ function waitfornbd() {
|
||||
# file. Note that dd returns success when reading an empty file, so we
|
||||
# need to check the size of the output file instead.
|
||||
for ((i = 1; i <= 20; i++)); do
|
||||
dd if=/dev/$nbd_name of=/tmp/nbdtest bs=4096 count=1 iflag=direct
|
||||
size=$(stat -c %s /tmp/nbdtest)
|
||||
rm -f /tmp/nbdtest
|
||||
dd if=/dev/$nbd_name of="$SPDK_TEST_STORAGE/nbdtest" bs=4096 count=1 iflag=direct
|
||||
size=$(stat -c %s "$SPDK_TEST_STORAGE/nbdtest")
|
||||
rm -f "$SPDK_TEST_STORAGE/nbdtest"
|
||||
if [ "$size" != "0" ]; then
|
||||
return 0
|
||||
else
|
||||
|
@ -189,8 +189,8 @@ function create_bdev_subsystem_config() {
|
||||
|
||||
if [[ $(uname -s) = Linux ]]; then
|
||||
# This AIO bdev must be large enough to be used as LVOL store
|
||||
dd if=/dev/zero of=/tmp/sample_aio bs=1024 count=102400
|
||||
tgt_rpc bdev_aio_create /tmp/sample_aio aio_disk 1024
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/sample_aio" bs=1024 count=102400
|
||||
tgt_rpc bdev_aio_create "$SPDK_TEST_STORAGE/sample_aio" aio_disk 1024
|
||||
expected_notifications+=(bdev_register:aio_disk)
|
||||
fi
|
||||
|
||||
@ -256,7 +256,7 @@ function cleanup_bdev_subsystem_config() {
|
||||
fi
|
||||
|
||||
if [[ $(uname -s) = Linux ]]; then
|
||||
rm -f /tmp/sample_aio
|
||||
rm -f "$SPDK_TEST_STORAGE/sample_aio"
|
||||
fi
|
||||
|
||||
if [[ $SPDK_TEST_PMDK -eq 1 && -n "$pmem_pool_file" && -f "$pmem_pool_file" ]]; then
|
||||
|
@ -41,14 +41,14 @@ function wait_for_devices_ready() {
|
||||
|
||||
function devices_initialization() {
|
||||
timing_enter devices_initialization
|
||||
dd if=/dev/zero of=/root/test0 bs=1M count=1024
|
||||
dd if=/dev/zero of=/root/test1 bs=1M count=1024
|
||||
dd if=/dev/zero of=/root/test2 bs=1M count=1024
|
||||
dd if=/dev/zero of=/root/test3 bs=1M count=1024
|
||||
monitor_cmd "drive_add 0 file=/root/test0,format=raw,id=drive0,if=none"
|
||||
monitor_cmd "drive_add 1 file=/root/test1,format=raw,id=drive1,if=none"
|
||||
monitor_cmd "drive_add 2 file=/root/test2,format=raw,id=drive2,if=none"
|
||||
monitor_cmd "drive_add 3 file=/root/test3,format=raw,id=drive3,if=none"
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/test0" bs=1M count=1024
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/test1" bs=1M count=1024
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/test2" bs=1M count=1024
|
||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/test3" bs=1M count=1024
|
||||
monitor_cmd "drive_add 0 file=$SPDK_TEST_STORAGE/test0,format=raw,id=drive0,if=none"
|
||||
monitor_cmd "drive_add 1 file=$SPDK_TEST_STORAGE/test1,format=raw,id=drive1,if=none"
|
||||
monitor_cmd "drive_add 2 file=$SPDK_TEST_STORAGE/test2,format=raw,id=drive2,if=none"
|
||||
monitor_cmd "drive_add 3 file=$SPDK_TEST_STORAGE/test3,format=raw,id=drive3,if=none"
|
||||
timing_exit devices_initialization
|
||||
}
|
||||
|
||||
@ -70,10 +70,10 @@ function remove_devices() {
|
||||
|
||||
function devices_delete() {
|
||||
timing_enter devices_delete
|
||||
rm /root/test0
|
||||
rm /root/test1
|
||||
rm /root/test2
|
||||
rm /root/test3
|
||||
rm "$SPDK_TEST_STORAGE/test0"
|
||||
rm "$SPDK_TEST_STORAGE/test1"
|
||||
rm "$SPDK_TEST_STORAGE/test2"
|
||||
rm "$SPDK_TEST_STORAGE/test3"
|
||||
timing_exit devices_delete
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,9 @@ source $rootdir/test/spdkcli/common.sh
|
||||
MATCH_FILE="spdkcli_vhost.test"
|
||||
SPDKCLI_BRANCH="/"
|
||||
|
||||
sample_aio=$SPDK_TEST_STORAGE/sample_aio
|
||||
sample_aio2=$SPDK_TEST_STORAGE/sample_aio2
|
||||
|
||||
trap 'on_error_exit' ERR
|
||||
timing_enter run_vhost_tgt
|
||||
run_vhost_tgt
|
||||
@ -25,10 +28,10 @@ $spdkcli_job "'/bdevs/malloc create 40 512 Malloc0' 'Malloc0' True
|
||||
'/bdevs/null create null_bdev0 32 512' 'null_bdev0' True
|
||||
'/bdevs/null create null_bdev1 32 512' 'null_bdev1' True
|
||||
"
|
||||
dd if=/dev/zero of=/tmp/sample_aio bs=2048 count=5000
|
||||
dd if=/dev/zero of=/tmp/sample_aio2 bs=2048 count=5000
|
||||
$spdkcli_job "'/bdevs/aio create sample0 /tmp/sample_aio 512' 'sample0' True
|
||||
'/bdevs/aio create sample1 /tmp/sample_aio2 512' 'sample1' True
|
||||
dd if=/dev/zero of="$sample_aio" bs=2048 count=5000
|
||||
dd if=/dev/zero of="$sample_aio2" bs=2048 count=5000
|
||||
$spdkcli_job "'/bdevs/aio create sample0 $sample_aio 512' 'sample0' True
|
||||
'/bdevs/aio create sample1 $sample_aio2 512' 'sample1' True
|
||||
"
|
||||
trtype=$($rootdir/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").trtype')
|
||||
traddr=$($rootdir/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").traddr')
|
||||
@ -138,7 +141,7 @@ $spdk_clear_config_py clear_config
|
||||
rm -f $testdir/config.json
|
||||
rm -f $testdir/config_bdev.json
|
||||
rm -f $testdir/config_vhost.json
|
||||
rm -f /tmp/sample_aio
|
||||
rm -f "$sample_aio" "$sample_aio2"
|
||||
timing_exit spdkcli_load_config
|
||||
|
||||
killprocess $vhost_tgt_pid
|
||||
|
@ -97,7 +97,7 @@ notice "..."
|
||||
# Using various sizes to better identify bdevs if no name in BLK
|
||||
# is available
|
||||
# TODO: use a param for blocksize for AIO and Malloc bdevs
|
||||
aio_file="$testdir/aio_disk"
|
||||
aio_file="$SPDK_TEST_STORAGE/aio_disk"
|
||||
dd if=/dev/zero of=$aio_file bs=1M count=512
|
||||
$rpc_py bdev_aio_create $aio_file Aio0 512
|
||||
$rpc_py bdev_malloc_create -b Malloc0 256 512
|
||||
|
@ -10,7 +10,7 @@ source $rootdir/test/vhost/common.sh
|
||||
# In order to run this test with windows vm
|
||||
# windows virtio scsi driver must be installed
|
||||
WINDOWS_IMG="/home/sys_sgsw/windows_scsi_compliance/windows_vm_image.qcow2"
|
||||
aio_file="$testdir/aio_disk"
|
||||
aio_file="$SPDK_TEST_STORAGE/aio_disk"
|
||||
ssh_pass=""
|
||||
vm_num=1
|
||||
keep_results_dir=false
|
||||
|
Loading…
Reference in New Issue
Block a user