Whamcloud - gitweb
LU-15407 test: remove dummy enc key at cleanup
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 11 Jan 2022 07:27:42 +0000 (08:27 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 21 Mar 2022 18:48:32 +0000 (18:48 +0000)
Make sure to remove the dummy encryption key from session keyring
when cleaning up encryption tests.

Lustre-change: https://review.whamcloud.com/46038
Lustre-commit: ec0b308614a2bad18a7a1fd805f36eb8ed6ea5eb

Test-Parameters: trivial
Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I840490fca0a485110d077fe85254ced817fd55e3
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46173
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-sec.sh

index e096f72..10b0c93 100755 (executable)
@@ -2737,6 +2737,8 @@ setup_for_enc_tests() {
 }
 
 cleanup_for_enc_tests() {
+       local dummy_key
+
        rm -rf $DIR/$tdir $*
 
        # remount client normally
@@ -2753,6 +2755,13 @@ cleanup_for_enc_tests() {
                mount_client $MOUNT2 ${MOUNT_OPTS} ||
                        error "remount failed"
        fi
+
+       # remove fscrypt key from keyring
+       dummy_key=$(keyctl show | awk '$7 ~ "^fscrypt:" {print $1}')
+       if [ -n "$dummy_key" ]; then
+               keyctl revoke $dummy_key
+               keyctl reap
+       fi
 }
 
 cleanup_nodemap_after_enc_tests() {