Whamcloud - gitweb
013670ddda36245c4736ac686aaccb988e613d57
[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 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
46 clients=${CLIENTS:-$HOSTNAME}
47 generate_machine_file $clients $MACHINEFILE || \
48     error "Failed to generate machine file"
49 num_clients=$(get_node_count ${clients//,/ })
50
51 # compilbench
52 # Run short iteration in nfs mode
53 cbench_IDIRS=${cbench_IDIRS:-2}
54 cbench_RUNS=${cbench_RUNS:-2}
55
56 # metabench
57 # Run quick in nfs mode
58 mbench_NFILES=${mbench_NFILES:-10000}
59
60 # connectathon
61 [ "$SLOW" = "no" ] && cnt_NRUN=2
62
63 # IOR
64 ior_DURATION=${ior_DURATION:-30}
65
66 # source the common file after all parameters are set to take affect
67 . $LUSTRE/tests/functions.sh
68
69 build_test_filter
70
71 get_mpiuser_id $MPI_USER
72 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
73 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
74
75 test_compilebench() {
76     run_compilebench
77 }
78 run_test compilebench "compilebench"
79
80 test_metabench() {
81     run_metabench
82 }
83 run_test metabench "metabench"
84
85 test_connectathon() {
86     run_connectathon
87 }
88 run_test connectathon "connectathon"
89
90 test_iorssf() {
91     run_ior "ssf"
92 }
93 run_test iorssf "iorssf"
94
95 test_iorfpp() {
96     run_ior "fpp"
97 }
98 run_test iorfpp "iorfpp"
99
100 # cleanup nfs
101 cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
102     error_noexit false "cleanup_nfs failed"
103 if ! zconf_umount_clients $lustre_client $MOUNT force; then
104     error_noexit false "failed to umount lustre on $lustre_client"
105 elif ! zconf_mount_clients $CLIENTS $MOUNT; then
106     error_noexit false "failed to mount lustre after nfs test"
107 fi
108
109 complete $(basename $0) $SECONDS
110 check_and_cleanup_lustre
111 exit_status