if [ "$SANITY" != "no" ]; then
title sanity
- SANITYLOG=/tmp/sanity.log sh sanity.sh
+ sh sanity.sh
$CLEANUP
$SETUP
fi
mkdir -p $MOUNT2
mount_client $MOUNT2
#echo "can't mount2 for '$NAME', skipping sanityN.sh"
- SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
+ START=: CLEAN=: sh sanityN.sh
umount $MOUNT2
$DEBUG_ON
$CLEANUP
unload_modules
# Liblustre needs accept=all, noacl
- LNETOPTS="accept=all" MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" $SETUP
+ [ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
+ [ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
+
+ LNETOPTS="$(awk '/^options lnet/ { print $0}' $MODPROBECONF | sed 's/^options lnet //g') accept=all" MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" $SETUP
export LIBLUSTRE_MOUNT_POINT=$MOUNT2
export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
echo "save $MOUNTLUSTRE to $MOUNTLUSTRE.sav"
mv $MOUNTLUSTRE $MOUNTLUSTRE.sav && trap cleanup_15 EXIT INT
if [ -f $MOUNTLUSTRE ]; then
- echo "$MOUNTLUSTRE cannot be moved, skipping test"
+ skip "$MOUNTLUSTRE cannot be moved, skipping test"
return 0
fi
fi
run_test 28 "permanent parameter setting"
test_29() {
- [ "$OSTCOUNT" -lt "2" ] && echo "skipping deactivate test" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "$OSTCOUNT < 2, skipping" && return
setup > /dev/null 2>&1
start_ost2
sleep 10
# there appears to be a lot of assumption here about loopback
# devices
# or maybe this test is just totally useless on a client-only system
- [ -z "$TUNEFS" ] && echo "No tunefs" && return
- [ ! -r disk1_4.zip ] && echo "Cant find disk1_4.zip, skipping" && return
- unzip -o -j -d $TMP/$tdir disk1_4.zip || { echo "Cant unzip disk1_4, skipping" && return ; }
+ [ -z "$TUNEFS" ] && skip "No tunefs" && return
+ [ ! -r disk1_4.zip ] && skip "Cant find disk1_4.zip, skipping" && return
+ unzip -o -j -d $TMP/$tdir disk1_4.zip || { skip "Cant unzip disk1_4, skipping" && return ; }
load_modules
sysctl lnet.debug=$PTLDEBUG
# there appears to be a lot of assumption here about loopback
# devices
# or maybe this test is just totally useless on a client-only system
- [ -z "$TUNEFS" ] && echo "No tunefs" && return
- [ ! -r disk1_4.zip ] && echo "Cant find disk1_4.zip, skipping" && return
- unzip -o -j -d $TMP/$tdir disk1_4.zip || { echo "Cant unzip disk1_4, skipping" && return ; }
+ [ -z "$TUNEFS" ] && skip "No tunefs" && return
+ [ ! -r disk1_4.zip ] && skip "Cant find disk1_4.zip, skipping" && return
+ unzip -o -j -d $TMP/$tdir disk1_4.zip || { skip "Cant unzip disk1_4, skipping" && return ; }
load_modules
sysctl lnet.debug=$PTLDEBUG
cleanup_nocli
cleanup_krb5_env
-equals_msg "Done"
-echo "$0: completed"
+equals_msg `basename $0`: test complete
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
}
run_test 10 "Running Availability for 6 hours..."
-equals_msg "Done, cleaning up"
+equals_msg `basename $0`: test complete, cleaning up
$CLEANUP
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
run_test 17 "timeout bulk get, don't evict client (2732)"
test_18a() {
- [ -z ${ost2_svc} ] && echo Skipping, needs 2 osts && return 0
+ [ -z ${ost2_svc} ] && skip "needs 2 osts" && return 0
do_facet client mkdir -p $MOUNT/$tdir
f=$MOUNT/$tdir/$tfile
test_26() { # bug 5921 - evict dead exports by pinger
# this test can only run from a client on a separate node.
- [ "`lsmod | grep obdfilter`" ] && \
- echo "skipping test 26 (local OST)" && return
- [ "`lsmod | grep mds`" ] && \
- echo "skipping test 26 (local MDS)" && return
+ remote_ost || skip "local OST" && return
+ remote_mds || skip "local MDS" && return
OST_FILE=$LPROC/obdfilter/${ost1_svc}/num_exports
OST_EXP="`do_facet ost1 cat $OST_FILE`"
OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2`
run_test 26b "evict dead exports"
test_27() {
- [ "`lsmod | grep mds`" ] || \
- { echo "skipping test 27 (non-local MDS)" && return 0; }
+ remote_mds && { skip "remote MDS" && return 0; }
mkdir -p $DIR/$tdir
writemany -q -a $DIR/$tdir/$tfile 0 5 &
CLIENT_PID=$!
# bug 11330 - liblustre application death during I/O locks up OST
test_55() {
- [ "`lsmod | grep obdfilter`" ] || \
- { echo "skipping test 55 (non-local OST)" && return 0; }
+ remote_ost && { skip "remote OST" && return 0; }
mkdir -p $DIR/$tdir
}
run_test 58 "Eviction in the middle of open RPC reply processing"
+equals_msg `basename $0`: test complete, cleaning up
$CLEANUP
-echo "$0: completed"
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
run_test 19 "resend of open request"
if [ "$ONLY" != "setup" ]; then
- equals_msg test complete, cleaning up
+ equals_msg `basename $0`: test complete, cleaning up
SLEEP=$((`date +%s` - $NOW))
[ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
$CLEANUP
fi
-echo "$0: completed"
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
+
}
run_test 7 "Fail OST before obd_destroy"
-equals_msg test complete, cleaning up
+equals_msg `basename $0`: test complete, cleaning up
$CLEANUP
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
# the page, guarnateeing that the unlock from the RPC completion would
# assert on trying to unlock the unlocked page.
test_41() {
+ [ $OSTCOUNT -lt 2 ] && \
+ skip "skipping test 41: we don't have a second OST to test with" && \
+ return
+
local f=$MOUNT/$tfile
# make sure the start of the file is ost1
lfs setstripe $f $((128 * 1024)) 0 0
equals_msg `basename $0`: test complete, cleaning up
$CLEANUP
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
MAX_DQ_TIME=604800
MAX_IQ_TIME=604800
+QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
+FAIL_ON_ERROR=false
+
log() {
echo "$*"
$LCTL mark "$*" 2> /dev/null || true
fi
testname=EXCEPT_$1
if [ ${!testname}x != x ]; then
- echo "skipping excluded test $1"
+ TESTNAME=test_$1 skip "skipping excluded test $1"
return 0
fi
testname=EXCEPT_$base
if [ ${!testname}x != x ]; then
- echo "skipping excluded test $1 (base $base)"
+ TESTNAME=test_$1 skip "skipping excluded test $1 (base $base)"
return 0
fi
run_one $1 "$2"
[ "$QUOTALOG" ] && rm -f $QUOTALOG || true
-error() {
- sysctl -w lustre.fail_loc=0
- log "FAIL: $TESTNAME $@"
- if [ "$QUOTALOG" ]; then
- echo "FAIL: $TESTNAME $@" >> $QUOTALOG
- else
- exit 1
- fi
-}
-
-pass() {
- echo PASS $@
-}
-
mounted_lustre_filesystems() {
awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts | sed -n ${1}p
}
# block quota acquire & release
test_6() {
if [ $OSTCOUNT -lt 2 ]; then
- echo "WARN: too few osts, skip this test."
+ skip "$OSTCOUNT < 2, too few osts"
return 0;
fi
# quota recovery (block quota only by now)
test_7()
{
- if [ -z "`lsmod|grep mds`" ]; then
- echo "WARN: no local mds, skip this test"
- return 0
- fi
+ remote_mds && skip "remote mds"
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 10)) # 10 bunits each sever
TESTFILE="$TSTDIR/quota_tst70"
FILE_LIMIT=1000000
DBENCH_LIB=${DBENCH_LIB:-/usr/lib/dbench}
- [ ! -d $DBENCH_LIB ] && echo "dbench not installed, skip this test" && return 0
+ [ ! -d $DBENCH_LIB ] && skip "dbench not installed" && return 0
echo " Set enough high limit for user: $TSTUSR"
$LFS setquota -u $TSTUSR 0 $BLK_LIMIT 0 $FILE_LIMIT $MOUNT
size_file=$((1024 * 1024 * 9 / 2 * $OSTCOUNT))
echo "lustrefs_size:$lustrefs_size size_file:$size_file"
if [ $lustrefs_size -lt $size_file ]; then
- echo "WARN: less than $size_file free, skip this test."
+ skip "less than $size_file free"
return 0;
fi
size_file=$((1024 * 1024 * 9 / 2 * $OSTCOUNT))
echo "lustrefs_size:$lustrefs_size size_file:$size_file"
if [ $lustrefs_size -lt $size_file ]; then
- echo "WARN: less than $size_file free, skip this test."
+ skip "less than $size_file free"
return 0;
fi
if [ ! -d /proc/fs/lustre/ost/ -o ! -d /proc/fs/lustre/mds ]; then
- echo "WARN: mds or ost isn't local, skip this test."
+ skip "mds or ost isn't local"
return 0;
fi
fi
echo '=========================== finished ==============================='
-[ -f "$QUOTALOG" ] && cat $QUOTALOG && exit 1
+[ -f "$QUOTALOG" ] && cat $QUOTALOG && grep -q FAIL $QUOTALOG && exit 1 || true
echo "$0: completed"
fi
fi
-SANITYLOG=${SANITYLOG:-/tmp/sanity.log}
-
export NAME=${NAME:-local}
SAVE_PWD=$PWD
$RUNAS -u $(($RUNAS_ID + 1)) krb5_login.sh || exit 1
fi
+SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
+FAIL_ON_ERROR=false
+
cleanup() {
echo -n "cln.."
cleanupall ${FORCE} $* || { echo "FAILed to clean up"; exit 20; }
STRIPESIZE=`cat $LPROC/lov/$LOVNAME/stripesize`
ORIGFREE=`cat $LPROC/lov/$LOVNAME/kbytesavail`
MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
-MDS=$(\ls $LPROC/mdt 2> /dev/null | grep -v num_refs | tail -n 1)
[ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
[ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
}
test_27n() {
- [ "$OSTCOUNT" -lt "2" -o -z "$MDS" ] && \
- skip "too few OSTs, or remote MDS" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
+ remote_mds && skip "remote MDS" && return
reset_enospc
rm -f $DIR/d27/f27n
run_test 27n "create file with some full OSTs =================="
test_27o() {
- [ "$OSTCOUNT" -lt "2" -o -z "$MDS" ] && \
- skip "too few OSTs, or remote MDS" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
+ remote_mds && skip "remote MDS" && return
reset_enospc
rm -f $DIR/d27/f27o
run_test 27o "create file with all full OSTs (should error) ===="
test_27p() {
- [ "$OSTCOUNT" -lt "2" -o -z "$MDS" ] && \
- skip "too few OSTs, or remote MDS" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
+ remote_mds && skip "remote MDS" && return
reset_enospc
rm -f $DIR/d27/f27p
run_test 27p "append to a truncated file with some full OSTs ==="
test_27q() {
- [ "$OSTCOUNT" -lt "2" -o -z "$MDS" ] && \
- skip "too few OSTs, or remote MDS" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
+ remote_mds && skip "remote MDS" && return
reset_enospc
rm -f $DIR/d27/f27q
run_test 27q "append to truncated file with all OSTs full (should error) ==="
test_27r() {
- [ "$OSTCOUNT" -lt "2" -o -z "$MDS" ] && \
- skip "too few OSTs, or remote MDS" && return
+ [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
+ remote_mds && skip "remote MDS" && return
reset_enospc
rm -f $DIR/d27/f27r
}
run_test 36f "utime on file racing with OST BRW write =========="
-if [ -d $LPROC/obdfilter ]; then
-export FMD_MAX_AGE=`cat $LPROC/obdfilter/*/client_cache_seconds | head -n 1`
-fi
+export FMD_MAX_AGE=`do_facet ost1 cat $LPROC/obdfilter/*/client_cache_seconds | head -n 1`
test_36g() {
[ -z "$FMD_MAX_AGE" ] && skip "skip test for remote OST" && return
FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
run_test 52b "immutable flag test (should return errors) ======="
test_53() {
+ remote_mds && skip "remote MDS" && return
+
# only test MDT0000
for i in `ls -d $LPROC/osc/*-osc-MDT0000 2> /dev/null` ; do
ostname=`basename $i | cut -d - -f 1-2`
test_57a() {
# note test will not do anything if MDS is not local
+ remote_mds && skip "remote MDS" && return
+
[ -z "$MDS" ] && skip "skipping test for remote MDS" && return
for DEV in `cat $LPROC/mds/*/mntdev`; do
dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV"
test_116() {
[ "$OSTCOUNT" -lt "2" ] && skip "$OSTCOUNT < 2 OSTs" && return
- [ $(grep -c obdfilter $LPROC/devices) -eq 0 ] &&
- skip "remote MDS, skipping test" && return
+ remote_mds && skip "remote MDS" && return
echo -n "Free space priority "
cat $LPROC/lov/*-clilov-*/qos_prio_free
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
+FAIL_ON_ERROR=false
+
if [ ! -z "$USING_KRB5" ]; then
$RUNAS krb5_login.sh || exit 1
fi
run_test 16 "2500 iterations of dual-mount fsx ================="
test_17() { # bug 3513, 3667
- [ ! -d /proc/fs/lustre/ost ] && echo "skipping OST-only test" && return
+ [ ! -d /proc/fs/lustre/ost ] && skip "remote OST, skipping OST-only test" && return
cp /etc/termcap $DIR1/f17
cancel_lru_locks osc > /dev/null
run_test 24 "lfs df [-ih] [path] test ========================="
test_25() {
- [ `cat $LPROC/mdc/*-mdc-*/connect_flags | grep -c acl` -lt 2 ] && echo "skipping $TESTNAME (must have acl)" && return
+ [ `cat $LPROC/mdc/*-mdc-*/connect_flags | grep -c acl` -lt 2 ] && \
+ skip "must have acl, skipping" && return
mkdir $DIR1/$tdir || error "mkdir $DIR1/$tdir"
touch $DIR1/$tdir/f1 || error "touch $DIR1/$tdir/f1"
fi
echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true
+[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
echo "$0: completed"
-
[ -d /r ] && export ROOT=${ROOT:-/r}
export TMP=${TMP:-$ROOT/tmp}
+ export TESTSUITELOG=${TMP}/${TESTSUITE}.log
export PATH=:$PATH:$LUSTRE/utils:$LUSTRE/utils/gss:$LUSTRE/tests
export LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
shift $((OPTIND - 1))
ONLY=${ONLY:-$*}
+
+ [ "$TESTSUITELOG" ] && rm -f $TESTSUITELOG || true
+
}
load_module() {
return 0
}
+FAIL_ON_ERROR=true
##################################
# Test interface
error() {
+ local ERRLOG
sysctl -w lustre.fail_loc=0 2> /dev/null || true
- log "${TESTSUITE}: **** FAIL:" $@
- $LCTL dk $TMP/lustre-log-$TESTNAME.log
- log "FAIL: $TESTNAME $@"
- $LCTL dk $TMP/lustrefail_${TESTSUITE}_${TESTNAME}.$(date +%s)
- exit 1
+ log "${TESTSUITE} ${TESTNAME}: **** FAIL:" $@
+ ERRLOG=$TMP/lustre_${TESTSUITE}_${TESTNAME}.$(date +%s)
+ echo "Dumping lctl log to $ERRLOG"
+ # We need to dump the logs on all nodes
+ $LCTL dk $ERRLOG
+ [ ! "$mds_HOST" = "$(hostname)" ] && do_node $mds_HOST $LCTL dk $ERRLOG
+ [ ! "$ost_HOST" = "$(hostname)" -a ! "$ost_HOST" = "$mds_HOST" ] && do_node $ost_HOST $LCTL dk $ERRLOG
+ debugrestore
+ [ "$TESTSUITELOG" ] && echo "$0: FAIL: $TESTNAME $@" >> $TESTSUITELOG
+ if $FAIL_ON_ERROR; then
+ exit 1
+ fi
+}
+
+skip () {
+ log " SKIP: ${TESTSUITE} ${TESTNAME} $@"
+ [ "$TESTSUITELOG" ] && echo "${TESTSUITE}: SKIP: $TESTNAME $@" >> $TESTSUITELOG
}
build_test_filter() {
fi
testname=EXCEPT_$1
if [ ${!testname}x != x ]; then
- log "skipping excluded test $1"
+ TESTNAME=test_$1 skip "skipping excluded test $1"
return 0
fi
testname=EXCEPT_$base
if [ ${!testname}x != x ]; then
- log "skipping excluded test $1 (base $base)"
+ TESTNAME=test_$1 skip "skipping excluded test $1 (base $base)"
return 0
fi
run_one $1 "$2"
fi
echo $ost
}
+
+remote_mds ()
+{
+ [ ! -e /proc/fs/lustre/mdt/*MDT* ]
+}
+
+remote_ost ()
+{
+ [ $(grep -c obdfilter $LPROC/devices) -eq 0 ]
+}