# Skip these tests
ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT"
-SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)}
-
build_test_filter
init_facets_vars
do_rpc_nodes $host run_sgpdd $devs "$params"
}
-test_1 () {
- local facet=mds
-
- local host=$(facet_host $facet)
- local dev=${facet}_dev
- echo "=== $facet === $host === ${!dev} ==="
- run_sgpdd_host $host ${!dev}
-}
-run_test 1 "sgpdd-survey, mds, scsidevs"
-
-test_2 () {
+run_sgpdd_facets () {
+ local facets=$1
local facet
- local osts=$(get_facets OST)
-
- local ostshosts
- for facet in ${osts//,/ }; do
+ local facetshosts
+ for facet in ${facets//,/ }; do
local host=$(facet_host $facet)
local dev=${facet}_dev
local var=${host}_devs
eval ${var}=$(expand_list ${!var} ${!dev})
- ostshosts=$(expand_list $ostshosts $host)
+ facetshosts=$(expand_list $facetshosts $host)
done
- for host in ${ostshosts//,/ }; do
- var=${host}_devs
- echo "=== osts === $host === ${!var} ==="
+ for host in ${facetshosts//,/ }; do
+ var=${host}_devs
+ echo "=== $facets === $host === ${!var} ==="
local scsidevs=${!var}
run_sgpdd_host $host ${scsidevs}
done
}
+
+test_1 () {
+ check_progs_installed $(facets_hosts mds) $SGPDDSURVEY sg_map || \
+ { skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found" && return 0; }
+
+ run_sgpdd_facets mds
+}
+run_test 1 "sgpdd-survey, mds, scsidevs"
+
+test_2 () {
+ local osts=$(get_facets OST)
+
+ check_progs_installed $(facets_hosts $osts) $SGPDDSURVEY sg_map || \
+ { skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found" && return 0; }
+
+ run_sgpdd_facets $osts
+}
run_test 2 "sgpdd-survey, osts, scsidevs"
equals_msg `basename $0`: test complete, cleaning up
if ! echo $PATH | grep -q $LUSTRE/test; then
export PATH=$PATH:$LUSTRE/tests
fi
+ if ! echo $PATH | grep -q $LUSTRE/../lustre-iokit/sgpdd-survey; then
+ export PATH=$PATH:$LUSTRE/../lustre-iokit/sgpdd-survey
+ fi
export LST=${LST:-"$LUSTRE/../lnet/utils/lst"}
[ ! -f "$LST" ] && export LST=$(which lst)
- export SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)}
+ export SGPDDSURVEY=${SGPDDSURVEY:-"$LUSTRE/../lustre-iokit/sgpdd-survey/sgpdd-survey")}
+ [ ! -f "$SGPDDSURVEY" ] && export SGPDDSURVEY=$(which sgpdd-survey)
export MDSRATE=${MDSRATE:-"$LUSTRE/tests/mpi/mdsrate"}
[ ! -f "$MDSRATE" ] && export MDSRATE=$(which mdsrate 2> /dev/null)
if ! echo $PATH | grep -q $LUSTRE/tests/racer; then
fi
}
-# recovery-scale functions
+facets_hosts () {
+ local facets=$1
+ local hosts
+
+ for facet in ${facets//,/ }; do
+ hosts=$(expand_list $hosts $(facet_host $facet) )
+ done
+
+ echo $hosts
+}
+
+_check_progs_installed () {
+ local progs=$@
+ local rc=0
+
+ for prog in $progs; do
+ if ! [ "$(which $prog)" -o "${!prog}" ]; then
+ echo $prog missing on $(hostname)
+ rc=1
+ fi
+ done
+ return $rc
+}
+
check_progs_installed () {
- local clients=$1
+ local nodes=$1
shift
- local progs=$@
- do_nodes $clients "PATH=:$PATH; status=true;
-for prog in $progs; do
- if ! [ \\\"\\\$(which \\\$prog)\\\" -o \\\"\\\${!prog}\\\" ]; then
- echo \\\$prog missing on \\\$(hostname);
- status=false;
- fi
-done;
-eval \\\$status"
+ do_rpc_nodes $nodes _check_progs_installed $@
}
+# recovery-scale functions
client_var_name() {
echo __$(echo $1 | tr '-' 'X')
}