Whamcloud - gitweb
LU-16804 tests: rename 'complete' to 'complete_test'
[fs/lustre-release.git] / lustre / tests / obdfilter-survey.sh
index f2ec471..d1b86dc 100644 (file)
@@ -1,29 +1,25 @@
 #!/bin/bash
-#set -x
 set -e
 
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
-init_test_env $@
+init_test_env "$@"
+init_logging
 
-nobjhi=${nobjhi:-1}
-thrhi=${thrhi:-16}
-size=${size:-1024}
+# bug number for skipped test:
+ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT "
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-# the summary file a bit smaller than OSTSIZE
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-init_logging
+build_test_filter
 
 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
+nobjhi=${nobjhi:-1}
+thrhi=${thrhi:-16}
+size=${size:-1024}
 thrlo=${thrlo:-$(( thrhi / 2))}
 
-# bug number for skipped test:
-ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
 OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
 
-build_test_filter
 check_and_setup_lustre
 
 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
@@ -51,7 +47,7 @@ get_targets () {
                # case 1 (local disk):
                #    $ nobjhi=2 thrhi=2 size=1024
                #      targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..."
-               #                 sh obdfilter-survey
+               #                 ./obdfilter-survey
                local_node && [ "$1" == "disk" ] || target=$nid:$target
                targets="$targets $target"
        done
@@ -64,7 +60,6 @@ obdflter_survey_targets () {
 
        case $case in
                disk)    targets=$(get_targets $case);;
-               netdisk) targets=$(get_targets $case);;
                network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
                *) error "unknown obdflter-survey case!" ;;
        esac
@@ -121,29 +116,12 @@ test_1c () {
 run_test 1c "Object Storage Targets survey, big batch"
 
 test_2a () {
-       obdflter_survey_run netdisk
+       skip "netdisk was removed"
 }
 run_test 2a "Stripe F/S over the Network"
 
 test_2b () {
-       local param_file=$TMP/$tfile-params
-
-       do_nodesv $(comma_list $(osts_nodes)) \
-               $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
-       save_lustre_params $(get_facets OST) \
-               "obdfilter.${FSNAME}-*.sync_journal" > $param_file
-       do_nodesv $(comma_list $(osts_nodes)) \
-               $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
-
-       local stime=$(date +%s)
-       thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run netdisk
-       local etime=$(date +%s)
-       local rtime=$((etime - stime))
-
-       echo "obd survey finished in $rtime seconds"
-       restore_lustre_params < $param_file
-
-       rm -f $param_file
+       skip "netdisk was removed"
 }
 run_test 2b "Stripe F/S over the Network, async journal"
 
@@ -168,7 +146,7 @@ test_3a () {
 }
 run_test 3a "Network survey"
 
-complete $SECONDS
+complete_test $SECONDS
 cleanup_echo_devs
 check_and_cleanup_lustre
 exit_status