Whamcloud - gitweb
b=19242
authorgrev <grev>
Fri, 25 Sep 2009 15:04:17 +0000 (15:04 +0000)
committergrev <grev>
Fri, 25 Sep 2009 15:04:17 +0000 (15:04 +0000)
i=Robert.Read
add MOUNT2 check to check_and_setup_lustre fn

lustre/tests/test-framework.sh

index cab0776..61e909e 100644 (file)
@@ -1847,13 +1847,32 @@ check_and_setup_lustre() {
     nfs_client_mode && return
 
     local MOUNTED=$(mounted_lustre_filesystems)
+
+    local do_check=true
+    # MOUNT is not mounted
     if [ -z "$MOUNTED" ] || ! $(echo $MOUNTED | grep -w -q $MOUNT); then
         [ "$REFORMAT" ] && formatall
         setupall
         MOUNTED=$(mounted_lustre_filesystems | head -1)
         [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
         export I_MOUNTED=yes
-    else
+        do_check=false
+
+    # MOUNT and MOUNT2 are mounted
+    elif $(echo $MOUNTED | grep -w -q $MOUNT2); then
+
+        # MOUNT2 is mounted,  MOUNT_2 is not set
+        if ! [ "$MOUNT_2" ]; then
+            zconf_umount `hostname` $MOUNT2
+            export I_UMOUNTED2=yes
+
+        # MOUNT2 is mounted, MOUNT_2 is set
+        else
+            check_config $MOUNT2
+        fi 
+    fi
+
+    if $do_check; then
         check_config $MOUNT
         init_facets_vars
         init_param_vars
@@ -1884,6 +1903,10 @@ check_and_cleanup_lustre() {
         [ -n "$DIR" ] && rm -rf $DIR/[Rdfs][0-9]*
         [ "$ENABLE_QUOTA" ] && restore_quota_type || true
     fi
+    if [ "$I_UMOUNTED2" = "yes" ]; then
+        mount_client $MOUNT2 || error "restore MOUNT2 failed"
+    fi
+
     if [ "$I_MOUNTED" = "yes" ]; then
         cleanupall -f || error "cleanup failed"
     fi