X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fobdfilter-survey.sh;h=ee2e93000d4612cbda03e7935ef216c274fe82d3;hp=406b2d4a598e8459602490006134ded7b1750d8a;hb=c1859da8a18cb53e95238dc8e5d3567e053057eb;hpb=21fc724b44da49fd37121ea4c027e2480976215b diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index 406b2d4..ee2e930 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -14,9 +14,11 @@ size=${size:-1024} . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; } +thrlo=${thrlo:-$(( thrhi / 2))} # Skip these tests -ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT" +# bug number 23791 23791 +ALWAYS_EXCEPT="1b 2b $OBDFILTER_SURVEY_EXCEPT" OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)} @@ -71,7 +73,7 @@ obdflter_survey_run () { rm -f ${TMP}/obdfilter_survey* local targets=$(obdflter_survey_targets $case) - local cmd="thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" sh $OBDSURVEY" + local cmd="NETTYPE=$NETTYPE thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" sh $OBDSURVEY" echo + $cmd eval $cmd @@ -82,11 +84,95 @@ test_1a () { } run_test 1a "Object Storage Targets survey" +print_jbd () { + local file=$1 + local facet=$2 + local varsvc=${facet}_svc + local dev=$(basename $(do_facet $facet lctl get_param -n *.${!varsvc}.mntdev)) + + # 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 + + # last two lines from history + # $4: run >= 5000 + # $8: hndls >= thrhi * 2 + local hist=("$(print_jbd history $facet | tail -3 | head -2)") + 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 facet + local rc=0 + for facet in ${facets//,/ }; do + check_jbd_values $facet $thrhi || rc=$((rc+$?)) + done + return $rc +} + +test_1b () { + local param_file=$TMP/$tfile-params + + do_nodesv $(comma_list $(osts_nodes)) lctl get_param obdfilter.${FSNAME}-*.sync_journal + + save_lustre_params $(comma_list $(osts_nodes)) "obdfilter.${FSNAME}-*.sync_journal" >$param_file + do_nodesv $(comma_list $(osts_nodes)) lctl set_param obdfilter.${FSNAME}-*.sync_journal=0 + + thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk + + check_jbd_values_facets $(get_facets OST) 4 || rc=$((rc+$?)) + + restore_lustre_params < $param_file + + rm -f $param_file + return $rc +} +run_test 1b "Object Storage Targets survey, async journal" + test_2a () { obdflter_survey_run netdisk } 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 $(comma_list $(osts_nodes)) "obdfilter.${FSNAME}-*.sync_journal" >$param_file + do_nodesv $(comma_list $(osts_nodes)) lctl set_param obdfilter.${FSNAME}-*.sync_journal=0 + + thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run netdisk + + check_jbd_values_facets $(get_facets OST) 4 || rc=$((rc+$?)) + + restore_lustre_params < $param_file + + rm -f $param_file + return $rc +} +run_test 2b "Stripe F/S over the Network, async journal" + + # README.obdfilter-survey: In network test only automated run is supported. test_3a () { remote_servers || { skip "Local servers" && return 0; } @@ -104,4 +190,4 @@ run_test 3a "Network survey" equals_msg `basename $0`: test complete, cleaning up cleanup_echo_devs check_and_cleanup_lustre -[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true +[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true