Whamcloud - gitweb
LU-13474 gss: do not return -ERESTART when gss rpc times out
[fs/lustre-release.git] / lustre / tests / sgpdd-survey.sh
1 #!/bin/bash
2
3 set -e
4
5 LUSTRE=${LUSTRE:-$(dirname $0)/..}
6 . $LUSTRE/tests/test-framework.sh
7 init_test_env $@
8 init_logging
9
10 ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT"
11 build_test_filter
12
13 # QE uses the following parameters:
14 # size=128 crghi=16 thrhi=32
15 crghi=${crghi:-2}
16 thrhi=${thrhi:-16}
17 size=${size:-1024}
18
19 [ "$SLOW" = no ] && { crghi=2; thrhi=2; }
20
21 if [ "$SGPDD_YES" != "yes" -o "$REFORMAT" != "yes" ]; then
22         skip_env "$0 reformats all devices, set SGPDD_YES=yes REFORMAT=yes"
23         exit 0
24 fi
25
26 init_facets_vars
27
28 cleanupall
29
30 run_sgpdd_host () {
31     local host=$1
32     local devs=$2
33
34     local params="size=$size crghi=$crghi thrhi=$thrhi"
35     do_rpc_nodes $host run_sgpdd $devs "$params"
36 }
37
38 run_sgpdd_facets () {
39     local facets=$1
40     local facet
41
42     local facetshosts
43     for facet in ${facets//,/ }; do
44         local host=$(facet_host $facet)
45         local dev=${facet}_dev
46         local var=$(node_var_name ${host}_devs)
47         eval ${var}=$(expand_list ${!var} ${!dev})
48         facetshosts=$(expand_list $facetshosts $host)
49     done
50
51     for host in ${facetshosts//,/ }; do
52         var=$(node_var_name ${host}_devs)
53         echo "=== $facets === $host === ${!var} ==="
54         local scsidevs=${!var}
55         run_sgpdd_host $host ${scsidevs}
56     done
57 }
58
59 test_1 () {
60         local mdss=$(get_facets MDS)
61
62         check_progs_installed $(facets_hosts $mdss) $SGPDDSURVEY sg_map ||
63                 skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found"
64
65         run_sgpdd_facets $mdss
66 }
67 run_test 1 "sgpdd-survey, mds, scsidevs"
68
69 test_2 () {
70         local osts=$(get_facets OST)
71
72         check_progs_installed $(facets_hosts $osts) $SGPDDSURVEY sg_map ||
73                 skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found"
74
75         run_sgpdd_facets $osts
76 }
77 run_test 2 "sgpdd-survey, osts, scsidevs"
78
79 complete $SECONDS
80 exit_status