Sometimes, it can be useful to inspect the state of the zones of the
test device, usually right after a test failure. Currently,
test-zbd-support script just keeps running and proper examination of
device zones can be difficult.
Add the -q option to test/zbd/support to quit immediately upon
encountering any test failure. Additionally, define the same option
in run-tests-against-nullb to propagate it to test/zbd/support.
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
echo -e "\t-o <max_open_zones> Specify MaxOpen value, (${set_max_open} by default)."
echo -e "\t-n <#number of runs> Set the number of times to run the entire suite "
echo -e "\t or an individual section/test."
+ echo -e "\t-q Quit t/zbd/test-zbd-support run after any failed test."
echo -e "\t-r Remove the /dev/nullb0 device that may still exist after"
echo -e "\t running this script."
exit 1
libzbc=0
num_of_runs=1
test_case=0
+quit_on_err=0
while (($#)); do
case "$1" in
-l) libzbc=1; shift;;
-n) num_of_runs="${2}"; shift; shift;;
-t) test_case="${2}"; shift; shift;;
+ -q) quit_on_err=1; shift;;
-h) usage; break;;
--) shift; break;;
*) usage; exit 1;;
if ((test_case)); then
zbd_test_opts+=("-t" "${test_case}")
fi
+ if ((quit_on_err)); then
+ zbd_test_opts+=("-q")
+ fi
section$section_number
configure_nullb
rc=$?
exit 1
fi
((intr)) && exit 1
- (($test_rc)) && rc=1
+ if (($test_rc)); then
+ rc=1
+ ((quit_on_err)) && break
+ fi
done
+ ((rc && quit_on_err)) && break
run_nr=$((run_nr + 1))
done
echo -e "\t-r Reset all zones before test start"
echo -e "\t-o <max_open_zones> Run fio with max_open_zones limit"
echo -e "\t-t <test #> Run only a single test case with specified number"
+ echo -e "\t-q Quit the test run after any failed test"
echo -e "\t-z Run fio with debug=zbd option"
}
use_libzbc=
zbd_debug=
max_open_zones_opt=
+quit_on_err=
while [ "${1#-}" != "$1" ]; do
case "$1" in
-o) max_open_zones_opt="${2}"; shift; shift;;
-v) dynamic_analyzer=(valgrind "--read-var-info=yes");
shift;;
+ -q) quit_on_err=1; shift;;
-z) zbd_debug=1; shift;;
--) shift; break;;
esac
echo -e "$cc_status"
echo "$status" >> "${logfile}.${test_number}"
[ $intr -ne 0 ] && exit 1
+ [ -n "$quit_on_err" -a "$rc" -ne 0 ] && exit 1
done
echo "$passed tests passed"