Whamcloud - gitweb
LU-13042 tests: give more time in sanity-selinux test_21b 05/36905/3
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 3 Dec 2019 02:06:48 +0000 (11:06 +0900)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Jan 2020 00:08:32 +0000 (00:08 +0000)
In sanity-selinux test_21b, set sepol refresh time to 1000 seconds
instead of 10. This gives plenty of time for file/dir access tests,
and also cache drop, to complete. Then reset send_sepol to a smaller,
already expired value, to force sepol refresh.

Test-Parameters: trivial
Test-Parameters: clientselinux mdtcount=4 testlist=sanity-selinux envdefinitions=ONLY="21b"
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I57f72faad4bd55736a3240cdefdac2e5814eba79
Reviewed-on: https://review.whamcloud.com/36905
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-selinux.sh

index c3990be..6972f46 100755 (executable)
@@ -712,8 +712,9 @@ test_21b() {
        do_facet mgs $LCTL set_param -P nodemap.c0.sepol="$sepol"
        check_nodemap c0 sepol $sepol
 
-       # metadata ops with sepol every 10 seconds only
-       echo 10 > /sys/module/ptlrpc/parameters/send_sepol
+       # metadata ops with sepol every 1000 seconds only
+       echo 1000 > /sys/module/ptlrpc/parameters/send_sepol
+       local before=$(date +%s)
        touch $DIR/$tdir/f6 || error "touch (4)"
        lfs setstripe -c1 $DIR/$tdir/f7 || error "lfs setstripe (4)"
        mkdir $DIR/$tdir/d6 || error "mkdir (4)"
@@ -762,7 +763,9 @@ test_21b() {
        ln $DIR/$tdir/toopen $DIR/$tdir/toopen_hl5 || error "hardlink (5)"
        echo 3 > /proc/sys/vm/drop_caches
 
-       sleep 10
+       local after=$(date +%s)
+       # change send_sepol to a smaller, already expired, value
+       echo $((after-before-1)) > /sys/module/ptlrpc/parameters/send_sepol
        # metadata ops without matching sepol: should fail now
        touch $DIR/$tdir/f10 && error "touch (6)"
        lfs setstripe -c1 $DIR/$tdir/f11 && error "lfs setstripe (6)"