# Skip these tests
ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT"
-SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)}
-
build_test_filter
init_facets_vars
test_1 () {
local mdss=$(get_facets MDS)
+ check_progs_installed $(facets_hosts $mdss) $SGPDDSURVEY sg_map || \
+ { skip_env "SGPDDSURVEY=$SGPDDSURVEY or sg_map not found" && return 0; }
+
run_sgpdd_facets $mdss
}
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"
if ! echo $PATH | grep -q $LUSTRE/tests; then
export PATH=$LUSTRE/tests:$PATH
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)
# Ubuntu, at least, has a truncate command in /usr/bin
# so fully path our truncate command.
export TRUNCATE=${TRUNCATE:-$LUSTRE/tests/truncate}
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')
}