From 910ed44d1f3844ae3f76a3594dbd1a09b5892643 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Thu, 30 Jul 2020 14:56:46 +0300 Subject: [PATCH] LU-13759 test: make sanityn test_20 repeatable - make sanityn.sh test_20 able to work with ONLY_REPEAT parameter by using $tdir and $tfile variable which are cleaned up by test framework and test can be repeated - change sanity-dom.sh way to define sanity.sh and sanityn.sh parameters to allow selected tests run by using SANITY_ONLY, SANITYN_ONLY to choose specific tests. It supports also SANITY_REPEAT/SANITYN_REPEAT to repeat those tests. Test-Parameters: trivial testlist=sanity-dom env=SANITY_ONLY=36,SANITYN_ONLY=20,SANITYN_REPEAT=50 Signed-off-by: Mikhail Pershin Change-Id: I314703006a8f53092daf1359f4c4694c704354d2 Reviewed-on: https://review.whamcloud.com/39540 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Reviewed-by: Wei Liu --- lustre/tests/sanity-dom.sh | 14 ++++++++++---- lustre/tests/sanityn.sh | 16 ++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lustre/tests/sanity-dom.sh b/lustre/tests/sanity-dom.sh index a94494d..a95d62b 100644 --- a/lustre/tests/sanity-dom.sh +++ b/lustre/tests/sanity-dom.sh @@ -179,10 +179,13 @@ run_test fsx "Dual-mount fsx with DoM files" test_sanity() { + SANITY_ONLY=${SANITY_ONLY:-"36 39 40 41 42d 42e 43 46 56r 101e 119a \ + 131 150 155a 155b 155c 155d 207 241 251"} + SANITY_REPEAT=${SANITY_REPEAT:-1} # XXX: to fix 45. Add 42a, c when LU-9693 fixed. # Add 42b when LU-6493 fixed - ONLY="36 39 40 41 42d 42e 43 46 56r 101e 119a 131 150 155a 155b 155c \ - 155d 207 241 251" OSC="mdc" DOM="yes" bash sanity.sh + ONLY=$SANITY_ONLY ONLY_REPEAT=$SANITY_REPEAT OSC="mdc" DOM="yes" \ + bash sanity.sh return 0 } @@ -190,9 +193,12 @@ run_test sanity "Run sanity with Data-on-MDT files" test_sanityn() { + SANITYN_ONLY=${SANITYN_ONLY:-"1 2 4 5 6 7 8 9 10 11 12 14 17 19 20 \ + 23 27 39 51a 51c 51d"} + SANITYN_REPEAT=${SANITYN_REPEAT:-1} # XXX: to fix 60 - ONLY="1 2 4 5 6 7 8 9 10 11 12 14 17 19 20 23 27 39 51a 51c 51d" \ - OSC="mdc" DOM="yes" bash sanityn.sh + ONLY=$SANITYN_ONLY ONLY_REPEAT=$SANITYN_REPEAT OSC="mdc" DOM="yes" \ + bash sanityn.sh return 0 } diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 5dae9be..ec00a5e 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -588,16 +588,16 @@ test_19() { # bug3811 run_test 19 "test concurrent uncached read races ===============" test_20() { - test_mkdir $DIR1/d20 + test_mkdir $DIR1/$tdir cancel_lru_locks - CNT=$((`lctl get_param -n llite.*.dump_page_cache | wc -l`)) - $MULTIOP $DIR1/f20 Ow8190c - $MULTIOP $DIR2/f20 Oz8194w8190c - $MULTIOP $DIR1/f20 Oz0r8190c + CNT=$($LCTL get_param -n llite.*.dump_page_cache | wc -l) + $MULTIOP $DIR1/$tdir/$tfile Ow8190c + $MULTIOP $DIR2/$tdir/$tfile Oz8194w8190c + $MULTIOP $DIR1/$tdir/$tfile Oz0r8190c cancel_lru_locks - CNTD=$((`lctl get_param -n llite.*.dump_page_cache | wc -l` - $CNT)) - [ $CNTD -gt 0 ] && \ - error $CNTD" page left in cache after lock cancel" || true + CNT2=$($LCTL get_param -n llite.*.dump_page_cache | wc -l) + [[ $CNT2 == $CNT ]] || + error $((CNT2 - CNT))" page left in cache after lock cancel" } run_test 20 "test extra readahead page left in cache ====" -- 1.8.3.1