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