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 check_and_setup_lustre
20 # first unmount all the lustre clients
22 # lustre client used as nfs server (default is mds node)
23 LUSTRE_CLIENT_NFSSRV=${LUSTRE_CLIENT_NFSSRV:-$(facet_active_host $SINGLEMDS)}
24 NFS_SRVMNTPT=${NFS_SRVMNTPT:-$MOUNT}
25 NFS_CLIENTS=${NFS_CLIENTS:-$CLIENTS}
26 NFS_CLIENTS=$(exclude_items_from_list $NFS_CLIENTS $LUSTRE_CLIENT_NFSSRV)
27 NFS_CLIMNTPT=${NFS_CLIMNTPT:-$MOUNT}
29 [ -z "$NFS_CLIENTS" ] &&
30 skip_env "need at least two nodes: nfs server and nfs client" && exit 0
32 [ "$NFSVERSION" = "4" ] && cl_mnt_opt="${MOUNT_OPTS:+$MOUNT_OPTS,}32bitapi" ||
38 check_and_cleanup_lustre
43 cleanup_nfs "$NFS_CLIMNTPT" "$LUSTRE_CLIENT_NFSSRV" "$NFS_CLIENTS" ||
44 error_noexit false "failed to cleanup nfs"
45 zconf_umount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT force ||
46 error_noexit false "failed to umount lustre on"\
47 "$LUSTRE_CLIENT_NFSSRV"
48 # restore lustre mount
49 restore_mount $MOUNT ||
50 error_noexit false "failed to mount lustre"
53 trap cleanup_exit EXIT SIGHUP SIGINT
55 zconf_mount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT "$cl_mnt_opt" ||
56 error "mount lustre on $LUSTRE_CLIENT_NFSSRV failed"
59 setup_nfs "$NFSVERSION" "$NFS_SRVMNTPT" "$LUSTRE_CLIENT_NFSSRV" \
60 "$NFS_CLIENTS" "$NFS_CLIMNTPT" ||
61 error false "setup nfs failed!"
67 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
68 clients=${NFS_CLIENTS:-$HOSTNAME}
69 generate_machine_file $clients $MACHINEFILE || \
70 error "Failed to generate machine file"
71 num_clients=$(get_node_count ${clients//,/ })
74 # Run short iteration in nfs mode
75 cbench_IDIRS=${cbench_IDIRS:-2}
76 cbench_RUNS=${cbench_RUNS:-2}
79 # Run quick in nfs mode
80 mbench_NFILES=${mbench_NFILES:-10000}
83 [ "$SLOW" = "no" ] && cnt_NRUN=2
86 ior_DURATION=${ior_DURATION:-30}
88 # source the common file after all parameters are set to take affect
89 . $LUSTRE/tests/functions.sh
93 get_mpiuser_id $MPI_USER
94 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
95 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
98 run_compilebench $NFS_CLIMNTPT
100 run_test compilebench "compilebench"
103 run_metabench $NFS_CLIMNTPT
105 run_test metabench "metabench"
107 test_connectathon() {
108 run_connectathon $NFS_CLIMNTPT
110 run_test connectathon "connectathon"
113 run_ior "ssf" $NFS_CLIMNTPT $NFS_SRVMNTPT
115 run_test iorssf "iorssf"
118 run_ior "fpp" $NFS_CLIMNTPT $NFS_SRVMNTPT
120 run_test iorfpp "iorfpp"
122 test_racer_on_nfs() {
125 run_test racer_on_nfs "racer on NFS client"