}
cleanup () {
- cleanup_nfs "$NFS_CLIMNTPT" "$LUSTRE_CLIENT_NFSSRV" "$NFS_CLIENTS" ||
+ cleanup_nfs "$LUSTRE_CLIENT_NFSSRV" "$NFS_SRVMNTPT" \
+ "$NFS_CLIENTS" "$NFS_CLIMNTPT" || \
error_noexit false "failed to cleanup nfs"
zconf_umount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT force ||
error_noexit false "failed to umount lustre on"\
error "mount lustre on $LUSTRE_CLIENT_NFSSRV failed"
# setup the nfs
-setup_nfs "$NFSVERSION" "$NFS_SRVMNTPT" "$LUSTRE_CLIENT_NFSSRV" \
- "$NFS_CLIENTS" "$NFS_CLIMNTPT" ||
+setup_nfs "$LUSTRE_CLIENT_NFSSRV" "$NFS_SRVMNTPT" "$NFS_CLIENTS" \
+ "$NFS_CLIMNTPT" "$NFSVERSION" || \
error false "setup nfs failed!"
NFSCLIENT=true
$GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
test_compilebench() {
+ if [[ "$TESTSUITE" =~ "parallel-scale-nfs" ]]; then
+ skip "LU-12957 and LU-13068: compilebench for $TESTSUITE"
+ fi
+
run_compilebench $TESTDIR
}
run_test compilebench "compilebench"
#!/bin/bash
-#set -x
-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_climntpt=${5:-$MNTPNT}
-
- local export_opts_v=$EXPORT_OPTS
-
- echo "Exporting Lustre filesystem..."
-
- if [ "$NFS_VER" = "4" ]; then
- export_opts_v="$EXPORT_OPTS,fsid=0"
- do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
- fi
-
- do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
- { mkdir -p /var/lib/nfs/rpc_pipefs && \
- mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
- sleep 5
-
- # get rid of old $MNTPNT entries in /etc/exports
- do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports &&
- echo $MNTPNT *\($export_opts_v\) >> /etc/exports" ||
- return 1
-
- # restart nfs server according to distro
- do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
- service nfsserver restart; } ||
- service nfs restart ||
- service nfs-server restart" || return 1
+DEFAULT_NFS_OPTIONS=${DEFAULT_NFS_OPTIONS:-"rw,async,no_root_squash"}
+DEFAULT_EXPORTS_FILE=${DEFAULT_EXPORTS_FILE:-"/etc/exports.d/lustre.exports"}
- do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
- grep -q rpcidmapd && service rpcidmapd restart ||
- true"
-
- echo -e "\nMounting NFS clients (version $NFS_VER)..."
+setup_nfs() {
+ local LUSTRE_CLIENT=$1
+ local LUSTRE_MOUNT_POINT=$2
+ local NFS_CLIENTS=$3
+ local NFS_MOUNT_POINT=$4
+ local NFS_VERSION=$5
+ local EXPORTS_FILE=$DEFAULT_EXPORTS_FILE
+ local NFS_OPTIONS=$DEFAULT_NFS_OPTIONS
+
+ echo "Exporting Lustre filesystem via NFS version $NFS_VERSION"
+ do_nodes "$LUSTRE_CLIENT" \
+ "echo '$LUSTRE_MOUNT_POINT *($NFS_OPTIONS)' | \
+ tee $EXPORTS_FILE" || return 1
+ do_nodes "$LUSTRE_CLIENT" "systemctl restart nfs-server" || return 1
+ do_nodes "$LUSTRE_CLIENT" "systemctl restart nfs-idmapd" || return 1
+
+ echo "Mounting NFS clients version $NFS_VERSION"
+ do_nodes "$NFS_CLIENTS" "systemctl restart nfs-idmapd" || return 1
+ do_nodes "$NFS_CLIENTS" "mkdir -p $NFS_MOUNT_POINT" || return 1
+ do_nodes "$NFS_CLIENTS" \
+ "mount -v -t nfs -o nfsvers=$NFS_VERSION,async \
+ $LUSTRE_CLIENT:$LUSTRE_MOUNT_POINT \
+ $NFS_MOUNT_POINT" || return 1
- 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}
-
- 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 |
- grep -q rpcidmapd && service rpcidmapd stop ||
- true"
-
- do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
- service nfsserver stop; } ||
- service nfs stop ||
- service nfs-server stop" || return 1
-
- do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports" || return 1
-
- do_nodes $LUSTRE_CLIENT "exportfs -v"
+ local LUSTRE_CLIENT=$1
+ local LUSTRE_MOUNT_POINT=$2
+ local NFS_CLIENTS=$3
+ local NFS_MOUNT_POINT=$4
+ local EXPORTS_FILE=$DEFAULT_EXPORTS_FILE
+
+ echo "Unmounting NFS clients"
+ do_nodes "$NFS_CLIENTS" "umount -v -f $NFS_MOUNT_POINT" || return 1
+ do_nodes "$NFS_CLIENTS" "systemctl stop nfs-idmapd" || return 1
+
+ echo "Unexporting Lustre filesystem"
+ do_nodes "$LUSTRE_CLIENT" "systemctl stop nfs-server" || return 1
+ do_nodes "$LUSTRE_CLIENT" "systemctl stop nfs-idmapd" || return 1
+ do_nodes "$LUSTRE_CLIENT" "rm -v $EXPORTS_FILE" || return 1
}