From: Sebastien Buisson Date: Tue, 16 Oct 2018 12:52:46 +0000 (+0900) Subject: LU-11524 tests: fix sanity-sec test_31 for all situations X-Git-Tag: 2.12.0-RC1~171 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F33380%2F5;p=fs%2Flustre-release.git LU-11524 tests: fix sanity-sec test_31 for all situations In case setupall() is called with server_only, this info must be passed to init_param_vars(), and init_param_vars() must return immediately. Otherwise, it will try to do client-specific tunings (including quota settings) whereas no clients are mounted. Modify cleanup_31() in sanity-sec so that client-specific tunings are done via setupall(). Also make client umount more robust in test_31. Signed-off-by: Sebastien Buisson Change-Id: I2db17c139768d0842ff65ac8313a8e7d1484c4ef Reviewed-on: https://review.whamcloud.com/33380 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 0947ba8..9018c3f 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -2150,15 +2150,10 @@ cleanup_31() { KZPOOL=$KEEP_ZPOOL export KEEP_ZPOOL="true" stopall + export SK_MOUNTED=false writeconf_all - setupall server_only || echo 1 + setupall || echo 1 export KEEP_ZPOOL="$KZPOOL" - - # remount client normally - mount_client $MOUNT $MOUNT_OPTS || error "unable to remount client" - if [ "$MOUNT_2" ]; then - mount_client $MOUNT2 || error "unable to remount client2" - fi } test_31() { @@ -2173,10 +2168,12 @@ test_31() { stack_trap cleanup_31 EXIT - # unmount client - umount_client $MOUNT || error "unable to umount client" - if [ "$MOUNT_2" ]; then - umount_client $MOUNT2 || error "unable to umount client2" + # umount client + if [ "$MOUNT_2" ] && $(grep -q $MOUNT2' ' /proc/mounts); then + umount_client $MOUNT2 || error "umount $MOUNT2 failed" + fi + if $(grep -q $MOUNT' ' /proc/mounts); then + umount_client $MOUNT || error "umount $MOUNT failed" fi # check exports on servers are empty for client @@ -2200,6 +2197,7 @@ test_31() { KZPOOL=$KEEP_ZPOOL export KEEP_ZPOOL="true" stopall + export SK_MOUNTED=false writeconf_all setupall server_only || echo 1 export KEEP_ZPOOL="$KZPOOL" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a185b0f..7b0fe56 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1019,6 +1019,8 @@ init_gss() { -m $SK_PATH/$FSNAME-nmclient.key \ >/dev/null 2>&1" fi + fi + if $GSS_SK; then # mount options for servers and clients MGS_MOUNT_OPTS=$(add_sk_mntflag $MGS_MOUNT_OPTS) MDS_MOUNT_OPTS=$(add_sk_mntflag $MDS_MOUNT_OPTS) @@ -4821,6 +4823,10 @@ init_param_vars () { TIMEOUT=$(lctl get_param -n timeout) TIMEOUT=${TIMEOUT:-20} + if [ -n $arg1 ]; then + [ "$arg1" = "server_only" ] && return + fi + remote_mds_nodsh && log "Using TIMEOUT=$TIMEOUT" && return 0 TIMEOUT=$(do_facet $SINGLEMDS "lctl get_param -n timeout")