Whamcloud - gitweb
LU-9968 tests: correct stripe index sanity 300g
[fs/lustre-release.git] / lustre / tests / setup-nfs.sh
index ea2eb19..284381b 100755 (executable)
@@ -3,10 +3,12 @@
 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
 
 setup_nfs() {
-    local NFS_VER=${1}
-    local MNTPNT=${2}
-    local LUSTRE_CLIENT=${3}
-    local NFS_CLIENTS=${4}
+       local NFS_VER=${1}
+       local MNTPNT=${2}
+       local LUSTRE_CLIENT=${3}
+       local NFS_CLIENTS=${4}
+       local nfs_climntpt=${5:-$MNTPNT}
+
     local export_opts_v=$EXPORT_OPTS
 
     echo "Exporting Lustre filesystem..."
@@ -34,25 +36,26 @@ setup_nfs() {
 
     echo -e "\nMounting NFS clients (version $NFS_VER)..."
 
-    do_nodes $NFS_CLIENTS "mkdir -p $MNTPNT" || return 1
-    if [ "$NFS_VER" = "4" ]; then
-        do_nodes $NFS_CLIENTS \
-            "mount -t nfs$NFS_VER -o async $LUSTRE_CLIENT:/ $MNTPNT" || return 1
-    else
-        do_nodes $NFS_CLIENTS \
-            "mount -t nfs -o nfsvers=$NFS_VER,async \
-                $LUSTRE_CLIENT:$MNTPNT $MNTPNT" || return 1
-    fi
-    return 0
+       do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1
+       if [ "$NFS_VER" = "4" ]; then
+               do_nodes $NFS_CLIENTS \
+                       "mount -t nfs$NFS_VER -o async \
+                       $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1
+       else
+               do_nodes $NFS_CLIENTS \
+                       "mount -t nfs -o nfsvers=$NFS_VER,async \
+                       $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1
+       fi
+       return 0
 }
 
 cleanup_nfs() {
-    local MNTPNT=${1}
-    local LUSTRE_CLIENT=${2}
-    local NFS_CLIENTS=${3}
+       local MNTPNT=${1}
+       local LUSTRE_CLIENT=${2}
+       local NFS_CLIENTS=${3}
 
-    echo -e "\nUnmounting NFS clients..."
-    do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || return 1
+       echo -e "\nUnmounting NFS clients..."
+       do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true
 
        echo -e "\nUnexporting Lustre filesystem..."
        do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |