X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Ftests%2Fobdfilter-survey.sh;h=890f0e4306580ba75c3992490dc9455b9836ca9d;hb=301d76a71176c186129231ddd1323bae21100165;hp=9a96e564b4d1ae13e85828aa9b914d9ad1f72633;hpb=471c7966eb03e6283561ba5690a6f9adab68bb9e;p=fs%2Flustre-release.git diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index 9a96e56..890f0e4 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -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_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))} -# Skip these tests -# bug number 23791 23791 -ALWAYS_EXCEPT="1b 2b $OBDFILTER_SURVEY_EXCEPT" - OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)} -build_test_filter check_and_setup_lustre # FIXME: the summary file a bit smaller than OSTSIZE, add estimation @@ -50,7 +46,7 @@ get_targets () { # obdfilter-survey : # case 1 (local disk): # $ nobjhi=2 thrhi=2 size=1024 - # targets="lustre-OST0000 lustre-OST0001 ..." + # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..." # sh obdfilter-survey local_node && [ "$1" == "disk" ] || target=$nid:$target targets="$targets $target" @@ -85,60 +81,12 @@ obdflter_survey_run () { cat ${TMP}/obdfilter_survey* [ $rc = 0 ] || error "$OBDSURVEY failed: $rc" } + test_1a () { obdflter_survey_run disk } run_test 1a "Object Storage Targets survey" -print_jbd () { - local file=$1 - local facet=$2 - local varsvc=${facet}_svc - local dev=$(ldiskfs_canon "*.${!varsvc}.mntdev" $facet) - - # ext4: /proc/fs/jbd2/sda1:8/history - # ext3: /proc/fs/jbd/sdb1/history - - do_facet $facet cat /proc/fs/jbd*/${dev}*/$file -} - -check_jbd_values () { - local facet=$1 - local thrhi=$2 - local rtime=$3 - - # last two lines from history - # $4: run >= 5000 - # $8: hndls >= thrhi * 2 - # display history of rtime/4 before, in case obd cleanup consumes time - local tlines=$((rtime / 5 / 4 + 1)) - local hist=("$(print_jbd history $facet | tail -$tlines | head -n1)") - echo "$hist" - local run=($(echo "${hist[*]}" | awk '{print $4}')) - local hndls=($(echo "${hist[*]}" | awk '{print $8}')) - - local rc=0 - for (( i=0; i<1; i++)); do - [[ ${run[i]} -lt 5000 ]] && \ - error "$facet: run expected 5000, have ${run[i]}" && rc=1 - [[ ${hndls[i]} -lt $((thrhi * 2)) ]] && \ - error "$facet: hndls expected > $((thrhi * 2)), have ${hndls[i]}" && rc=2 - done - return $rc -} - -check_jbd_values_facets () { - local facets=$1 - local thrhi=$2 - local rtime=$3 - local facet - local rc=0 - for facet in ${facets//,/ }; do - check_jbd_values $facet $thrhi $rtime || rc=$((rc+$?)) - done - return $rc -} - test_1b () { local param_file=$TMP/$tfile-params @@ -156,12 +104,9 @@ test_1b () { local rtime=$((etime - stime)) echo "obd survey finished in $rtime seconds" - check_jbd_values_facets $(get_facets OST) 4 $rtime || rc=$((rc+$?)) - restore_lustre_params < $param_file rm -f $param_file - return $rc } run_test 1b "Object Storage Targets survey, async journal" @@ -192,12 +137,9 @@ test_2b () { local rtime=$((etime - stime)) echo "obd survey finished in $rtime seconds" - check_jbd_values_facets $(get_facets OST) 4 $rtime || rc=$((rc+$?)) - restore_lustre_params < $param_file rm -f $param_file - return $rc } run_test 2b "Stripe F/S over the Network, async journal" @@ -210,9 +152,9 @@ test_3a () { # 'lctl dl' output must be blank. # Skipping test for CLIENTONLY mode because of # cleanupall()->stopall() does not cleanup the servers on this mode. - [ "$CLIENTONLY" ] && skip "CLIENTONLY mode" && return + [ "$CLIENTONLY" ] && skip "CLIENTONLY mode" - remote_servers || { skip "Local servers" && return 0; } + remote_servers || skip "Local servers" cleanupall