From: Sebastien Buisson Date: Tue, 30 Aug 2022 09:22:34 +0000 (+0200) Subject: LU-16125 tests: make sanity-sec more robust with SSK X-Git-Tag: 2.15.53~184 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bee889e87584aa3bd2e6819db73d6adf129460ee;p=fs%2Flustre-release.git LU-16125 tests: make sanity-sec more robust with SSK Encryption related tests in sanity-sec carry out unmount and mount of clients in order to exercise code with and without the encryption key. In case SSK is in use, we need to make sure flavors are properly applied before carrying on. Signed-off-by: Sebastien Buisson Change-Id: I92e85dc6dcef43f70a7fe05db94cd18fe66a3a24 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48386 Reviewed-by: Zhenyu Xu Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index c25ef3c..d4d7c30 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -2733,6 +2733,18 @@ remove_enc_key() { fi } +wait_ssk() { + # wait for SSK flavor to be applied if necessary + if $GSS_SK; then + if $SK_S2S; then + wait_flavor all2all $SK_FLAVOR + else + wait_flavor cli2mdt $SK_FLAVOR + wait_flavor cli2ost $SK_FLAVOR + fi + fi +} + remount_client_normally() { # remount client without dummy encryption key if is_mounted $MOUNT; then @@ -2750,6 +2762,7 @@ remount_client_normally() { fi remove_enc_key + wait_ssk } remount_client_dummykey() { @@ -2761,6 +2774,8 @@ remount_client_dummykey() { fi mount_client $MOUNT ${MOUNT_OPTS},test_dummy_encryption || error "remount failed" + + wait_ssk } setup_for_enc_tests() { @@ -2771,6 +2786,8 @@ setup_for_enc_tests() { mount_client $MOUNT ${MOUNT_OPTS},test_dummy_encryption || error "mount with '-o test_dummy_encryption' failed" + wait_ssk + # this directory will be encrypted, because of dummy mode mkdir $DIR/$tdir } @@ -2803,6 +2820,7 @@ cleanup_nodemap_after_enc_tests() { wait_nm_sync active mount_client $MOUNT ${MOUNT_OPTS} || error "re-mount failed" + wait_ssk } test_36() { @@ -4439,6 +4457,7 @@ test_54() { export FILESET=/$tdir mount_client $MOUNT ${MOUNT_OPTS} || error "remount failed (1)" export FILESET="" + wait_ssk # setup encryption from inside this subdir mount # the .fscrypt directory is going to be created at the real fs root @@ -4489,6 +4508,7 @@ test_54() { export FILESET=/$tdir/vault mount_client $MOUNT ${MOUNT_OPTS} || error "remount failed (2)" export FILESET="" + wait_ssk ls -laR $MOUNT fid2=$(path2fid $MOUNT/.fscrypt) echo "With FILESET $tdir/vault, .fscrypt FID is $fid2" @@ -4505,6 +4525,7 @@ test_54() { # remount client without subdir mount umount_client $MOUNT || error "umount $MOUNT failed (3)" mount_client $MOUNT ${MOUNT_OPTS} || error "remount failed (3)" + wait_ssk ls -laR $MOUNT fid2=$(path2fid $MOUNT/.fscrypt) echo "Without FILESET, .fscrypt FID is $fid2" @@ -4566,6 +4587,7 @@ cleanup_55() { if [ "$MOUNT_2" ]; then mount_client $MOUNT2 ${MOUNT_OPTS} || error "remount failed" fi + wait_ssk } test_55() { @@ -4629,6 +4651,7 @@ test_55() { zconf_mount_clients $HOSTNAME $MOUNT $MOUNT_OPTS || error "remount failed" unset FILESET + wait_ssk euid_access $USER0 $DIR/$tdir/$USER0/testdir_groups/file } @@ -5014,6 +5037,7 @@ test_60() { if [ "$MOUNT_2" ]; then mount_client $MOUNT2 ${MOUNT_OPTS} || error "remount failed" fi + wait_ssk ls -Rl $DIR || error "ls -Rl $DIR failed (1)" @@ -5057,6 +5081,7 @@ test_61() { mount_client $MOUNT ${MOUNT_OPTS},rw || error "mount '-o rw' failed with default" + wait_ssk findmnt $MOUNT --output=options -n -f | grep -q "rw," || error "should be rw mount" mkdir -p $DIR/$tdir || error "mkdir $DIR/$tdir failed" @@ -5071,6 +5096,7 @@ test_61() { error "mount '-o rw' should have failed" mount_client $MOUNT ${MOUNT_OPTS},ro || error "mount '-o ro' failed" + wait_ssk cat $testfile || error "read $testfile failed" echo b > $testfile && error "write $testfile should fail" umount_client $MOUNT || error "umount $MOUNT failed (3)"