zbd: Fix test scripts
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 5 Sep 2018 08:02:37 +0000 (17:02 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Sep 2018 14:36:14 +0000 (08:36 -0600)
Fix handling of the path to the test-zbd-support script to avoid an
error when the tests are run directly when in fio/t/zbd using the
command "./run-against...".

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/run-tests-against-regular-nullb
t/zbd/run-tests-against-zoned-nullb

index 133c7c412f48847957a43faef4831b6420a2d004..0f6e4b662964ed41183dd2ab9c7ba36809f9cafc 100755 (executable)
@@ -4,6 +4,8 @@
 #
 # This file is released under the GPL.
 
+scriptdir="$(cd "$(dirname "$0")" && pwd)"
+
 for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done
 modprobe -r null_blk
 modprobe null_blk nr_devices=0 || return $?
@@ -22,4 +24,4 @@ modprobe null_blk nr_devices=0 &&
     echo 1 > memory_backed &&
     echo 1 > power
 
-"$(dirname "$0")"/test-zbd-support "$@" /dev/nullb0
+"${scriptdir}"/test-zbd-support "$@" /dev/nullb0
index 7d9eb439a4459c9dfa4a4c2ae5ad7aa81e2f6730..9336716d47626da7523d77d17156c7bb3dfed3f0 100755 (executable)
@@ -4,6 +4,8 @@
 #
 # This file is released under the GPL.
 
+scriptdir="$(cd "$(dirname "$0")" && pwd)"
+
 for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done
 modprobe -r null_blk
 modprobe null_blk nr_devices=0 || return $?
@@ -24,4 +26,4 @@ modprobe null_blk nr_devices=0 &&
     echo 1 > memory_backed &&
     echo 1 > power
 
-"$(dirname "$0")"/test-zbd-support "$@" /dev/nullb0
+"${scriptdir}"/test-zbd-support "$@" /dev/nullb0