Whamcloud - gitweb
LU-471 fix mkfs.lustre to avoid creating duplicate options
[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 init_logging
9
10 # QE uses the following parameters:
11 # size=128 crghi=16 thrhi=32
12 crghi=${crghi:-2}
13 thrhi=${thrhi:-16}
14 size=${size:-1024}
15
16 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
17
18 [ "$SLOW" = no ] && { crghi=2; thrhi=2; }
19
20 # Skip these tests
21 ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT"
22
23 build_test_filter
24
25 init_facets_vars
26
27 cleanupall
28
29 run_sgpdd_host () {
30     local host=$1
31     local devs=$2
32
33     local params="size=$size crghi=$crghi thrhi=$thrhi"
34     do_rpc_nodes $host run_sgpdd $devs "$params"
35 }
36
37 run_sgpdd_facets () {
38     local facets=$1
39     local facet
40
41     local facetshosts
42     for facet in ${facets//,/ }; do
43         local host=$(facet_host $facet)
44         local dev=${facet}_dev
45
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     check_progs_installed $(facets_hosts mds) $SGPDDSURVEY sg_map || \
61         { skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found" && return 0; }
62
63     run_sgpdd_facets mds
64 }
65 run_test 1 "sgpdd-survey, mds, scsidevs"
66
67 test_2 () {
68     local osts=$(get_facets OST)
69
70     check_progs_installed $(facets_hosts $osts) $SGPDDSURVEY sg_map || \
71         { skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found" && return 0; }
72
73     run_sgpdd_facets $osts
74 }
75 run_test 2 "sgpdd-survey, osts, scsidevs"
76
77 complete $(basename $0) $SECONDS
78 exit_status