5 LUSTRE=${LUSTRE:-$(dirname $0)/..}
6 . $LUSTRE/tests/test-framework.sh
7 # only call init_test_env if this script is called directly
8 if [[ -z "$TESTSUITE" || "$TESTSUITE" = "$(basename $0 .sh)" ]]; then
11 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
17 racer=$LUSTRE/tests/racer/racer.sh
18 . $LUSTRE/tests/setup-nfs.sh
20 # lustre client used as nfs server (default is mds node)
21 LUSTRE_CLIENT_NFSSRV=${LUSTRE_CLIENT_NFSSRV:-$(facet_active_host $SINGLEMDS)}
22 NFS_SRVMNTPT=${NFS_SRVMNTPT:-$MOUNT}
23 NFS_CLIENTS=${NFS_CLIENTS:-$CLIENTS}
24 NFS_CLIENTS=$(exclude_items_from_list $NFS_CLIENTS $LUSTRE_CLIENT_NFSSRV)
25 NFS_CLIMNTPT=${NFS_CLIMNTPT:-$MOUNT}
27 [ -z "$NFS_CLIENTS" ] &&
28 skip_env "need at least two nodes: nfs server and nfs client"
30 [ "$NFSVERSION" = "4" ] && cl_mnt_opt="${MOUNT_OPTS:+$MOUNT_OPTS,}32bitapi" ||
33 check_and_setup_lustre
35 TESTDIR=$NFS_CLIMNTPT/d0.$(basename $0 .sh)
37 $LFS setstripe -c -1 $TESTDIR
39 # first unmount all the lustre clients
45 check_and_cleanup_lustre
50 cleanup_nfs "$NFS_CLIMNTPT" "$LUSTRE_CLIENT_NFSSRV" "$NFS_CLIENTS" ||
51 error_noexit false "failed to cleanup nfs"
52 zconf_umount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT force ||
53 error_noexit false "failed to umount lustre on"\
54 "$LUSTRE_CLIENT_NFSSRV"
55 # restore lustre mount
56 restore_mount $MOUNT ||
57 error_noexit false "failed to mount lustre"
60 trap cleanup_exit EXIT SIGHUP SIGINT
62 zconf_mount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT "$cl_mnt_opt" ||
63 error "mount lustre on $LUSTRE_CLIENT_NFSSRV failed"
66 setup_nfs "$NFSVERSION" "$NFS_SRVMNTPT" "$LUSTRE_CLIENT_NFSSRV" \
67 "$NFS_CLIENTS" "$NFS_CLIMNTPT" ||
68 error false "setup nfs failed!"
74 clients=${NFS_CLIENTS:-$HOSTNAME}
75 generate_machine_file $clients $MACHINEFILE ||
76 error "Failed to generate machine file"
77 num_clients=$(get_node_count ${clients//,/ })
80 # Run short iteration in nfs mode
81 cbench_IDIRS=${cbench_IDIRS:-2}
82 cbench_RUNS=${cbench_RUNS:-2}
85 # Run quick in nfs mode
86 mbench_NFILES=${mbench_NFILES:-10000}
89 [ "$SLOW" = "no" ] && cnt_NRUN=2
92 ior_DURATION=${ior_DURATION:-30}
94 # source the common file after all parameters are set to take affect
95 . $LUSTRE/tests/functions.sh
99 get_mpiuser_id $MPI_USER
100 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
101 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
103 test_compilebench() {
104 run_compilebench $TESTDIR
106 run_test compilebench "compilebench"
109 run_metabench $TESTDIR $NFS_CLIMNTPT
111 run_test metabench "metabench"
113 test_connectathon() {
114 run_connectathon $TESTDIR
116 run_test connectathon "connectathon"
119 run_ior "ssf" $TESTDIR $NFS_SRVMNTPT
121 run_test iorssf "iorssf"
124 run_ior "fpp" $TESTDIR $NFS_SRVMNTPT
126 run_test iorfpp "iorfpp"
128 test_racer_on_nfs() {
129 local racer_params="MDSCOUNT=$MDSCOUNT OSTCOUNT=$OSTCOUNT LFS=$LFS"
131 do_nodes $CLIENTS "$racer_params $racer $TESTDIR"
133 run_test racer_on_nfs "racer on NFS client"