6 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
7 . $LUSTRE/tests/test-framework.sh
8 # only call init_test_env if this script is called directly
9 if [[ -z "$TESTSUITE" || "$TESTSUITE" = "$(basename $0 .sh)" ]]; then
12 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
15 racer=$LUSTRE/tests/racer/racer.sh
16 . $LUSTRE/tests/setup-nfs.sh
18 # lustre client used as nfs server (default is mds node)
19 LUSTRE_CLIENT_NFSSRV=${LUSTRE_CLIENT_NFSSRV:-$(facet_active_host $SINGLEMDS)}
20 NFS_SRVMNTPT=${NFS_SRVMNTPT:-$MOUNT}
21 NFS_CLIENTS=${NFS_CLIENTS:-$CLIENTS}
22 NFS_CLIENTS=$(exclude_items_from_list $NFS_CLIENTS $LUSTRE_CLIENT_NFSSRV)
23 NFS_CLIMNTPT=${NFS_CLIMNTPT:-$MOUNT}
25 [ -z "$NFS_CLIENTS" ] &&
26 skip_env "need at least two nodes: nfs server and nfs client" && exit 0
28 [ "$NFSVERSION" = "4" ] && cl_mnt_opt="${MOUNT_OPTS:+$MOUNT_OPTS,}32bitapi" ||
31 check_and_setup_lustre
33 TESTDIR=$NFS_CLIMNTPT/d0.$(basename $0 .sh)
35 $LFS setstripe -c -1 $TESTDIR
37 # first unmount all the lustre clients
43 check_and_cleanup_lustre
48 cleanup_nfs "$NFS_CLIMNTPT" "$LUSTRE_CLIENT_NFSSRV" "$NFS_CLIENTS" ||
49 error_noexit false "failed to cleanup nfs"
50 zconf_umount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT force ||
51 error_noexit false "failed to umount lustre on"\
52 "$LUSTRE_CLIENT_NFSSRV"
53 # restore lustre mount
54 restore_mount $MOUNT ||
55 error_noexit false "failed to mount lustre"
58 trap cleanup_exit EXIT SIGHUP SIGINT
60 zconf_mount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT "$cl_mnt_opt" ||
61 error "mount lustre on $LUSTRE_CLIENT_NFSSRV failed"
64 setup_nfs "$NFSVERSION" "$NFS_SRVMNTPT" "$LUSTRE_CLIENT_NFSSRV" \
65 "$NFS_CLIENTS" "$NFS_CLIMNTPT" ||
66 error false "setup nfs failed!"
72 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
73 clients=${NFS_CLIENTS:-$HOSTNAME}
74 generate_machine_file $clients $MACHINEFILE ||
75 error "Failed to generate machine file"
76 num_clients=$(get_node_count ${clients//,/ })
79 # Run short iteration in nfs mode
80 cbench_IDIRS=${cbench_IDIRS:-2}
81 cbench_RUNS=${cbench_RUNS:-2}
84 # Run quick in nfs mode
85 mbench_NFILES=${mbench_NFILES:-10000}
88 [ "$SLOW" = "no" ] && cnt_NRUN=2
91 ior_DURATION=${ior_DURATION:-30}
93 # source the common file after all parameters are set to take affect
94 . $LUSTRE/tests/functions.sh
98 get_mpiuser_id $MPI_USER
99 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
100 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
102 test_compilebench() {
103 run_compilebench $TESTDIR
105 run_test compilebench "compilebench"
108 run_metabench $TESTDIR $NFS_CLIMNTPT
110 run_test metabench "metabench"
112 test_connectathon() {
113 run_connectathon $TESTDIR
115 run_test connectathon "connectathon"
118 run_ior "ssf" $TESTDIR $NFS_SRVMNTPT
120 run_test iorssf "iorssf"
123 run_ior "fpp" $TESTDIR $NFS_SRVMNTPT
125 run_test iorfpp "iorfpp"
127 test_racer_on_nfs() {
130 run_test racer_on_nfs "racer on NFS client"