#
[ "$SLOW" = "no" ] && EXCEPT_SLOW="0 1 2 3 6 7 15 18 24b 25 30 31 32 33 34a "
+assert_DIR
+
reformat() {
formatall
}
CLEANUP=${CLEANUP:-""}
cleanup_and_setup_lustre
+assert_DIR
rm -rf $DIR/[df][0-9]*
SAMPLE_NAME=recovery-small.junk
run_test 51 "failover MDS during recovery"
test_52_guts() {
+ do_facet client "mkdir -p $DIR/$tdir"
do_facet client "writemany -q -a $DIR/$tdir/$tfile 300 5" &
CLIENT_PID=$!
echo writemany pid $CLIENT_PID
build_test_filter
cleanup_and_setup_lustre
+assert_DIR
rm -rf $DIR/[df][0-9]*
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
build_test_filter
REFORMAT=--reformat cleanup_and_setup_lustre
+assert_DIR
rm -rf $DIR/[df][0-9]*
test_0a() {
mkdir -p $DIR
+assert_DIR
rm -rf $DIR/[df][0-9]*
test_0a() { # was test_0
test_6a() { # was test_6
+ mkdir -p $DIR/$tdir
replay_barrier $SINGLEMDS
mcreate $DIR/$tdir/$tfile
fail $SINGLEMDS
run_test 6a "mkdir + contained create"
test_6b() {
+ mkdir -p $DIR/$tdir
replay_barrier $SINGLEMDS
rm -rf $DIR/$tdir
fail $SINGLEMDS
run_test 6b "|X| rmdir"
test_7() {
+ mkdir -p $DIR/$tdir
replay_barrier $SINGLEMDS
mcreate $DIR/$tdir/$tfile
fail $SINGLEMDS
#recovery many mds-ost setattr from llog
test_58() {
+ mkdir -p $DIR/$tdir
#define OBD_FAIL_MDS_OST_SETATTR 0x12c
do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012c"
createmany -o $DIR/$tdir/$tfile-%d 2500
# log_commit_thread vs filter_destroy race used to lead to import use after free
# bug 11658
test_59() {
+ mkdir -p $DIR/$tdir
createmany -o $DIR/$tdir/$tfile-%d 200
sync
unlinkmany $DIR/$tdir/$tfile-%d 200
# race between add unlink llog vs cat log init in post_recovery (only for b1_6)
# bug 12086: should no oops and No ctxt error for this test
test_60() {
+ mkdir -p $DIR/$tdir
createmany -o $DIR/$tdir/$tfile-%d 200
replay_barrier $SINGLEMDS
unlinkmany $DIR/$tdir/$tfile-%d 0 100
run_test 60 "test llog post recovery init vs llog unlink"
#test race llog recovery thread vs llog cleanup
-test_61() {
+test_61a() { # was test_61
mkdir $DIR/$tdir
createmany -o $DIR/$tdir/$tfile-%d 800
replay_barrier ost1
$CHECKSTAT -t file $DIR/$tdir/$tfile-* && return 1
rmdir $DIR/$tdir
}
-run_test 61 "test race llog recovery vs llog cleanup"
+run_test 61a "test race llog recovery vs llog cleanup"
#test race mds llog sync vs llog cleanup
test_61b() {
# block hard limit (normal use and out of quota)
test_1() {
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 5)) # 5 bunits each sever
# file hard limit (normal use and out of quota)
test_2() {
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(($IUNIT_SZ * 10)) # 10 iunits on mds
# block soft limit (start timer, timer goes off, stop timer)
test_3() {
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(( $BUNIT_SZ * 2 )) # 1 bunit on mds and 1 bunit on the ost
# file soft limit (start timer, timer goes off, stop timer)
test_4a() { # was test_4
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(($IUNIT_SZ * 10)) # 10 iunits on mds
TESTFILE=$DIR/$tdir/$tfile-0
# chown & chgrp (chown & chgrp successfully even out of block/file quota)
test_5() {
+ mkdir -p $DIR/$tdir
BLIMIT=$(( $BUNIT_SZ * $((OSTCOUNT + 1)) * 10)) # 10 bunits on each server
ILIMIT=$(( $IUNIT_SZ * 10 )) # 10 iunits on mds
return 0;
fi
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$((BUNIT_SZ * (OSTCOUNT + 1) * 5)) # 5 bunits per server
# quota recovery (block quota only by now)
test_7()
{
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
remote_mds && skip "remote mds" && return 0
# run dbench with quota enabled
test_8() {
+ mkdir -p $DIR/$tdir
BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
FILE_LIMIT=1000000
DBENCH_LIB=${DBENCH_LIB:-/usr/lib/dbench}
SRC=$DBENCH_LIB/client_plain.txt
[ ! -e $TGT -a -e $SRC ] && echo "copying $SRC to $TGT" && cp $SRC $TGT
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
SAVE_PWD=$PWD
cd $DIR/$tdir
# run for fixing bug10707, it need a big room. test for 32bit
test_10() {
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
lustrefs_size=`(echo 0; df -t lustre -P | awk '{print $4}') | tail -n 1`
size_file=$((FSIZE * GB))
local i=1
while [ $i -le $REPS ]; do
echo "test: cycle($i of $REPS) start at $(date)"
- mkdir -p $DIR/$tdir && chmod 777 $DIR/$tdir
+ mkdir -p $TESTDIR && chmod 777 $TESTDIR
echo -n " create a file for uid "
for j in `seq 1 30`; do
echo -n "$j "
# 30MB per dd for a total of 900MB (if space even permits)
- runas -u $j dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$blksize count=15 > /dev/null 2>&1 &
+ runas -u $j dd if=/dev/zero of=$TESTDIR/$tfile bs=$blksize count=15 > /dev/null 2>&1 &
done
echo ""
PROCS=$(ps -ef | grep -v grep | grep "dd if /dev/zero of $TESTDIR" | wc -l)
sleep 20
SECS=$((SECS + sleep))
PROCS=$(ps -ef | grep -v grep | grep "dd if /dev/zero of $TESTDIR" | wc -l)
- USED=$(du -s $DIR/$tdir | awk '{print $1}')
+ USED=$(du -s $TESTDIR | awk '{print $1}')
PCT=$(($USED * 100 / $block_limit))
echo "${i}/${REPS} ${PCT}% p${PROCS} t${SECS} "
if [ $USED -le $LAST_USED ]; then
- kill -9 $(ps -ef | grep "dd if /dev/zero of $DIR/$tdir" | grep -v grep | awk '{ print $2 }')
+ kill -9 $(ps -ef | grep "dd if /dev/zero of $TESTDIR" | grep -v grep | awk '{ print $2 }')
i=$REPS
RV=2
break
LAST_USED=$USED
done
echo " removing the test files..."
- rm -f $DIR/$tdir/$tfile
+ rm -f $TESTDIR/$tfile
echo "cycle $i done at $(date)"
i=$[$i+1]
done
# test a deadlock between quota and journal b=11693
test_12() {
+ mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
[ "$(grep $DIR2 /proc/mounts)" ] || mount_client $DIR2 || \
# one OST * 10 + (mds + other OSTs)
LIMIT=$((BUNIT_SZ * 10 + (BUNIT_SZ * OSTCOUNT)))
TESTFILE="$DIR/$tdir/$tfile"
-
+ mkdir -p $DIR/$tdir
+
echo " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR 0 $LIMIT 0 0 $DIR
$SHOW_QUOTA_USER
test_14a() { # was test_14 b=12223 -- setting quota on root
TESTFILE="$DIR/$tdir/$tfile"
+ mkdir -p $DIR/$tdir
# out of root's file and block quota
$LFS setquota -u root 10 10 10 10 $DIR
check_and_setup_lustre
DIR=${DIR:-$MOUNT}
-[ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 99
+assert_DIR
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
test_22() {
WDIR=$DIR/$tdir
+ mkdir -p $WDIR
chown $RUNAS_ID $WDIR
(cd $WDIR || error "cd $WDIR failed";
$RUNAS tar cf - /etc/hosts /etc/sysconfig/network | \
# recursive symlinks (bug 7022)
test_26f() {
+ mkdir -p $DIR/$tdir
mkdir $DIR/$tdir/$tfile || error "mkdir $DIR/$tdir/$tfile failed"
cd $DIR/$tdir/$tfile || error "cd $DIR/$tdir/$tfile failed"
mkdir -p lndir/bar1 || error "mkdir lndir/bar1 failed"
run_test 42d "test complete truncate of file with cached dirty data"
test_43() {
+ mkdir -p $DIR/$tdir
cp -p /bin/ls $DIR/$tdir/$tfile
multiop $DIR/$tdir/$tfile Ow_c &
pid=$!
run_test 105c "lockf when mounted without -o flock test ========"
test_106() { #bug 10921
+ mkdir -p $DIR/$tdir
$DIR/$tdir && error "exec $DIR/$tdir succeeded"
chmod 777 $DIR/$tdir || error "chmod $DIR/$tdir failed"
}
run_test 119c "Testing for direct read hitting hole"
test_120a() {
+ mkdir -p $DIR/$tdir
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
lru_resize_disable mdc
run_test 120a "Early Lock Cancel: mkdir test"
test_120b() {
+ mkdir -p $DIR/$tdir
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
lru_resize_disable mdc
run_test 120b "Early Lock Cancel: create test"
test_120c() {
+ mkdir -p $DIR/$tdir
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
lru_resize_disable mdc
run_test 120c "Early Lock Cancel: link test"
test_120d() {
+ mkdir -p $DIR/$tdir
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
lru_resize_disable mdc
run_test 120d "Early Lock Cancel: setattr test"
test_120e() {
+ mkdir -p $DIR/$tdir
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
lru_resize_disable mdc
test_120f() {
[ -z "`lctl get_param -n mdc.*.connect_flags | grep early_lock_cancel`" ] && \
skip "no early lock cancel on server" && return 0
+ mkdir -p $DIR/$tdir
lru_resize_disable mdc
lru_resize_disable osc
mkdir -p $DIR/$tdir/d1 $DIR/$tdir/d2
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
+assert_DIR
rm -rf $DIR1/[df][0-9]* $DIR1/lnk
# $RUNAS_ID may get set incorrectly somewhere else
run_test 6 "remove of open file on other node =================="
test_7() {
- # run_one creates uniq $tdir (bug 13798)
- # opendirunlink failes if it exists
- rmdir $DIR1/$tdir || true
- opendirunlink $DIR1/$tdir $DIR2/$tdir || \
- error "opendirunlink $DIR1/$tdir $DIR2/$tdir"
+ local dir=d7
+ opendirunlink $DIR1/$dir $DIR2/$dir || \
+ error "opendirunlink $DIR1/$dir $DIR2/$dir"
}
run_test 7 "remove of open directory on other node ============="
[ `lctl get_param -n mdc.*-mdc-*.connect_flags | grep -c acl` -lt 2 ] && \
skip "must have acl, skipping" && return
+ mkdir -p $DIR1/$tdir
touch $DIR1/$tdir/f1 || error "touch $DIR1/$tdir/f1"
chmod 0755 $DIR1/$tdir/f1 || error "chmod 0755 $DIR1/$tdir/f1"
run_test 29 "lock put race between glimpse and enqueue ========="
test_30() { #bug #11110
+ mkdir -p $DIR1/$tdir
cp -f /bin/bash $DIR1/$tdir/bash
/bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
err=$($DIR1/$tdir/bash -c 'sleep 2; openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?')
[ $failed ] && exit 1 || true
}
+assert_DIR () {
+ local failed=""
+ [ -z "`echo :$DIR: | grep :$MOUNT:`" ] && \
+ failed=1 && echo "DIR not in $MOUNT. Aborting."
+ [ -z "`echo :$DIR1: | grep :$MOUNT1:`" ] && \
+ failed=1 && echo "DIR1 not in $MOUNT1. Aborting."
+ [ -z "`echo :$DIR2: | grep :$MOUNT2:`" ] && \
+ failed=1 && echo "DIR2 not in $MOUNT2. Aborting"
+
+ [ -n "$failed" ] && exit 99 || true
+}
+
usage() {
echo "usage: $0 [-r] [-f cfgfile]"
echo " -r: reformat"
}
run_test() {
+ assert_DIR
+
export base=`basetest $1`
if [ ! -z "$ONLY" ]; then
testname=ONLY_$1
export tdir=d0.${TESTSUITE}/d${base}
local SAVE_UMASK=`umask`
umask 0022
- mkdir -p $DIR/$tdir
BEFORE=`date +%s`
log "== test $testnum: $message ============ `date +%H:%M:%S` ($BEFORE)"
error "LBUG/LASSERT detected"
ps auxww | grep -v grep | grep -q multiop && error "multiop still running"
pass "($((`date +%s` - $BEFORE))s)"
- rmdir ${DIR}/$tdir >/dev/null 2>&1 || true
unset TESTNAME
unset tdir
umask $SAVE_UMASK