All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] zbd: Fix test scripts
@ 2018-09-05  8:02 Damien Le Moal
  2018-09-05 14:21 ` Bart Van Assche
  2018-09-05 14:36 ` Jens Axboe
  0 siblings, 2 replies; 6+ messages in thread
From: Damien Le Moal @ 2018-09-05  8:02 UTC (permalink / raw)
  To: fio, Jens Axboe; +Cc: Bart Van Assche

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...".

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
Changes from v2:
* Avoid shellcheck warnings as suggested by Bart.
Changes from v1:
* Use a scriptdir variable as suggested by Bart.

 t/zbd/run-tests-against-regular-nullb | 4 +++-
 t/zbd/run-tests-against-zoned-nullb   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/t/zbd/run-tests-against-regular-nullb b/t/zbd/run-tests-against-regular-nullb
index 133c7c41..0f6e4b66 100755
--- a/t/zbd/run-tests-against-regular-nullb
+++ b/t/zbd/run-tests-against-regular-nullb
@@ -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
diff --git a/t/zbd/run-tests-against-zoned-nullb b/t/zbd/run-tests-against-zoned-nullb
index 7d9eb439..9336716d 100755
--- a/t/zbd/run-tests-against-zoned-nullb
+++ b/t/zbd/run-tests-against-zoned-nullb
@@ -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
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-06  1:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05  8:02 [PATCH v3] zbd: Fix test scripts Damien Le Moal
2018-09-05 14:21 ` Bart Van Assche
2018-09-05 14:36 ` Jens Axboe
2018-09-06  1:08   ` Damien Le Moal
2018-09-06  1:12     ` Damien Le Moal
2018-09-06  1:26       ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.