Whamcloud - gitweb
LU-1347 style: removes obsolete EXPORT_SYMTAB macros
[fs/lustre-release.git] / lustre / tests / parallel-scale-nfs.sh
1 #!/bin/bash
2 #
3 #set -vx
4
5 NFSVERSION=${1:-"3"}
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
10     init_test_env $@
11 fi
12 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
13 init_logging
14
15 . $LUSTRE/tests/setup-nfs.sh
16
17 check_and_setup_lustre
18
19 # first unmount all the lustre client
20 cleanup_mount $MOUNT
21 # mount lustre on mds
22 lustre_client=$(facet_active_host $SINGLEMDS)
23 [ "$NFSVERSION" = "4" ] && cl_mnt_opt="$MOUNTOPT,32bitapi" || cl_mnt_opt=""
24 zconf_mount_clients $lustre_client $MOUNT "$cl_mnt_opt" || \
25     error "mount lustre on $lustre_client failed"
26
27 # setup the nfs
28 if ! setup_nfs "$NFSVERSION" "$MOUNT" "$lustre_client" "$CLIENTS"; then
29     error_noexit false "setup nfs failed!"
30     cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
31         error_noexit false "failed to cleanup nfs"
32     if ! zconf_umount_clients $lustre_client $MOUNT force; then
33         error_noexit false "failed to umount lustre on $lustre_client"
34     elif ! zconf_mount_clients $CLIENTS $MOUNT; then
35         error_noexit false "failed to mount lustre"
36     fi
37     check_and_cleanup_lustre
38     exit
39 fi
40
41 NFSCLIENT=true
42 FAIL_ON_ERROR=false
43
44 # common setup
45 #
46 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
47 clients=${CLIENTS:-$HOSTNAME}
48 generate_machine_file $clients $MACHINEFILE || \
49     error "Failed to generate machine file"
50 num_clients=$(get_node_count ${clients//,/ })
51
52 # compilbench
53 #
54 cbench_DIR=${cbench_DIR:-"/usr/bin"}
55 cbench_IDIRS=${cbench_IDIRS:-4}
56 # FIXME: wiki page requirements is 30, do we really need 30 ?
57 cbench_RUNS=${cbench_RUNS:-4}
58
59 if [ "$SLOW" = "no" ]; then
60     cbench_IDIRS=2
61     cbench_RUNS=2
62 fi
63
64 #
65 # metabench
66 #
67 METABENCH=${METABENCH:-$(which metabench 2> /dev/null || true)}
68 mbench_NFILES=${mbench_NFILES:-30400}
69 [ "$SLOW" = "no" ] && mbench_NFILES=10000
70 # threads per client
71 mbench_THREADS=${mbench_THREADS:-4}
72
73 #
74 # connectathon
75 #
76 cnt_DIR=${cnt_DIR:-""}
77 cnt_NRUN=${cnt_NRUN:-10}
78 [ "$SLOW" = "no" ] && cnt_NRUN=2
79
80 #
81 # IOR
82 #
83 IOR=${IOR:-$(which IOR 2> /dev/null || true)}
84 # threads per client
85 ior_THREADS=${ior_THREADS:-2}
86 ior_iteration=${ior_iteration:-1}
87 ior_blockSize=${ior_blockSize:-6} # Gb
88 ior_xferSize=${ior_xferSize:-2m}
89 ior_type=${ior_type:-POSIX}
90 ior_DURATION=${ior_DURATION:-60} # minutes
91 [ "$SLOW" = "no" ] && ior_DURATION=30
92
93 # source the common file after all parameters are set to take affect
94 . $LUSTRE/tests/functions.sh
95
96 build_test_filter
97
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
101
102 test_compilebench() {
103     run_compilebench
104 }
105 run_test compilebench "compilebench"
106
107 test_metabench() {
108     run_metabench
109 }
110 run_test metabench "metabench"
111
112 test_connectathon() {
113     run_connectathon
114 }
115 run_test connectathon "connectathon"
116
117 test_iorssf() {
118     run_ior "ssf"
119 }
120 run_test iorssf "iorssf"
121
122 test_iorfpp() {
123     run_ior "fpp"
124 }
125 run_test iorfpp "iorfpp"
126
127 # cleanup nfs
128 cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
129     error_noexit false "cleanup_nfs failed"
130 if ! zconf_umount_clients $lustre_client $MOUNT force; then
131     error_noexit false "failed to umount lustre on $lustre_client"
132 elif ! zconf_mount_clients $CLIENTS $MOUNT; then
133     error_noexit false "failed to mount lustre after nfs test"
134 fi
135
136 complete $(basename $0) $SECONDS
137 check_and_cleanup_lustre
138 exit_status