X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Ftests%2Ftest-framework.sh;h=ff194e575b06b69df601b9a3adb95616be529f44;hb=8ad0cb4fdc1cdf876add1d40512112d75af88e06;hp=afc2488d339a2a46d956e6ec880958486125e909;hpb=890f223c5f8f92b086d757ff545f45ea165b7a91;p=fs%2Flustre-release.git diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index afc2488..ff194e5 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -297,6 +297,7 @@ init_test_env() { fi export SHUTDOWN_ATTEMPTS=${SHUTDOWN_ATTEMPTS:-3} + export OSD_TRACK_DECLARES_LBUG=${OSD_TRACK_DECLARES_LBUG:-"yes"} # command line @@ -3458,10 +3459,22 @@ check_and_setup_lustre() { set_default_debug_nodes $(comma_list $(nodes_list)) fi - if [ -n "$OSD_TRACK_DECLARES_LBUG" ] ; then - do_nodes $(comma_list $(mdts_nodes) $(osts_nodes)) \ - "$LCTL set_param osd-*.track_declares_assert=1" \ - > /dev/null + if [ $(lower $OSD_TRACK_DECLARES_LBUG) == 'yes' ] ; then + local facets="$(get_facets OST),$(get_facets MDS),mgs" + local facet + local nodes + local node + for facet in ${facets//,/ }; do + if [ $(facet_fstype $node) == "ldiskfs" ] ; then + node=$(facet_host ${facet}) + nodes="$nodes $node" + fi + done + if [ -n "$nodes" ] ; then + nodes=$(for i in $nodes; do echo $i; done | sort -u) + do_nodes $(comma_list $nodes) "$LCTL set_param \ + osd-ldiskfs.track_declares_assert=1" + fi fi init_gss @@ -4036,28 +4049,33 @@ log_trace_dump() { ################################## error_noexit() { - local TYPE=${TYPE:-"FAIL"} + local TYPE=${TYPE:-"FAIL"} - local dump=true - # do not dump logs if $1=false - if [ "x$1" = "xfalse" ]; then - shift - dump=false - fi + local dump=true + # do not dump logs if $1=false + if [ "x$1" = "xfalse" ]; then + shift + dump=false + fi - log " ${TESTSUITE} ${TESTNAME}: @@@@@@ ${TYPE}: $@ " - log_trace_dump - mkdir -p $LOGDIR - # We need to dump the logs on all nodes - if $dump; then - gather_logs $(comma_list $(nodes_list)) - fi + log " ${TESTSUITE} ${TESTNAME}: @@@@@@ ${TYPE}: $@ " + log_trace_dump + + mkdir -p $LOGDIR + # We need to dump the logs on all nodes + if $dump; then + gather_logs $(comma_list $(nodes_list)) + fi debugrestore [ "$TESTSUITELOG" ] && echo "$TESTSUITE: $TYPE: $TESTNAME $@" >> $TESTSUITELOG - echo "$@" > $LOGDIR/err + if [ -z "$*" ]; then + echo "error() without useful message, please fix" > $LOGDIR/err + else + echo "$@" > $LOGDIR/err + fi } exit_status () { @@ -4069,21 +4087,21 @@ exit_status () { } error() { - error_noexit "$@" - exit 1 + error_noexit "$@" + exit 1 } error_exit() { - error "$@" + error "$@" } # use only if we are ignoring failures for this test, bugno required. # (like ALWAYS_EXCEPT, but run the test and ignore the results.) # e.g. error_ignore 5494 "your message" error_ignore() { - local TYPE="IGNORE (bz$1)" - shift - error_noexit "$@" + local TYPE="IGNORE (bz$1)" + shift + error_noexit "$@" } error_and_remount() { @@ -4093,7 +4111,7 @@ error_and_remount() { } skip_env () { - $FAIL_ON_SKIP_ENV && error false $@ || skip $@ + $FAIL_ON_SKIP_ENV && error false $@ || skip $@ } skip() { @@ -4744,10 +4762,11 @@ generate_machine_file() { } get_stripe () { - local file=$1/stripe - touch $file - $LFS getstripe -v $file || error - rm -f $file + local file=$1/stripe + + touch $file + $LFS getstripe -v $file || error "getstripe $file failed" + rm -f $file } setstripe_nfsserver () {