From 4f1334d5a03477a0a276fbc5acce29a06a79324f Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 25 Jul 2007 22:37:26 +0000 Subject: [PATCH] b=12499 i=brian add ONLY, debugsave fix iozone test size remove some test output --- lustre/tests/acceptance-small.sh | 19 +++++++++++++++---- lustre/tests/replay-single.sh | 4 ++-- lustre/tests/sanity-quota.sh | 19 +++++++------------ lustre/tests/sanity.sh | 16 ++++++---------- lustre/tests/test-framework.sh | 12 ++++++++++++ 5 files changed, 42 insertions(+), 28 deletions(-) diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 35048b2..f072a65 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -25,9 +25,16 @@ fi [ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\"" [ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484" +if [ "$ONLY" ]; then + export RUNTESTS="no" SANITY="no" DBENCH="no" BONNIE="no" IOZONE="no" FSX="no" SANITYN="no" LFSCK="no" LIBLUSTRE="no" REPLAY_SINGLE="no" CONF_SANITY="no" RECOVERY_SMALL="no" REPLAY_OST_SINGLE="no" REPLAY_DUAL="no" INSANITY="no" SANITY_QUOTA="no" + for O in $ONLY; do + export ${O}="yes" + done + export ONLY="" +fi + -LIBLUSTRE=${LIBLUSTRE:-../liblustre} -LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests} +LIBLUSTRETESTS=${LIBLUSTRETESTS:-../liblustre/tests} STARTTIME=`date +%s` RANTEST="" @@ -47,6 +54,7 @@ setup_if_needed() { title() { echo "-----============= acceptance-small: "$*" ============-----" + $LCTL mark "----===== $* =====----" 2> /dev/null || true RANTEST=${RANTEST}$*", " } @@ -116,9 +124,11 @@ for NAME in $CONFIGS; do SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4)) IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE" - IOZFILE="-f $MOUNT/iozone" + IOZFILE="$MOUNT/iozone" + # $SPACE was calculated with all OSTs + $LFS setstripe $IOZFILE 0 -1 -1 $DEBUG_OFF - iozone $IOZONE_OPTS $IOZFILE + iozone $IOZONE_OPTS -f $IOZFILE $DEBUG_ON $CLEANUP $SETUP @@ -217,6 +227,7 @@ for NAME in $CONFIGS; do #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug` if [ -x $LIBLUSTRETESTS/sanity ]; then mkdir -p $MOUNT2 + echo $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET fi $CLEANUP diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 42ae4e9..6fc1d52 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -909,7 +909,7 @@ test_42() { createmany -o $DIR/$tfile-%d 800 replay_barrier ost1 unlinkmany $DIR/$tfile-%d 0 400 - DEBUG42="`sysctl -n lnet.debug`" + debugsave sysctl -w lnet.debug=-1 facet_failover ost1 @@ -918,7 +918,7 @@ test_42() { #[ $blocks_after -lt $blocks ] || return 1 echo wait for MDS to timeout and recover sleep $((TIMEOUT * 2)) - sysctl -w lnet.debug=$DEBUG42 + debugrestore unlinkmany $DIR/$tfile-%d 400 400 $CHECKSTAT -t file $DIR/$tfile-* && return 2 || true } diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index f017f2a..5d9b8d5 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -775,8 +775,8 @@ test_9() { fi # set the D_QUOTA flag - DBG_SAVE="`sysctl -n lnet.debug`" - sysctl -w lnet.debug="$DBG_SAVE quota" + debugsave + sysctl -w lnet.debug="+quota" TESTFILE="$TSTDIR/quota_tst90" @@ -807,7 +807,7 @@ test_9() { $RUNAS rm -f $TESTFILE RC=$? - sysctl -w lnet.debug="$DBG_SAVE" + debugrestore return $RC } run_test 9 "run for fixing bug10707(64bit) ===========" @@ -830,12 +830,9 @@ test_10() { sync; sleep 10; sync; # set the D_QUOTA flag - set_flag=0 - if [ -z "`sysctl lnet.debug | grep quota`" ]; then - sysctl -w lnet.debug="+quota" - set_flag=1 - fi - + debugsave + sysctl -w lnet.debug="+quota" + # make qd_count 32 bit sysctl -w lustre.fail_loc=0xA00 @@ -870,9 +867,7 @@ test_10() { RC=$? # clear the flage - if [ $set_flag -eq 1 ]; then - sysctl -w lnet.debug="-quota" - fi + debugrestore # make qd_count 64 bit sysctl -w lustre.fail_loc=0 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e88f38f..9e824be 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2020,8 +2020,8 @@ test_48a() { # bug 2399 touch .foo || error "'touch .foo' failed after recreating cwd" mkdir .bar || error "'mkdir .foo' failed after recreating cwd" fi - ls . || error "'ls .' failed after recreating cwd" - ls .. || error "'ls ..' failed after removing cwd" + ls . > /dev/null || error "'ls .' failed after recreating cwd" + ls .. > /dev/null || error "'ls ..' failed after removing cwd" cd . || error "'cd .' failed after recreating cwd" mkdir . && error "'mkdir .' worked after recreating cwd" rmdir . && error "'rmdir .' worked after recreating cwd" @@ -2041,8 +2041,8 @@ test_48b() { # bug 2399 touch .foo && error "'touch .foo' worked after removing cwd" mkdir .foo && error "'mkdir .foo' worked after removing cwd" fi - ls . && error "'ls .' worked after removing cwd" - ls .. || error "'ls ..' failed after removing cwd" + ls . > /dev/null && error "'ls .' worked after removing cwd" + ls .. > /dev/null || error "'ls ..' failed after removing cwd" cd . && error "'cd .' worked after removing cwd" mkdir . && error "'mkdir .' worked after removing cwd" rmdir . && error "'rmdir .' worked after removing cwd" @@ -2596,7 +2596,7 @@ run_test 63 "Verify oig_wait interruption does not crash =======" # bug 2248 - async write errors didn't return to application on sync # bug 3677 - async write errors left page locked test_63b() { - DBG_SAVE="`sysctl -n lnet.debug`" + debugsave sysctl -w lnet.debug=-1 # ensure we have a grant to do async writes @@ -2606,15 +2606,11 @@ test_63b() { #define OBD_FAIL_OSC_BRW_PREP_REQ 0x406 sysctl -w lustre.fail_loc=0x80000406 multiop $DIR/$tfile Owy && \ - $LCTL dk /tmp/test63b.debug && \ - sysctl -w lnet.debug="$DBG_SAVE" && \ error "sync didn't return ENOMEM" sync; sleep 2; sync # do a real sync this time to flush page grep locked $LPROC/llite/*/dump_page_cache && \ - $LCTL dk /tmp/test63b.debug && \ - sysctl -w lnet.debug="$DBG_SAVE" && \ error "locked page left in cache after async error" || true - sysctl -w lnet.debug="$DBG_SAVE" + debugrestore } run_test 63b "async write errors should be returned to fsync ===" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 635187f..a2257b7 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -42,6 +42,8 @@ init_test_env() { export PATH=:$PATH:$LUSTRE/utils:$LUSTRE/tests export LCTL=${LCTL:-"$LUSTRE/utils/lctl"} [ ! -f "$LCTL" ] && export LCTL=$(which lctl) + export LFS=${LFS:-"$LUSTRE/utils/lfs"} + [ ! -f "$LFS" ] && export LFS=$(which lfs) export MKFS=${MKFS:-"$LUSTRE/utils/mkfs.lustre"} [ ! -f "$MKFS" ] && export MKFS=$(which mkfs.lustre) export TUNEFS=${TUNEFS:-"$LUSTRE/utils/tunefs.lustre"} @@ -803,6 +805,15 @@ pgcache_empty() { return 0 } +debugsave() { + DEBUGSAVE="$(sysctl -n lnet.debug)" +} + +debugrestore() { + [ -n "$DEBUGSAVE" ] && sysctl -w lnet.debug=\"$DEBUGSAVE\" + DEBUGSAVE="" +} + ################################## # Test interface error() { @@ -812,6 +823,7 @@ error() { ERRLOG=$TMP/lustre_${TESTSUITE}_${TESTNAME}.$(date +%s) echo "Dumping lctl log to $ERRLOG" $LCTL dk $ERRLOG + debugrestore exit 1 } -- 1.8.3.1