diff --git a/test/bdev/bdev_raid.sh b/test/bdev/bdev_raid.sh index 13582dfaae..c85d33f6ed 100755 --- a/test/bdev/bdev_raid.sh +++ b/test/bdev/bdev_raid.sh @@ -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 diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index b31f60d54f..ea0ea5e437 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.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 diff --git a/test/bdev/nbd_common.sh b/test/bdev/nbd_common.sh index d72dcffc15..2ea7656498 100644 --- a/test/bdev/nbd_common.sh +++ b/test/bdev/nbd_common.sh @@ -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 diff --git a/test/blobfs/blobfs.sh b/test/blobfs/blobfs.sh index f8ca2c9eff..4b4af6730e 100755 --- a/test/blobfs/blobfs.sh +++ b/test/blobfs/blobfs.sh @@ -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 diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 69f7e53f49..fcff2fe7a9 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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 diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index 867c65b6f2..a3b3ce07f1 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -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 diff --git a/test/nvme/hotplug.sh b/test/nvme/hotplug.sh index 35d267c402..f3ac0122e8 100755 --- a/test/nvme/hotplug.sh +++ b/test/nvme/hotplug.sh @@ -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 } diff --git a/test/spdkcli/vhost.sh b/test/spdkcli/vhost.sh index 438a46f354..809a322f82 100755 --- a/test/spdkcli/vhost.sh +++ b/test/spdkcli/vhost.sh @@ -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 diff --git a/test/vhost/windows/windows.sh b/test/vhost/windows/windows.sh index 182f1ae645..6bf8573f7c 100755 --- a/test/vhost/windows/windows.sh +++ b/test/vhost/windows/windows.sh @@ -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 diff --git a/test/vhost/windows/windows_scsi_compliance.sh b/test/vhost/windows/windows_scsi_compliance.sh index e95a4f6e15..d7c854592f 100755 --- a/test/vhost/windows/windows_scsi_compliance.sh +++ b/test/vhost/windows/windows_scsi_compliance.sh @@ -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