fstests: -I <n> CLI option and some random fixes
cover fstests: -I <n> CLI option and some random fixes
Patch-1: is a v2 with comments addressed from Eryu. Patch-{2,3}: are random fixes found during testing.
Ritesh Harjani (3):
check: add CLI option to repeat and stop tests in case of failure common/rc: Add _require_get_hugepagesize and fix
_require_label_get_max
generic/{413/605}: Add _require_get_hugepagesize check
check | 8 ++++++++ common/rc | 8 +++++++- tests/generic/413 | 1 + tests/generic/605 | 1 + 4 files changed, 17 insertions(+), 1 deletion(-)
--
PATCH v2 1/3 check: add CLI option to repeat and stop tests in case of failure
Currently with -i <n> option the test can run for many iterations, but in case if we want to stop the iteration in case of a failure, it is much easier to have such an option which could check the failed status and stop the test from further proceeding.
This patch adds such an option (-I <n>) thereby extending the -i <n> option functionality.
--- check | 8 ++++++++ 1 file changed, 8 insertions(+)
check +8 -0
@@ -27,6 +27,7 @@ brief_test_summary=false do_report=false DUMP_OUTPUT=false iterations=1 +istop=false # This is a global variable used to pass test failure text to reporting gunk _err_msg=""
@@ -68,6 +69,7 @@ check options -T output timestamps -r randomize test order -i <n> iterate the test list <n> times + -I <n> iterate the test list <n> times, but stops iterating further in case of any test failure -d dump test output to stdout -b brief test summary -R fmt[,fmt] generate report in formats specified. Supported format: [xunit]
@@ -300,6 +302,7 @@ while [ $# -gt 0 ]; do -n) showme=true ;; -r) randomize=true ;; -i) iterations=$2; shift ;; + -I) iterations=$2; istop=true; shift ;; -T) timestamp=true ;; -d) DUMP_OUTPUT=true ;; -b) brief_test_summary=true;;
@@ -926,6 +929,11 @@ function run_section() for ((iters = 0; iters < $iterations; iters++)) do for section in $HOST_OPTIONS_SECTIONS; do run_section $section + if [ "$sum_bad" != 0 ] && [ "$istop" = true ]; then + interrupt=false + status=`expr $sum_bad != 0` + exit + fi done done
--
PATCH 2/3 common/rc: Add _require_get_hugepagesize and fix _require_label_get_max
In reply to Ritesh Harjani_notrun executed from a subshell $(cmd) won't exit it's parent. Hence _require_*** functions shouldn't have below statements.
dummy=$(_label_get_max)
Also add a function _require_get_hugepagesize(), since it seems the intention of _get_hugepagesize() is to also '_notrun' when the hugepagesize is not a valid number.
--- common/rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
common/rc +7 -1
@@ -175,6 +175,12 @@ _get_hugepagesize() echo $((hugepgsz * 1024)) } +_require_get_hugepagesize() +{ + # Just a dummy for _notrun if hugepagesize is not supported + _get_hugepagesize +} + _mount() { $MOUNT_PROG `_mount_ops_filter $*`
@@ -4250,7 +4256,7 @@ _label_get_max() _require_label_get_max() { # Just call _label_get_max which will notrun if appropriate - dummy=$(_label_get_max) + _label_get_max } _dmsetup_remove()
--
Re: [PATCH 2/3] common/rc: Add _require_get_hugepagesize and fix _require_label_get_max
Quoted 17 lines · Ritesh Harjani
_notrunexecuted from a subshell $(cmd) won't exit it's parent. Hence _require_*** functions shouldn't have below statements.dummy=$(_label_get_max)Also add a function
_require_get_hugepagesize(), since it seems the intention of_get_hugepagesize()is to also '_notrun' when the hugepagesize is not a valid number.Signed-off-by Ritesh Harjani <[email protected]>--- common/rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)common/rc +0
-0
common/rc _get_hugepagesize() · line 183
Quoted 9 lines
common/rc +6
-0@@ -175,6 +175,12 @@ _get_hugepagesize() echo $((hugepgsz * 1024)) } +_require_get_hugepagesize() +{ + # Just a dummy for _notrun if hugepagesize is not supported + _get_hugepagesize +} +
I think this hunk should be moved to patch 3.
Otherwise patch looks fine to me. And I applied patch 1 for next update, thanks!
Eryu
Quoted 13 lines
common/rc +1
-2_mount() { $MOUNT_PROG `_mount_ops_filter $*`@@ -4250,7 +4256,7 @@ _label_get_max() _require_label_get_max() { # Just call _label_get_max which will notrun if appropriate - dummy=$(_label_get_max) + _label_get_max } _dmsetup_remove() --
PATCH 3/3 generic/{413/605}: Add _require_get_hugepagesize check
In reply to Ritesh HarjaniThis adds _require_get_hugepagesize() check at the beginning, which seems like was the intention earlier behind function _get_hugepagesize().
--- tests/generic/413 | 1 + tests/generic/605 | 1 + 2 files changed, 2 insertions(+)
tests/generic/413 +1 -0
@@ -34,6 +34,7 @@ _require_scratch_dax_mountopt "dax" _require_test_program "feature" _require_test_program "t_mmap_dio" _require_xfs_io_command "falloc" +_require_get_hugepagesize prep_files() {
tests/generic/605 +1 -0
@@ -34,6 +34,7 @@ _require_test_program "feature" _require_test_program "t_mmap_dio" _require_dax_iflag _require_xfs_io_command "falloc" +_require_get_hugepagesize SRC_DIR=$SCRATCH_MNT/src SRC_FILE=$SRC_DIR/tf_s
--
Ritesh Harjani (signature)
Quoted 9 lines · Ritesh Harjani
Patch-1: is a v2 with comments addressed from Eryu. Patch-{2,3}: are random fixes found during testing.
Ritesh Harjani (3):
check: add CLI option to repeat and stop tests in case of failure common/rc: Add_require_get_hugepagesizeand fix
_require_label_get_max
generic/{413/605}: Add_require_get_hugepagesizecheck
Quoted 6 lines
check | 8 ++++++++ common/rc | 8 +++++++- tests/generic/413 | 1 + tests/generic/605 | 1 + 4 files changed, 17 insertions(+), 1 deletion(-)
Ping.
-ritesh