Whamcloud - gitweb
LU-13759 test: make sanityn test_20 repeatable 40/39540/5
authorMikhail Pershin <mpershin@whamcloud.com>
Thu, 30 Jul 2020 11:56:46 +0000 (14:56 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Aug 2020 05:59:11 +0000 (05:59 +0000)
- 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 <mpershin@whamcloud.com>
Change-Id: I314703006a8f53092daf1359f4c4694c704354d2
Reviewed-on: https://review.whamcloud.com/39540
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/sanity-dom.sh
lustre/tests/sanityn.sh

index a94494d..a95d62b 100644 (file)
@@ -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
 }
index 5dae9be..ec00a5e 100755 (executable)
@@ -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 ===="