Whamcloud - gitweb
b=21115
authorgrev <grev>
Fri, 6 Nov 2009 21:02:09 +0000 (21:02 +0000)
committergrev <grev>
Fri, 6 Nov 2009 21:02:09 +0000 (21:02 +0000)
i=Robert.Read
t-f: mount the same config on all clients

lustre/tests/acceptance-small.sh
lustre/tests/test-framework.sh

index 51e5b61..3b1e3d7 100755 (executable)
@@ -54,7 +54,7 @@ setup_if_needed() {
 
     local MOUNTED=$(mounted_lustre_filesystems)
     if $(echo $MOUNTED | grep -w -q $MOUNT); then
-        check_config $MOUNT
+        check_config_clients $MOUNT
         init_facets_vars
         init_param_vars
         return
@@ -280,15 +280,7 @@ for NAME in $CONFIGS; do
 
        if [ "$SANITYN" != "no" ]; then
                title sanityN
-               $DEBUG_OFF
-
-               mkdir -p $MOUNT2
-               mount_client $MOUNT2
-               #echo "can't mount2 for '$NAME', skipping sanityN.sh"
-               START=: CLEAN=: bash sanityN.sh
-               [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
-
-               $DEBUG_ON
+               bash sanityN.sh
                $CLEANUP
                $SETUP
                SANITYN="done"
index 682cf82..b4a8da4 100644 (file)
@@ -1533,9 +1533,7 @@ nfs_client_mode () {
     return 1
 }
 
-check_config () {
-    nfs_client_mode && return
-
+check_config_client () {
     local mntpt=$1
 
     local mounted=$(mount | grep " $mntpt ")
@@ -1575,6 +1573,16 @@ check_config () {
 #                   Please use correct config or set mds_HOST correctly!"
 #    fi
 
+}
+
+check_config_clients () {
+    local clients=${CLIENTS:-$HOSTNAME}
+    local mntpt=$1
+
+    nfs_client_mode && return
+
+    do_rpc_nodes $clients check_config_client $mntpt
+
     sanity_mount_check ||
         error "environments are insane!"
 }
@@ -1608,17 +1616,30 @@ check_and_setup_lustre() {
 
         # MOUNT2 is mounted,  MOUNT_2 is not set
         if ! [ "$MOUNT_2" ]; then
-            zconf_umount `hostname` $MOUNT2
+            cleanup_mount $MOUNT2
             export I_UMOUNTED2=yes
 
         # MOUNT2 is mounted, MOUNT_2 is set
         else
-            check_config $MOUNT2
+            # FIXME: what to do if check_config failed?
+            # i.e. if:
+            # 1) remote client has mounted other Lustre fs ?
+            # 2) it has insane env ?
+            # let's try umount MOUNT2 on all clients and mount it again:
+            if ! check_config_clients $MOUNT2; then
+                    cleanup_mount $MOUNT2
+                    restore_mount $MOUNT2
+                    export I_MOUNTED2=yes
+            fi 
         fi 
     fi
 
     if $do_check; then
-        check_config $MOUNT
+        # FIXME: what to do if check_config failed?
+        # i.e. if:
+        # 1) remote client has mounted other Lustre fs?
+        # 2) lustre is mounted on remote_clients atall ?
+        check_config_clients $MOUNT
         init_facets_vars
         init_param_vars
 
@@ -1632,6 +1653,20 @@ check_and_setup_lustre() {
     fi
 }
 
+restore_mount () {
+   local clients=${CLIENTS:-$HOSTNAME}
+   local mntpt=$1
+
+   zconf_mount_clients $clients $mntpt
+}
+
+cleanup_mount () {
+    local clients=${CLIENTS:-$HOSTNAME}
+    local mntpt=$1
+
+    zconf_umount_clients $clients $mntpt    
+}
+
 cleanup_and_setup_lustre() {
     if [ "$ONLY" == "cleanup" -o "`mount | grep $MOUNT`" ]; then
         lctl set_param debug=0 || true
@@ -1649,9 +1684,13 @@ check_and_cleanup_lustre() {
         [ "$ENABLE_QUOTA" ] && restore_quota_type || true
     fi
     if [ "$I_UMOUNTED2" = "yes" ]; then
-        mount_client $MOUNT2 || error "restore $MOUNT2 failed"
+        restore_mount $MOUNT2 || error "restore $MOUNT2 failed"
     fi
 
+    if [ "$I_MOUNTED2" = "yes" ]; then
+        cleanup_mount $MOUNT2
+    fi
+        zconf_umount_clients $clients $MOUNT2
     if [ "$I_MOUNTED" = "yes" ]; then
         cleanupall -f || error "cleanup failed"
     fi