Whamcloud - gitweb
LU-8526 tests: ensure all OSTs active for allocations
[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 racer=$LUSTRE/tests/racer/racer.sh
16 . $LUSTRE/tests/setup-nfs.sh
17
18 check_and_setup_lustre
19
20 # first unmount all the lustre client
21 cleanup_mount $MOUNT
22 # mount lustre on mds
23 lustre_client=$(facet_active_host $SINGLEMDS)
24 [ "$NFSVERSION" = "4" ] && cl_mnt_opt="${MOUNT_OPTS:+$MOUNT_OPTS,}32bitapi" ||
25     cl_mnt_opt=""
26 zconf_mount_clients $lustre_client $MOUNT "$cl_mnt_opt" || \
27     error "mount lustre on $lustre_client failed"
28
29 # setup the nfs
30 if ! setup_nfs "$NFSVERSION" "$MOUNT" "$lustre_client" "$CLIENTS"; then
31     error_noexit false "setup nfs failed!"
32     cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
33         error_noexit false "failed to cleanup nfs"
34     if ! zconf_umount_clients $lustre_client $MOUNT force; then
35         error_noexit false "failed to umount lustre on $lustre_client"
36     elif ! zconf_mount_clients $CLIENTS $MOUNT; then
37         error_noexit false "failed to mount lustre"
38     fi
39     check_and_cleanup_lustre
40     exit
41 fi
42
43 NFSCLIENT=true
44 FAIL_ON_ERROR=false
45
46 # common setup
47 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
48 clients=${CLIENTS:-$HOSTNAME}
49 generate_machine_file $clients $MACHINEFILE || \
50     error "Failed to generate machine file"
51 num_clients=$(get_node_count ${clients//,/ })
52
53 # compilbench
54 # Run short iteration in nfs mode
55 cbench_IDIRS=${cbench_IDIRS:-2}
56 cbench_RUNS=${cbench_RUNS:-2}
57
58 # metabench
59 # Run quick in nfs mode
60 mbench_NFILES=${mbench_NFILES:-10000}
61
62 # connectathon
63 [ "$SLOW" = "no" ] && cnt_NRUN=2
64
65 # IOR
66 ior_DURATION=${ior_DURATION:-30}
67
68 # source the common file after all parameters are set to take affect
69 . $LUSTRE/tests/functions.sh
70
71 build_test_filter
72
73 get_mpiuser_id $MPI_USER
74 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
75 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
76
77 test_compilebench() {
78     run_compilebench
79 }
80 run_test compilebench "compilebench"
81
82 test_metabench() {
83     run_metabench
84 }
85 run_test metabench "metabench"
86
87 test_connectathon() {
88     run_connectathon
89 }
90 run_test connectathon "connectathon"
91
92 test_iorssf() {
93     run_ior "ssf"
94 }
95 run_test iorssf "iorssf"
96
97 test_iorfpp() {
98     run_ior "fpp"
99 }
100 run_test iorfpp "iorfpp"
101
102 test_racer_on_nfs() {
103         $racer $CLIENTS
104 }
105 run_test racer_on_nfs "racer on NFS client"
106
107 # cleanup nfs
108 cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
109     error_noexit false "cleanup_nfs failed"
110 if ! zconf_umount_clients $lustre_client $MOUNT force; then
111     error_noexit false "failed to umount lustre on $lustre_client"
112 elif ! zconf_mount_clients $CLIENTS $MOUNT; then
113     error_noexit false "failed to mount lustre after nfs test"
114 fi
115
116 complete $SECONDS
117 check_and_cleanup_lustre
118 exit_status