From dee5f24114531ec34fc56ce2826ada9e5690aabc Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 4 Oct 2012 21:49:17 -0600 Subject: [PATCH] LU-1538 tests: use $TESTSUITE instead of $0 Use "$TESTSUITE" instead of "$0" in test script messages, since $0 is a full pathname and clutters up the test logs. Instead, $TESTSUITE is only the test suite name, and is more compact. Use it in all output. This makes the output from complete() redundant, in that it prints $TESTSUITE both as an argument and internally via the equals_msg() function (via banner()), so remove the $TESTSUITE argument from all callers of complete(). The equals_msg() function was only a thin wrapper around banner(), and was only used by complete(), remove it and call banner() directly. Signed-off-by: Andreas Dilger Change-Id: I6b3f256000317a17fdd2a361a38d4dfdda500c1e Reviewed-on: http://review.whamcloud.com/4192 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yu Jian Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 2 +- lustre/tests/insanity.sh | 10 +++++----- lustre/tests/large-scale.sh | 10 +++++----- lustre/tests/lfsck.sh | 4 ++-- lustre/tests/liblustre.sh | 2 +- lustre/tests/llog-test.sh | 3 +-- lustre/tests/lnet-selftest.sh | 6 +++--- lustre/tests/lustre-rsync-test.sh | 2 +- lustre/tests/mds-survey.sh | 2 +- lustre/tests/mdsrate-create-small.sh | 2 +- lustre/tests/mdsrate-lookup-10dirs.sh | 5 +++-- lustre/tests/mdsrate-lookup-1dir.sh | 2 +- lustre/tests/mdsrate-stat-large.sh | 3 ++- lustre/tests/mdsrate-stat-small.sh | 2 +- lustre/tests/metadata-updates.sh | 2 +- lustre/tests/mmp.sh | 2 +- lustre/tests/obdfilter-survey.sh | 2 +- lustre/tests/ost-pools.sh | 2 +- lustre/tests/parallel-scale-nfs.sh | 2 +- lustre/tests/parallel-scale.sh | 2 +- lustre/tests/performance-sanity.sh | 2 +- lustre/tests/posix.sh | 2 +- lustre/tests/racer.sh | 2 +- lustre/tests/recovery-double-scale.sh | 2 +- lustre/tests/recovery-mds-scale.sh | 2 +- lustre/tests/recovery-random-scale.sh | 2 +- lustre/tests/recovery-small.sh | 2 +- lustre/tests/replay-dual.sh | 4 ++-- lustre/tests/replay-ost-single.sh | 2 +- lustre/tests/replay-single-lmv.sh | 2 +- lustre/tests/replay-single.sh | 2 +- lustre/tests/replay-vbr.sh | 2 +- lustre/tests/runtests | 2 +- lustre/tests/sanity-benchmark.sh | 2 +- lustre/tests/sanity-gss.sh | 2 +- lustre/tests/sanity-quota-old.sh | 5 ++++- lustre/tests/sanity-quota.sh | 2 +- lustre/tests/sanity-scrub.sh | 2 +- lustre/tests/sanity-sec.sh | 2 +- lustre/tests/sanity.sh | 4 ++-- lustre/tests/sanityn.sh | 2 +- lustre/tests/scrub-performance.sh | 2 +- lustre/tests/sgpdd-survey.sh | 2 +- lustre/tests/test-framework.sh | 36 +++++++++++++++++------------------ 44 files changed, 80 insertions(+), 76 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index c5fc54b..49d0aa1 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -3231,5 +3231,5 @@ fi cleanup_gss -complete $(basename $0) $SECONDS +complete $SECONDS exit_status diff --git a/lustre/tests/insanity.sh b/lustre/tests/insanity.sh index c294320..74ca4a2 100755 --- a/lustre/tests/insanity.sh +++ b/lustre/tests/insanity.sh @@ -17,11 +17,11 @@ init_logging ALWAYS_EXCEPT="10 $INSANITY_EXCEPT" if [ "$FAILURE_MODE" = "HARD" ]; then - skip_env "$0: is not functional with FAILURE_MODE = HARD, please use recovery-double-scale, bz20407" - exit 0 + skip_env "$TESTSUITE: is not functional with FAILURE_MODE = HARD, " \ + "please use recovery-double-scale, bz20407" + exit 0 fi -# [ "$SLOW" = "no" ] && EXCEPT_SLOW="" SETUP=${SETUP:-""} @@ -44,7 +44,7 @@ require_dsh_ost || exit 0 FAIL_CLIENTS=$(echo " $FAIL_CLIENTS " | sed -re "s/\s+$LIVE_CLIENT\s+/ /g") DIR=${DIR:-$MOUNT} -TESTDIR=$DIR/d0.$(basename $0 .sh) +TESTDIR=$DIR/d0.$TESTSUITE ##### # fail clients round robin @@ -567,6 +567,6 @@ test_10() { } run_test 10 "Running Availability for 6 hours..." -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/large-scale.sh b/lustre/tests/large-scale.sh index 6792612..8da9783 100644 --- a/lustre/tests/large-scale.sh +++ b/lustre/tests/large-scale.sh @@ -21,9 +21,9 @@ init_logging remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0 -[ -n "$CLIENTS" ] || { skip_env "$0: Need two or more clients" && exit 0; } -[ $CLIENTCOUNT -ge 2 ] || \ - { skip_env "$0: Need two or more remote clients, have $CLIENTCOUNT" && exit 0; } +[ -z "$CLIENTS" ] && skip_env "$TESTSUITE: Need two or more clients" && exit 0 +[ $CLIENTCOUNT -lt 2 ] && + skip_env "$TESTSUITE: Need 2+ clients, have only $CLIENTCOUNT" && exit 0 # [ "$SLOW" = "no" ] && EXCEPT_SLOW="" @@ -49,7 +49,7 @@ test_3a() { # a half of clients by default increment=${INCREMENT:-$(( CLIENTCOUNT / 2 ))} - machinefile=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} + machinefile=${MACHINEFILE:-$TMP/$TESTSUITE.machines} local LOG=$TMP/${TESTSUITE}_$tfile local var=${SINGLEMDS}_svc @@ -119,6 +119,6 @@ test_3a() { run_test 3a "recovery time, $CLIENTCOUNT clients" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/lfsck.sh b/lustre/tests/lfsck.sh index 1c805a1..d8b95cf 100644 --- a/lustre/tests/lfsck.sh +++ b/lustre/tests/lfsck.sh @@ -38,7 +38,7 @@ check_and_setup_lustre assert_DIR -SAMPLE_FILE=$TMP/$(basename $0 .sh).junk +SAMPLE_FILE=$TMP/$TESTSUITE.junk dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=1 # Create some dirs and files on the filesystem. @@ -286,6 +286,6 @@ else fi fi -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/liblustre.sh b/lustre/tests/liblustre.sh index cb0c7b3..0309b33 100644 --- a/lustre/tests/liblustre.sh +++ b/lustre/tests/liblustre.sh @@ -41,6 +41,6 @@ test_1() { } run_test 1 "liblustre sanity" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/llog-test.sh b/lustre/tests/llog-test.sh index 16d0ecd..f26bfc9 100644 --- a/lustre/tests/llog-test.sh +++ b/lustre/tests/llog-test.sh @@ -101,6 +101,5 @@ test_3() { } run_test 3 "Remove testset" -equals_msg test complete, cleaning up +complete $SECONDS FORCE=--force $CLEANUP -echo "$0: completed" diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index f42ed4f..58e73f4 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- # vim:shiftwidth=4:softtabstop=4:tabstop=4: @@ -11,7 +11,7 @@ init_logging # ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT" -[ x$LST = x ] && { skip_env "$0 : lst not found LST=$LST" && exit 0; } +[ x$LST = x ] && { skip_env "lst not found LST=$LST" && exit 0; } # FIXME: what is the reasonable value here? lst_LOOP=${lst_LOOP:-100000} @@ -157,7 +157,7 @@ test_smoke () { } run_test smoke "lst regression test" -complete $(basename $0) $SECONDS +complete $SECONDS if [ "$RESTORE_MOUNT" = yes ]; then setupall fi diff --git a/lustre/tests/lustre-rsync-test.sh b/lustre/tests/lustre-rsync-test.sh index 49918ae..9e0da83 100644 --- a/lustre/tests/lustre-rsync-test.sh +++ b/lustre/tests/lustre-rsync-test.sh @@ -627,6 +627,6 @@ test_9() { run_test 9 "Replicate recursive directory removal" cd $ORIG_PWD -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/mds-survey.sh b/lustre/tests/mds-survey.sh index 3efaf9b..a7a192a 100644 --- a/lustre/tests/mds-survey.sh +++ b/lustre/tests/mds-survey.sh @@ -109,7 +109,7 @@ run_test 2 "Metadata survey with stripe_count = 1" # remount the clients restore_mount $MOUNT -complete $(basename $0) $SECONDS +complete $SECONDS cleanup_echo_devs check_and_cleanup_lustre exit_status diff --git a/lustre/tests/mdsrate-create-small.sh b/lustre/tests/mdsrate-create-small.sh index 575166d..8cad213 100644 --- a/lustre/tests/mdsrate-create-small.sh +++ b/lustre/tests/mdsrate-create-small.sh @@ -138,7 +138,7 @@ else fi fi -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS rmdir $BASEDIR || true rm -f $MACHINEFILE check_and_cleanup_lustre diff --git a/lustre/tests/mdsrate-lookup-10dirs.sh b/lustre/tests/mdsrate-lookup-10dirs.sh index 946d587..22ad632 100644 --- a/lustre/tests/mdsrate-lookup-10dirs.sh +++ b/lustre/tests/mdsrate-lookup-10dirs.sh @@ -109,10 +109,11 @@ else fi fi -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS # FIXME: does it make sense to add the possibility to unlink dirfmt to mdsrate? for i in $(seq 0 $NUM_DIRS); do - mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $BASEDIR/lookup-$i 'f%%d' --ignore + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ + $BASEDIR/lookup-$i 'f%%d' --ignore done rmdir $BASEDIR || true diff --git a/lustre/tests/mdsrate-lookup-1dir.sh b/lustre/tests/mdsrate-lookup-1dir.sh index 0a8ede4b..29ea5f3 100644 --- a/lustre/tests/mdsrate-lookup-1dir.sh +++ b/lustre/tests/mdsrate-lookup-1dir.sh @@ -102,7 +102,7 @@ else fi fi -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mdsrate-stat-large.sh b/lustre/tests/mdsrate-stat-large.sh index 6d269dc..9fd2c08 100644 --- a/lustre/tests/mdsrate-stat-large.sh +++ b/lustre/tests/mdsrate-stat-large.sh @@ -107,7 +107,8 @@ else fi fi -equals_msg `basename $0`: test complete, cleaning up + +complete $SECONDS mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mdsrate-stat-small.sh b/lustre/tests/mdsrate-stat-small.sh index efad812..f7b84c1 100644 --- a/lustre/tests/mdsrate-stat-small.sh +++ b/lustre/tests/mdsrate-stat-small.sh @@ -107,7 +107,7 @@ else fi fi -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index 0228c2b..66d9d8e 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -260,7 +260,7 @@ else skip_env "$0 : write_disjoint not found " fi -complete $(basename $0) $SECONDS +complete $SECONDS rm -rf $TESTDIR rm -f $MACHINEFILE check_and_cleanup_lustre diff --git a/lustre/tests/mmp.sh b/lustre/tests/mmp.sh index 1da9830..5da2d08 100755 --- a/lustre/tests/mmp.sh +++ b/lustre/tests/mmp.sh @@ -667,6 +667,6 @@ run_test 10 "e2fsck with mounted filesystem" mmp_fini FAIL_ON_ERROR=$SAVED_FAIL_ON_ERROR -complete $(basename $0) $SECONDS +complete $SECONDS $MMP_RESTORE_MOUNT && setupall exit_status diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index 37a4d28..d78f7b4 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -210,7 +210,7 @@ test_3a () { } run_test 3a "Network survey" -complete $(basename $0) $SECONDS +complete $SECONDS cleanup_echo_devs check_and_cleanup_lustre exit_status diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index c9c3f22..cd59fa1 100644 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -1447,7 +1447,7 @@ run_test 26 "Choose other OSTs in the pool first in the creation remedy" cd $ORIG_PWD -complete $(basename $0) $SECONDS +complete $SECONDS cleanup_pools $FSNAME check_and_cleanup_lustre exit_status diff --git a/lustre/tests/parallel-scale-nfs.sh b/lustre/tests/parallel-scale-nfs.sh index 013670d..2e0bbd2 100755 --- a/lustre/tests/parallel-scale-nfs.sh +++ b/lustre/tests/parallel-scale-nfs.sh @@ -106,6 +106,6 @@ elif ! zconf_mount_clients $CLIENTS $MOUNT; then error_noexit false "failed to mount lustre after nfs test" fi -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/parallel-scale.sh b/lustre/tests/parallel-scale.sh index 28c42af..8746655 100644 --- a/lustre/tests/parallel-scale.sh +++ b/lustre/tests/parallel-scale.sh @@ -124,6 +124,6 @@ test_statahead () { } run_test statahead "statahead test, multiple clients" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/performance-sanity.sh b/lustre/tests/performance-sanity.sh index fd13747..0ddcaa8 100644 --- a/lustre/tests/performance-sanity.sh +++ b/lustre/tests/performance-sanity.sh @@ -81,7 +81,7 @@ test_8() { } run_test 8 "getattr large files ======" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre [ -f "$LOG" ] && cat $LOG || true exit_status diff --git a/lustre/tests/posix.sh b/lustre/tests/posix.sh index 3d75e5e..8615a37 100755 --- a/lustre/tests/posix.sh +++ b/lustre/tests/posix.sh @@ -113,6 +113,6 @@ test_1() { } run_test 1 "build, install, run posix on ext4 and lustre, then compare" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index edcf900..8d75c2c 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -60,6 +60,6 @@ test_1() { } run_test 1 "racer on clients: ${CLIENTS:-$(hostname)} DURATION=$DURATION" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/recovery-double-scale.sh b/lustre/tests/recovery-double-scale.sh index 92ebdff..a5ef06f 100644 --- a/lustre/tests/recovery-double-scale.sh +++ b/lustre/tests/recovery-double-scale.sh @@ -307,6 +307,6 @@ run_test pairwise_fail "pairwise combination of clients, MDS, and OST failures" zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed" client_up || error "start client on $HOSTNAME failed" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/recovery-mds-scale.sh b/lustre/tests/recovery-mds-scale.sh index ba3b5e6..fb6816b 100644 --- a/lustre/tests/recovery-mds-scale.sh +++ b/lustre/tests/recovery-mds-scale.sh @@ -247,6 +247,6 @@ run_test failover_ost "failover OST" zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed" client_up || error "start client on $HOSTNAME failed" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/recovery-random-scale.sh b/lustre/tests/recovery-random-scale.sh index bc2e70d..e63523e 100644 --- a/lustre/tests/recovery-random-scale.sh +++ b/lustre/tests/recovery-random-scale.sh @@ -265,6 +265,6 @@ run_test fail_client_mds "fail client, then failover MDS" zconf_mount $HOSTNAME $MOUNT || error "mount $MOUNT on $HOSTNAME failed" client_up || error "start client on $HOSTNAME failed" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 5a26d02..a1ca789 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -1536,6 +1536,6 @@ test_106() { # LU-1789 } run_test 106 "lightweight connection support" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 639cb85..66fc62b 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -68,7 +68,7 @@ run_test 0a "expired recovery with lost client" if [ -f "$LU482_FAILED" ]; then log "Found check file $LU482_FAILED, aborting test script" rm -vf "$LU482_FAILED" - complete $(basename $0) $SECONDS + complete $SECONDS do_nodes $CLIENTS umount -f $MOUNT2 || true do_nodes $CLIENTS umount -f $MOUNT || true # copied from stopall, but avoid the MDS recovery @@ -576,7 +576,7 @@ run_test 21b "commit on sharing, two clients" # end commit on sharing tests -complete $(basename $0) $SECONDS +complete $SECONDS SLEEP=$((`date +%s` - $NOW)) [ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP [ "$MOUNTED2" = yes ] && zconf_umount $HOSTNAME $MOUNT2 || true diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 8606cbb..a85031a 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -367,6 +367,6 @@ test_8e() { } run_test 8e "Verify that ptlrpc resends request on -EINPROGRESS" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/replay-single-lmv.sh b/lustre/tests/replay-single-lmv.sh index d66190d..21dd7ca 100755 --- a/lustre/tests/replay-single-lmv.sh +++ b/lustre/tests/replay-single-lmv.sh @@ -113,6 +113,6 @@ test_3b() { } run_test 3b "mkdir cross-node dir (fail mds with inode)" -equals_msg test complete, cleaning up +complete $SECONDS $CLEANUP diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index dd5bdd9..94d4dfc 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -2374,6 +2374,6 @@ test_90() { # bug 19494 } run_test 90 "lfs find identifies the missing striped file segments" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index 50e483f..14c9883 100644 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -1153,6 +1153,6 @@ rm -f $cos_param_file [ "$CLIENTS" ] && zconf_mount_clients $CLIENTS $DIR -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/runtests b/lustre/tests/runtests index f4297ff..f6b3cd2 100755 --- a/lustre/tests/runtests +++ b/lustre/tests/runtests @@ -127,7 +127,7 @@ if [ `expr $NOWUSED - $USED` -gt 1024 ]; then echo "Space not all freed: now ${NOWUSED}kB, was ${USED}kB." 1>&2 fi -complete $(basename $0) $SECONDS +complete $SECONDS rm -f $FILES check_and_cleanup_lustre exit_status diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index 65554fc..adac0d9 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -342,6 +342,6 @@ test_pios_fpp() { } run_test pios_fpp "pios file per process" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/sanity-gss.sh b/lustre/tests/sanity-gss.sh index 60104e5..701c0db 100644 --- a/lustre/tests/sanity-gss.sh +++ b/lustre/tests/sanity-gss.sh @@ -795,6 +795,6 @@ test_151() { } run_test 151 "secure mgs connection: server flavor control" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/sanity-quota-old.sh b/lustre/tests/sanity-quota-old.sh index 3cfa36d..582eb22 100755 --- a/lustre/tests/sanity-quota-old.sh +++ b/lustre/tests/sanity-quota-old.sh @@ -2405,7 +2405,10 @@ quota_fini() quota_fini cd $ORIG_PWD -complete sanity-quota.sh $SECONDS + +# override TESTSUITE so Maloo keeps only one set of sanity-quota results +TESTSUITE=sanity-quota.sh +complete $SECONDS check_and_cleanup_lustre export QUOTA_AUTO=$QUOTA_AUTO_OLD exit_status diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index d77800b..58cd433 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -2033,7 +2033,7 @@ quota_fini() quota_fini cd $ORIG_PWD -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre export QUOTA_AUTO=$QUOTA_AUTO_OLD exit_status diff --git a/lustre/tests/sanity-scrub.sh b/lustre/tests/sanity-scrub.sh index cf54e80..a6754e9 100644 --- a/lustre/tests/sanity-scrub.sh +++ b/lustre/tests/sanity-scrub.sh @@ -738,5 +738,5 @@ OSTSIZE=${SAVED_OSTSIZE} # cleanup the system at last formatall -complete $(basename $0) $SECONDS +complete $SECONDS exit_status diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index f320e41..70e1114 100644 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -572,5 +572,5 @@ sec_unsetup sec_cleanup -complete $(basename $0) $SECONDS +complete $SECONDS exit_status diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index d38300b..cfe736d 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -12,7 +12,7 @@ ALWAYS_EXCEPT=" 27u 42a 42b 42c 42d 45 51d 68b $SANIT # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! # with LOD/OSP landing -# bug number for skipped tests: LU2036 +# bug number for skipped tests: LU-2036 ALWAYS_EXCEPT=" 76 $ALWAYS_EXCEPT" @@ -9886,7 +9886,7 @@ test_900() { } run_test 900 "umount should not race with any mgc requeue thread" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre if [ "$I_MOUNTED" != "yes" ]; then lctl set_param debug="$OLDDEBUG" 2> /dev/null || true diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index d1ad569..8ada48d 100644 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -1981,6 +1981,6 @@ log "cleanup: ======================================================" [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2 -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status diff --git a/lustre/tests/scrub-performance.sh b/lustre/tests/scrub-performance.sh index 277bb91..0c029e7 100644 --- a/lustre/tests/scrub-performance.sh +++ b/lustre/tests/scrub-performance.sh @@ -175,5 +175,5 @@ run_test 0 "OI scrub performance test" # cleanup the system at last scrub_cleanup -complete $(basename $0) $SECONDS +complete $SECONDS exit_status diff --git a/lustre/tests/sgpdd-survey.sh b/lustre/tests/sgpdd-survey.sh index ac5da4d..cd4ec0e 100644 --- a/lustre/tests/sgpdd-survey.sh +++ b/lustre/tests/sgpdd-survey.sh @@ -79,5 +79,5 @@ test_2 () { } run_test 2 "sgpdd-survey, osts, scsidevs" -complete $(basename $0) $SECONDS +complete $SECONDS exit_status diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 1bdf5fe..265bbcb 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1721,15 +1721,16 @@ cleanup_check() { check_mem_leak || exit 204 - [ "`lctl dl 2> /dev/null | wc -l`" -gt 0 ] && lctl dl && \ - echo "$0: lustre didn't clean up..." 1>&2 && return 202 || true - - if module_loaded lnet || module_loaded libcfs; then - echo "$0: modules still loaded..." 1>&2 - /sbin/lsmod 1>&2 - return 203 - fi - return 0 + [ "`lctl dl 2> /dev/null | wc -l`" -gt 0 ] && lctl dl && + echo "$TESTSUITE: lustre didn't clean up..." 1>&2 && + return 202 || true + + if module_loaded lnet || module_loaded libcfs; then + echo "$TESTSUITE: modules still loaded..." 1>&2 + /sbin/lsmod 1>&2 + return 203 + fi + return 0 } wait_update () { @@ -3870,9 +3871,10 @@ error_noexit() { gather_logs $(comma_list $(nodes_list)) fi - debugrestore - [ "$TESTSUITELOG" ] && echo "$0: ${TYPE}: $TESTNAME $@" >> $TESTSUITELOG - echo "$@" > $LOGDIR/err + debugrestore + [ "$TESTSUITELOG" ] && + echo "$TESTSUITE: $TYPE: $TESTNAME $@" >> $TESTSUITELOG + echo "$@" > $LOGDIR/err } exit_status () { @@ -4032,10 +4034,6 @@ run_test() { return $? } -equals_msg() { - banner "$*" -} - log() { echo "$*" module_loaded lnet || load_modules @@ -4062,9 +4060,11 @@ trace() { } complete () { - equals_msg $1 test complete, duration $2 sec + local duration=$1 + + banner test complete, duration $duration sec [ -f "$TESTSUITELOG" ] && egrep .FAIL $TESTSUITELOG || true - echo duration $2 >>$TESTSUITELOG + echo duration $duration >>$TESTSUITELOG } pass() { -- 1.8.3.1