Whamcloud - gitweb
LU-13116 tests: properly clean keyring in sanity-sec test_30 51/37151/20 flr
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 7 Jan 2020 17:22:17 +0000 (02:22 +0900)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Mar 2020 03:41:24 +0000 (03:41 +0000)
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 <sbuisson@ddn.com>
Change-Id: I32d6b70948b2fedfb60f2750f56ef772a404d08c
Reviewed-on: https://review.whamcloud.com/37151
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-sec.sh

index 5c81f80..1999151 100755 (executable)
@@ -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"
        # 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)"
        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
                        error "mount with invalid key"
                fi
        fi
-       SK_PATH=$OLD_SK_PATH
        zconf_umount_clients ${clients_arr[0]} $MOUNT ||
                error "unable to umount clients"
        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"
 }
        zconf_mount_clients ${clients_arr[0]} $MOUNT ||
                error "unable to mount clients"
 }