Whamcloud - gitweb
LU-8141 tests: fix for acl test
[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="${MOUNT_OPTS:+$MOUNT_OPTS,}32bitapi" ||
24     cl_mnt_opt=""
25 zconf_mount_clients $lustre_client $MOUNT "$cl_mnt_opt" || \
26     error "mount lustre on $lustre_client failed"
27
28 # setup the nfs
29 if ! setup_nfs "$NFSVERSION" "$MOUNT" "$lustre_client" "$CLIENTS"; then
30     error_noexit false "setup nfs failed!"
31     cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
32         error_noexit false "failed to cleanup nfs"
33     if ! zconf_umount_clients $lustre_client $MOUNT force; then
34         error_noexit false "failed to umount lustre on $lustre_client"
35     elif ! zconf_mount_clients $CLIENTS $MOUNT; then
36         error_noexit false "failed to mount lustre"
37     fi
38     check_and_cleanup_lustre
39     exit
40 fi
41
42 NFSCLIENT=true
43 FAIL_ON_ERROR=false
44
45 # common setup
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 # Run short iteration in nfs mode
54 cbench_IDIRS=${cbench_IDIRS:-2}
55 cbench_RUNS=${cbench_RUNS:-2}
56
57 # metabench
58 # Run quick in nfs mode
59 mbench_NFILES=${mbench_NFILES:-10000}
60
61 # connectathon
62 [ "$SLOW" = "no" ] && cnt_NRUN=2
63
64 # IOR
65 ior_DURATION=${ior_DURATION:-30}
66
67 # source the common file after all parameters are set to take affect
68 . $LUSTRE/tests/functions.sh
69
70 build_test_filter
71
72 get_mpiuser_id $MPI_USER
73 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
74 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
75
76 test_compilebench() {
77     run_compilebench
78 }
79 run_test compilebench "compilebench"
80
81 test_metabench() {
82     run_metabench
83 }
84 run_test metabench "metabench"
85
86 test_connectathon() {
87     run_connectathon
88 }
89 run_test connectathon "connectathon"
90
91 test_iorssf() {
92     run_ior "ssf"
93 }
94 run_test iorssf "iorssf"
95
96 test_iorfpp() {
97     run_ior "fpp"
98 }
99 run_test iorfpp "iorfpp"
100
101 # cleanup nfs
102 cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \
103     error_noexit false "cleanup_nfs failed"
104 if ! zconf_umount_clients $lustre_client $MOUNT force; then
105     error_noexit false "failed to umount lustre on $lustre_client"
106 elif ! zconf_mount_clients $CLIENTS $MOUNT; then
107     error_noexit false "failed to mount lustre after nfs test"
108 fi
109
110 complete $SECONDS
111 check_and_cleanup_lustre
112 exit_status