Whamcloud - gitweb
TT-59 remove . and - from the node name
[fs/lustre-release.git] / lustre / tests / sgpdd-survey.sh
index de84b44..ac5da4d 100644 (file)
@@ -24,8 +24,6 @@ fi
 # Skip these tests
 ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT"
 
-SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)}
-
 build_test_filter
 
 init_facets_vars
@@ -48,13 +46,13 @@ run_sgpdd_facets () {
     for facet in ${facets//,/ }; do
         local host=$(facet_host $facet)
         local dev=${facet}_dev
-        local var=${host}_devs
+        local var=$(node_var_name ${host}_devs)
         eval ${var}=$(expand_list ${!var} ${!dev})
         facetshosts=$(expand_list $facetshosts $host)
     done
 
     for host in ${facetshosts//,/ }; do
-        var=${host}_devs
+        var=$(node_var_name ${host}_devs)
         echo "=== $facets === $host === ${!var} ==="
         local scsidevs=${!var}
         run_sgpdd_host $host ${scsidevs}
@@ -64,6 +62,9 @@ run_sgpdd_facets () {
 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"
@@ -71,9 +72,12 @@ 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
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
+complete $(basename $0) $SECONDS
+exit_status