From e628b7cd06ce0092b3003d27a2f45e6a0b7574d9 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Wed, 8 Jan 2020 02:22:17 +0900 Subject: [PATCH] LU-13116 tests: properly clean keyring in sanity-sec test_30 sanity-sec test_30 makes use of a bogus key to test Lustre behaviour in case of invalid shared key. This bogus key must be cleaned and removed properly so that it does not interfere with subsequent tests. Test-Parameters: trivial envdefinitions=SHARED_KEY=true testlist=sanity-sec Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity-sec Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity-sec Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity-sec Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity-sec Signed-off-by: Sebastien Buisson Change-Id: I32d6b70948b2fedfb60f2750f56ef772a404d08c Reviewed-on: https://review.whamcloud.com/37151 Reviewed-by: James Nunez Reviewed-by: Andreas Dilger Tested-by: Maloo Tested-by: jenkins Reviewed-by: Oleg Drokin --- lustre/tests/sanity-sec.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 5c81f80..1999151 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -2184,7 +2184,7 @@ test_30() { # unload keys from ring do_node ${clients_arr[0]} "keyctl show | awk '/lustre/ { print \\\$1 }' | xargs -IX keyctl unlink X" - # invalidate the key with bogus filesystem name + # generate key with bogus filesystem name do_node ${clients_arr[0]} "lgss_sk -w $SK_PATH/$FSNAME-bogus.key \ -f $FSNAME.bogus -t client -d /dev/urandom" || error "lgss_sk failed (1)" @@ -2200,9 +2200,13 @@ test_30() { error "mount with invalid key" fi fi - SK_PATH=$OLD_SK_PATH zconf_umount_clients ${clients_arr[0]} $MOUNT || error "unable to umount clients" + # unload keys from ring + do_node ${clients_arr[0]} "keyctl show | + awk '/lustre/ { print \\\$1 }' | xargs -IX keyctl unlink X" + rm -f $SK_PATH + SK_PATH=$OLD_SK_PATH zconf_mount_clients ${clients_arr[0]} $MOUNT || error "unable to mount clients" } -- 1.8.3.1