Whamcloud - gitweb
LU-15098 tests: sanity-sec 27a exec commands on right node 93/45293/3
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 19 Oct 2021 15:59:33 +0000 (17:59 +0200)
committerOleg Drokin <green@whamcloud.com>
Wed, 3 Nov 2021 02:38:37 +0000 (02:38 +0000)
In nodemap_exercise_fileset called from sanity-sec test 27a,
make sure all commands are executed on first client, as we are
testing properties of nodemaps 'default' and 'c0'.
And make sure 'default' nodemap has admin and trusted properties
set to 1, as we are carrying operations as root.

Test-Parameters: trivial
Test-Parameters: testlist=sanity-sec clientcount=2 env=ONLY=27a
Fixes: 0daeebcbdc ("LU-14797 nodemap: map project id")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Idd9f391db60475721f3a3856b5e3bee1a18bbbca
Reviewed-on: https://review.whamcloud.com/45293
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-sec.sh

index 328cb9e..a7c3074 100755 (executable)
@@ -1962,6 +1962,12 @@ nodemap_exercise_fileset() {
        if [ "$nm" == "default" ]; then
                do_facet mgs $LCTL nodemap_activate 1
                wait_nm_sync active
        if [ "$nm" == "default" ]; then
                do_facet mgs $LCTL nodemap_activate 1
                wait_nm_sync active
+               do_facet mgs $LCTL nodemap_modify --name default \
+                       --property admin --value 1
+               do_facet mgs $LCTL nodemap_modify --name default \
+                       --property trusted --value 1
+               wait_nm_sync default admin_nodemap
+               wait_nm_sync default trusted_nodemap
                check_proj=false
        else
                nodemap_test_setup
                check_proj=false
        else
                nodemap_test_setup
@@ -2014,10 +2020,10 @@ nodemap_exercise_fileset() {
                error "fileset not taken into account"
 
        if $check_proj; then
                error "fileset not taken into account"
 
        if $check_proj; then
-               $LFS setquota -p 1  -b 10000 -B 11000 -i 0 -I 0 $MOUNT ||
-                       error "setquota -p 1 failed"
-               $LFS setquota -p 2  -b 10000 -B 11000 -i 0 -I 0 $MOUNT &&
-                       error "setquota -p 2 should have failed"
+               do_node ${clients_arr[0]} $LFS setquota -p 1 -b 10000 -B 11000 \
+                       -i 0 -I 0 $MOUNT || error "setquota -p 1 failed"
+               do_node ${clients_arr[0]} $LFS setquota -p 2 -b 10000 -B 11000 \
+                       -i 0 -I 0 $MOUNT && error "setquota -p 2 should fail"
        fi
 
        # re-mount client with sub-subdir
        fi
 
        # re-mount client with sub-subdir
@@ -2062,6 +2068,12 @@ nodemap_exercise_fileset() {
        fi
        fileset_test_cleanup "$nm"
        if [ "$nm" == "default" ]; then
        fi
        fileset_test_cleanup "$nm"
        if [ "$nm" == "default" ]; then
+               do_facet mgs $LCTL nodemap_modify --name default \
+                        --property admin --value 0
+               do_facet mgs $LCTL nodemap_modify --name default \
+                        --property trusted --value 0
+               wait_nm_sync default admin_nodemap
+               wait_nm_sync default trusted_nodemap
                do_facet mgs $LCTL nodemap_activate 0
                wait_nm_sync active 0
                trap 0
                do_facet mgs $LCTL nodemap_activate 0
                wait_nm_sync active 0
                trap 0