From: Bart Van Assche Date: Wed, 14 Aug 2019 20:10:07 +0000 (-0700) Subject: zbd: Improve robustness of unit tests X-Git-Tag: fio-3.16~31 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=27bbef0cb264b7d66a5f93424d6fc6ff973e22a2;hp=379e5f09a16f789f3d15ff5541a42e1e74d2b383 zbd: Improve robustness of unit tests Give up if creation of the null_blk instance fails. Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe --- diff --git a/t/zbd/run-tests-against-zoned-nullb b/t/zbd/run-tests-against-zoned-nullb index 9336716d..0952011c 100755 --- a/t/zbd/run-tests-against-zoned-nullb +++ b/t/zbd/run-tests-against-zoned-nullb @@ -24,6 +24,6 @@ modprobe null_blk nr_devices=0 && echo 4096 > blocksize && echo 1024 > size && echo 1 > memory_backed && - echo 1 > power + echo 1 > power || exit $? "${scriptdir}"/test-zbd-support "$@" /dev/nullb0 diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 6fb48ef0..ed54a0aa 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -772,8 +772,8 @@ source "$(dirname "$0")/functions" || exit $? dev=$1 realdev=$(readlink -f "$dev") basename=$(basename "$realdev") -major=$((0x$(stat -L -c '%t' "$realdev"))) -minor=$((0x$(stat -L -c '%T' "$realdev"))) +major=$((0x$(stat -L -c '%t' "$realdev"))) || exit $? +minor=$((0x$(stat -L -c '%T' "$realdev"))) || exit $? disk_size=$(($(<"/sys/dev/block/$major:$minor/size")*512)) # When the target is a partition device, get basename of its holder device to # access sysfs path of the holder device