[ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\""
[ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484"
-
-
-LIBLUSTRE=${LIBLUSTRE:-../liblustre}
-LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
-
if [ "$ACC_SM_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 $ACC_SM_ONLY; do
done
fi
+LIBLUSTRETESTS=${LIBLUSTRETESTS:-../liblustre/tests}
+
STARTTIME=`date +%s`
RANTEST=""
title() {
echo "-----============= acceptance-small: "$*" ============-----"
+ $LCTL mark "----===== $* =====----" 2> /dev/null || true
RANTEST=${RANTEST}$*", "
}
if [ "$RUNTESTS" != "no" ]; then
title runtests
- sh runtests
+ bash runtests
$CLEANUP
$SETUP
fi
if [ "$SANITY" != "no" ]; then
title sanity
- sh sanity.sh
+ bash sanity.sh
$CLEANUP
$SETUP
fi
[ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
$DEBUG_OFF
- sh rundbench 1
+ bash rundbench 1
$DEBUG_ON
$CLEANUP
$SETUP
if [ $DB_THREADS -gt 1 ]; then
$DEBUG_OFF
- sh rundbench $DB_THREADS
+ bash rundbench $DB_THREADS
$DEBUG_ON
$CLEANUP
$SETUP
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
mkdir -p $MOUNT2
mount_client $MOUNT2
#echo "can't mount2 for '$NAME', skipping sanityN.sh"
- START=: CLEAN=: sh sanityN.sh
+ START=: CLEAN=: bash sanityN.sh
umount $MOUNT2
$DEBUG_ON
if grep -q obdfilter /proc/fs/lustre/devices; then
if [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
[ "`echo $E2VER | grep cfs`" ]; then
- sh lfscktest.sh
+ bash lfscktest.sh
else
e2fsck -V
echo "e2fsck does not support lfsck, skipping"
#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
if [ "$REPLAY_SINGLE" != "no" ]; then
title replay-single
- sh replay-single.sh
+ bash replay-single.sh
fi
if [ "$CONF_SANITY" != "no" ]; then
title conf-sanity
- sh conf-sanity.sh
+ bash conf-sanity.sh
fi
if [ "$RECOVERY_SMALL" != "no" ]; then
title recovery-small
- sh recovery-small.sh
+ bash recovery-small.sh
fi
if [ "$REPLAY_OST_SINGLE" != "no" ]; then
title replay-ost-single
- sh replay-ost-single.sh
+ bash replay-ost-single.sh
fi
if [ "$REPLAY_DUAL" != "no" ]; then
title replay-dual
- sh replay-dual.sh
+ bash replay-dual.sh
fi
if [ "$INSANITY" != "no" ]; then
title insanity
- sh insanity.sh -r
+ bash insanity.sh -r
fi
if [ "$SANITY_QUOTA" != "no" ]; then
title sanity-quota
- sh sanity-quota.sh
+ bash sanity-quota.sh
fi
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
#[ $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
}
set_blk_tunesz $((1024 * 50))
# 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"
set_blk_tunesz $BTUNE_SZ
set_blk_unitsz $BUNIT_SZ
- sysctl -w lnet.debug="$DBG_SAVE"
+ debugrestore
return $RC
}
run_test 9 "run for fixing bug10707(64bit) ==========="
set_blk_tunesz $((1024 * 50))
# 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
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
test_44() {
[ "$OSTCOUNT" -lt "2" ] && skip "skipping 2-stripe test" && return
dd if=/dev/zero of=$DIR/f1 bs=4k count=1 seek=1023
- dd if=$DIR/f1 bs=4k count=1
+ dd if=$DIR/f1 bs=4k count=1 > /dev/null
}
run_test 44 "zero length read from a sparse stripe ============="
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"
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"
# 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
#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 ==="
export LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
export LFS=${LFS:-"$LUSTRE/utils/lfs"}
[ ! -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"}
return 0
}
+debugsave() {
+ DEBUGSAVE="$(sysctl -n lnet.debug)"
+}
+
+debugrestore() {
+ [ -n "$DEBUGSAVE" ] && sysctl -w lnet.debug="${DEBUGSAVE}"
+ DEBUGSAVE=""
+}
+
FAIL_ON_ERROR=true
##################################
# Test interface