Whamcloud - gitweb
LU-11524 tests: fix sanity-sec test_31 for all situations 80/33380/5
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 16 Oct 2018 12:52:46 +0000 (21:52 +0900)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 19 Oct 2018 23:12:19 +0000 (23:12 +0000)
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 <sbuisson@ddn.com>
Change-Id: I2db17c139768d0842ff65ac8313a8e7d1484c4ef
Reviewed-on: https://review.whamcloud.com/33380
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
lustre/tests/sanity-sec.sh
lustre/tests/test-framework.sh

index 0947ba8..9018c3f 100755 (executable)
@@ -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"
index a185b0f..7b0fe56 100755 (executable)
@@ -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")