Whamcloud - gitweb
LU-16683 tests: fix sanity-sec test_61 for SSK 76/50476/4
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 30 Mar 2023 11:42:58 +0000 (13:42 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 3 Apr 2023 22:06:25 +0000 (22:06 +0000)
When SHARED_KEY is in use, nodemap specific shared keys must be loaded
explicitly because sanity-sec test_61 defines a nodemap dedicated to
the client.

Fixes: a7222127c7 ("LU-16642 tests: improve sanity-sec test_61")
Test-Parameters: trivial
Test-Parameters: testlist=sanity-sec env=ONLY=61
Test-Parameters: testlist=sanity-sec env=SHARED_KEY=true,ONLY=61
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I206205496352b6f36341c8b962bb7de4b71541d5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50476
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-sec.sh

index 9defd89..546f8e7 100755 (executable)
@@ -5104,6 +5104,11 @@ test_60() {
 run_test 60 "Subdirmount of encrypted dir"
 
 setup_61() {
+       if $SHARED_KEY; then
+               export SK_UNIQUE_NM=true
+               export FILESET="/"
+       fi
+
        do_facet mgs $LCTL nodemap_activate 1
        wait_nm_sync active
 
@@ -5142,6 +5147,11 @@ cleanup_61() {
        do_facet mgs $LCTL nodemap_activate 0
        wait_nm_sync active 0
 
+       if $SHARED_KEY; then
+               unset FILESET
+               export SK_UNIQUE_NM=false
+       fi
+
        mount_client $MOUNT ${MOUNT_OPTS} || error "re-mount failed"
        wait_ssk
 }
@@ -5156,6 +5166,9 @@ test_61() {
                skip "Server does not have readonly_mount nodemap flag"
 
        stack_trap cleanup_61 EXIT
+       for idx in $(seq 1 $MDSCOUNT); do
+               wait_recovery_complete mds$idx
+       done
        umount_client $MOUNT || error "umount $MOUNT failed (1)"
 
        # Activate nodemap, and mount rw.
@@ -5170,7 +5183,7 @@ test_61() {
        [ $readonly -eq 0 ] ||
                error "wrong default value for readonly_mount on nodemap c0"
 
-       mount_client $MOUNT ${MOUNT_OPTS},rw ||
+       zconf_mount_clients $HOSTNAME $MOUNT ${MOUNT_OPTS},rw ||
                error "mount '-o rw' failed with default"
        wait_ssk
        findmnt $MOUNT --output=options -n -f | grep -q "rw," ||
@@ -5183,21 +5196,21 @@ test_61() {
        do_facet mgs $LCTL nodemap_modify --name c0 \
                --property readonly_mount --value 1
        wait_nm_sync c0 readonly_mount
-       mount_client $MOUNT ${MOUNT_OPTS} ||
+       zconf_mount_clients $HOSTNAME $MOUNT ${MOUNT_OPTS} ||
                error "mount failed"
        findmnt $MOUNT --output=options -n -f | grep -q "ro," ||
                error "mount should have been turned into ro"
        cat $testfile || error "read $testfile failed (1)"
        echo b > $testfile && error "write $testfile should fail (1)"
        umount_client $MOUNT || error "umount $MOUNT failed (3)"
-       mount_client $MOUNT ${MOUNT_OPTS},rw ||
+       zconf_mount_clients $HOSTNAME $MOUNT ${MOUNT_OPTS},rw ||
                error "mount '-o rw' failed"
        findmnt $MOUNT --output=options -n -f | grep -q "ro," ||
                error "mount rw should have been turned into ro"
        cat $testfile || error "read $testfile failed (2)"
        echo b > $testfile && error "write $testfile should fail (2)"
        umount_client $MOUNT || error "umount $MOUNT failed (4)"
-       mount_client $MOUNT ${MOUNT_OPTS},ro ||
+       zconf_mount_clients $HOSTNAME $MOUNT ${MOUNT_OPTS},ro ||
                error "mount '-o ro' failed"
        wait_ssk
        cat $testfile || error "read $testfile failed (3)"