Whamcloud - gitweb
LU-864 test: Hostname name doesn't equal NID and use facet_mntpt
[fs/lustre-release.git] / lustre / tests / obdfilter-survey.sh
index 66ec822..ea1af2e 100644 (file)
@@ -5,6 +5,7 @@ set -e
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
+init_logging
 
 nobjhi=${nobjhi:-1}
 thrhi=${thrhi:-16}
@@ -25,10 +26,6 @@ OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
 build_test_filter
 check_and_setup_lustre
 
-min_ost_size () {
-    $LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1
-}
-
 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
 minsize=$(min_ost_size)
 if [ $(( size * 1024 )) -ge $minsize  ]; then
@@ -39,14 +36,16 @@ fi
 get_targets () {
         local targets
         local devs
+        local nid
         local oss
 
         for oss in $(osts_nodes); do
                 devs=$(do_node $oss "lctl dl |grep obdfilter |sort" | awk '{print $4}')
+                nid=$(host_nids_address $oss $NETTYPE)
                 for d in $devs; do
                         # if oss is local -- obdfilter-survey needs dev wo/ host
                         target=$d
-                        [[ $oss = `hostname` ]] || target=$oss:$target
+                        [[ $oss = `hostname` ]] || target=$nid:$target
                         targets="$targets $target"
                 done
         done
@@ -61,7 +60,7 @@ obdflter_survey_targets () {
        case $case in
                disk)    targets=$(get_targets);;
                netdisk) targets=$(get_targets);;
-               network) targets="$(osts_nodes)";;
+               network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
                *) error "unknown obdflter-survey case!" ;;
        esac
        echo $targets
@@ -187,7 +186,7 @@ test_3a () {
 }
 run_test 3a "Network survey"
 
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
 cleanup_echo_devs
 check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status