Whamcloud - gitweb
LU-814 test: automated NFS over lustre testing
[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 mds)
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 if [ "$SLOW" = "no" ]; then
53     cbench_IDIRS=2
54     cbench_RUNS=2
55 fi
56
57 # metabench
58 [ "$SLOW" = "no" ] && mbench_NFILES=10000
59
60 # connectathon
61 [ "$SLOW" = "no" ] && cnt_NRUN=2
62
63 # IOR
64 [ "$SLOW" = "no" ] && 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 test_compilebench() {
72     run_compilebench
73 }
74 run_test compilebench "compilebench"
75
76 test_metabench() {
77     run_metabench
78 }
79 run_test metabench "metabench"
80
81 test_connectathon() {
82     run_connectathon
83 }
84 run_test connectathon "connectathon"
85
86 test_iorssf() {
87     run_ior "ssf"
88 }
89 run_test iorssf "iorssf"
90
91 test_iorfpp() {
92     run_ior "fpp"
93 }
94 run_test iorfpp "iorfpp"
95
96 test_nfsread_orphan_file() {
97     run_nfsread_orphan_file
98 }
99 run_test nfsread_orphan_file
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 $(basename $0) $SECONDS
111 check_and_cleanup_lustre
112 exit_status