Whamcloud - gitweb
LU-13133 tests: sanity-selinux test_21{a,b} sepol update 24/37224/3
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 14 Jan 2020 11:51:55 +0000 (20:51 +0900)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:51:35 +0000 (05:51 +0000)
We need to make sure MDS receives updated sepol info from MGS.
In case of combined MGT/MDT, directly setting fileset on the node
will mask llog-based info retrieval mechanism. So always use
'lctl set_param -P' to set sepol value.

Test-Parameters: trivial
Test-Parameters: clientselinux testlist=sanity-selinux
Test-Parameters: clientselinux testlist=sanity-selinux
Test-Parameters: clientselinux testlist=sanity-selinux
Test-Parameters: clientselinux testlist=sanity-selinux
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iaf8ff13364b9ba5f5d8b733be0247d79e05a6b3d
Reviewed-on: https://review.whamcloud.com/37224
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-selinux.sh

index 6972f46..44ec962 100755 (executable)
@@ -505,7 +505,6 @@ create_nodemap() {
        check_nodemap $nm trusted_nodemap 1
 
        sepol=$(l_getsepol | cut -d':' -f2- | xargs)
-       do_facet mgs $LCTL set_param nodemap.$nm.sepol="$sepol"
        do_facet mgs $LCTL set_param -P nodemap.$nm.sepol="$sepol"
 
        check_nodemap $nm sepol $sepol
@@ -516,6 +515,11 @@ remove_nodemap() {
 
        do_facet mgs $LCTL nodemap_del $nm
 
+       wait_update_facet --verbose mds1 \
+               "$LCTL get_param nodemap.$nm.id 2>/dev/null | \
+               grep -c $nm || true" 0 30 ||
+               error "nodemap $nm could not be removed"
+
        do_facet mgs $LCTL nodemap_activate 0
 
        check_nodemap active x  0
@@ -569,7 +573,6 @@ test_21a() {
 
        # store wrong sepol in nodemap
        sepol="0:policy:0:0000000000000000000000000000000000000000000000000000000000000000"
-       do_facet mgs $LCTL set_param nodemap.c0.sepol="$sepol"
        do_facet mgs $LCTL set_param -P nodemap.c0.sepol="$sepol"
        check_nodemap c0 sepol $sepol
 
@@ -683,7 +686,6 @@ test_21b() {
 
        # store wrong sepol in nodemap
        sepol="0:policy:0:0000000000000000000000000000000000000000000000000000000000000000"
-       do_facet mgs $LCTL set_param nodemap.c0.sepol="$sepol"
        do_facet mgs $LCTL set_param -P nodemap.c0.sepol="$sepol"
        check_nodemap c0 sepol $sepol
 
@@ -708,7 +710,6 @@ test_21b() {
 
        # reset correct sepol
        sepol=$(l_getsepol | cut -d':' -f2- | xargs)
-       do_facet mgs $LCTL set_param nodemap.c0.sepol="$sepol"
        do_facet mgs $LCTL set_param -P nodemap.c0.sepol="$sepol"
        check_nodemap c0 sepol $sepol