Whamcloud - gitweb
Call test_foo() functions directly instead of via run_one() so they do setup
[fs/lustre-release.git] / lustre / tests / sanity.sh
index f178aa2..538d819 100644 (file)
@@ -7,12 +7,14 @@
 set -e
 
 ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 1979
-ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"42b"}
+# bug number for skipped test: 
+ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""}
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
+[ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT"
+
 SRCDIR=`dirname $0`
-PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
+export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
 
 TMP=${TMP:-/tmp}
 
@@ -69,7 +71,9 @@ run_one() {
                $START
        fi
        log "== test $1: $2"
-       test_$1 || error "test_$1: $?"
+       export TESTNAME=test_$1
+       test_$1 || error "test_$1: exit with rc=$?"
+       unset TESTNAME
        pass
        cd $SAVE_PWD
        $CLEAN
@@ -127,7 +131,7 @@ run_test() {
 error() { 
        log "FAIL: $@"
        if [ "$SANITYLOG" ]; then
-               echo "FAIL: $@" >> $SANITYLOG
+               echo "FAIL: $TESTNAME $@" >> $SANITYLOG
        else
                exit 1
        fi
@@ -164,6 +168,10 @@ EXT2_DEV=${EXT2_DEV:-/tmp/SANITY.LOOP}
 touch $EXT2_DEV
 mke2fs -F $EXT2_DEV 1000 > /dev/null
 
+EXT3_DEV=${EXT3_DEV:-/tmp/SANITY_EXT3_DEV.LOOP}
+touch $EXT3_DEV
+mkfs.ext3 -F $EXT3_DEV 10000 > /dev/null
+
 test_0() {
        touch $DIR/f
        $CHECKSTAT -t file $DIR/f || error
@@ -607,6 +615,30 @@ test_24k() {
 }
 run_test 24k "touch .../R11a/f; mv .../R11a/f .../R11a/d ======="
 
+# bug 2429 - rename foo foo foo creates invalid file
+test_24l() {
+       f="$DIR/f24l"
+       multiop $f OcNs || error
+}
+run_test 24l "Renaming a file to itself ========================"
+
+test_24m() {
+       f="$DIR/f24m"
+       multiop $f OcLN ${f}2 ${f}2 || error
+}
+run_test 24m "Renaming a file to a hard link to itself ========="
+
+test_24n() {
+    f="$DIR/f24n"
+    # this stats the old file after it was renamed, so it should fail
+    touch ${f}
+    $CHECKSTAT ${f}
+    mv ${f} ${f}.rename
+    $CHECKSTAT ${f}.rename
+    $CHECKSTAT -a ${f}
+}
+run_test 24n "Statting the old file after renameing (Posix rename 2)"
+
 test_25a() {
        echo '== symlink sanity ============================================='
        mkdir $DIR/d25
@@ -616,9 +648,7 @@ test_25a() {
 run_test 25a "create file in symlinked directory ==============="
 
 test_25b() {
-       if [ ! -d $DIR/d25 ]; then
-               run_one 25a
-       fi
+       [ ! -d $DIR/d25 ] && test_25a
        $CHECKSTAT -t file $DIR/s25/foo || error
 }
 run_test 25b "lookup file in symlinked directory ==============="
@@ -655,9 +685,7 @@ test_26d() {
 run_test 26d "create multiple component recursive symlink ======"
 
 test_26e() {
-       if [ ! -h $DIR/d26-3 ]; then
-               run_one 26d
-       fi
+       [ ! -h $DIR/d26-3 ] && test_26d
        rm $DIR/d26-3
 }
 run_test 26e "unlink multiple component recursive symlink ======"
@@ -665,7 +693,7 @@ run_test 26e "unlink multiple component recursive symlink ======"
 test_27a() {
        echo '== stripe sanity =============================================='
        mkdir $DIR/d27
-       $LSTRIPE $DIR/d27/f0 8192 0 1 || error
+       $LSTRIPE $DIR/d27/f0 65536 0 1 || error
        $CHECKSTAT -t file $DIR/d27/f0 || error
        pass
        log "== test_27b: write to one stripe file ========================="
@@ -678,7 +706,7 @@ test_27c() {
        if [ ! -d $DIR/d27 ]; then
                mkdir $DIR/d27
        fi
-       $LSTRIPE $DIR/d27/f01 8192 0 2 || error
+       $LSTRIPE $DIR/d27/f01 65536 0 2 || error
        [ `$LFIND $DIR/d27/f01 | grep -A 10 obdidx | wc -l` -eq 4 ] ||
                error "two-stripe file doesn't have two stripes"
        pass
@@ -701,8 +729,8 @@ test_27e() {
        if [ ! -d $DIR/d27 ]; then
                mkdir $DIR/d27
        fi
-       $LSTRIPE $DIR/d27/f12 8192 0 2 || error
-       $LSTRIPE $DIR/d27/f12 8192 0 2 && error
+       $LSTRIPE $DIR/d27/f12 65536 0 2 || error
+       $LSTRIPE $DIR/d27/f12 65536 0 2 && error
        $CHECKSTAT -t file $DIR/d27/f12 || error
 }
 run_test 27e "lstripe existing file (should return error) ======"
@@ -724,11 +752,11 @@ test_27g() {
        $MCREATE $DIR/d27/fnone || error
        pass
        log "== test 27h: lfind with no objects ============================"
-       $LFIND $DIR/d27/fnone 2>&1 | grep -q "no stripe info" || error
+       $LFIND $DIR/d27/fnone 2>&1 | grep "no stripe info" || error
        pass
        log "== test 27i: lfind with some objects =========================="
        touch $DIR/d27/fsome || error
-       $LFIND $DIR/d27/fsome | grep -q obdidx || error
+       $LFIND $DIR/d27/fsome | grep obdidx || error
 }
 run_test 27g "test lfind ======================================="
 
@@ -736,10 +764,23 @@ test_27j() {
         if [ ! -d $DIR/d27 ]; then
                 mkdir $DIR/d27
         fi
-        $LSTRIPE $DIR/d27/f27j 8192 $STRIPECOUNT 1 && error || true
+        $LSTRIPE $DIR/d27/f27j 65536 $STRIPECOUNT 1 && error || true
 }
 run_test 27j "lstripe with bad stripe offset (should return error)"
 
+test_27k() { # bug 2844
+       FILE=$DIR/d27/f27k
+       LL_MAX_BLKSIZE=$((4 * 1024 * 1024))
+       [ ! -d $DIR/d27 ] && mkdir -p $DIR/d27
+       $LSTRIPE $FILE 67108864 -1 0 || error "lstripe failed"
+       BLKSIZE=`stat $FILE | awk '/IO Block:/ { print $7 }'`
+       [ $BLKSIZE -le $LL_MAX_BLKSIZE ] || error "$BLKSIZE > $LL_MAX_BLKSIZE"
+       dd if=/dev/zero of=$FILE bs=4k count=1
+       BLKSIZE=`stat $FILE | awk '/IO Block:/ { print $7 }'`
+       [ $BLKSIZE -le $LL_MAX_BLKSIZE ] || error "$BLKSIZE > $LL_MAX_BLKSIZE"
+}
+run_test 27k "limit i_blksize for broken user apps ============="
+
 test_28() {
        mkdir $DIR/d28
        $CREATETEST $DIR/d28/ct || error
@@ -1013,20 +1054,20 @@ test_32q() {
        mkdir -p $DIR/d32q
         touch $DIR/d32q/under_the_mount
        mount -t ext2 -o loop $EXT2_DEV $DIR/d32q
-       ls $DIR/d32q/under_the_mount &&  error || true
+       ls $DIR/d32q/under_the_mount && error || true
        umount $DIR/d32q || error
 }
-run_test 32q "stat follows mountpoints in Lustre ========================="
+run_test 32q "stat follows mountpoints in Lustre (should return error)"
 
 test_32r() {
        [ -e $DIR/d32r ] && rm -fr $DIR/d32r
        mkdir -p $DIR/d32r
         touch $DIR/d32r/under_the_mount
        mount -t ext2 -o loop $EXT2_DEV $DIR/d32r
-       ls $DIR/d32r | grep -q under_the_mount &&  error || true
+       ls $DIR/d32r | grep -q under_the_mount && error || true
        umount $DIR/d32r || error
 }
-run_test 32r "opendir follows mountpoints in Lustre ========================="
+run_test 32r "opendir follows mountpoints in Lustre (should return error)"
 
 #   chmod 444 /mnt/lustre/somefile
 #   open(/mnt/lustre/somefile, O_RDWR)
@@ -1041,95 +1082,103 @@ test_33() {
         log 33_2
 }
 run_test 33 "write file with mode 444 (should return error) ===="
+                                                                                                                                               
+test_33a() {
+        rm -fr $DIR/d33
+        mkdir -p $DIR/d33
+        chown $RUNAS_ID $DIR/d33
+        $RUNAS $OPENFILE -f O_RDWR:O_CREAT -m 0444 $DIR/d33/f33 || error
+        $RUNAS $OPENFILE -f O_RDWR:O_CREAT -m 0444 $DIR/d33/f33 && error || true
+}
+run_test 33a "test open file(mode=0444) with O_RDWR (should return error)"
 
 TEST_34_SIZE=${TEST_34_SIZE:-2000000000000}
 test_34a() {
-       rm -f $DIR/test_34_file
-       $MCREATE $DIR/test_34_file || error
-       $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
-       $TRUNCATE $DIR/test_34_file $TEST_34_SIZE || error
-       $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
+       rm -f $DIR/f34
+       $MCREATE $DIR/f34 || error
+       $LFIND $DIR/f34 2>&1 | grep -q "no stripe info" || error
+       $TRUNCATE $DIR/f34 $TEST_34_SIZE || error
+       $LFIND $DIR/f34 2>&1 | grep -q "no stripe info" || error
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
 }
 run_test 34a "truncate file that has not been opened ==========="
 
 test_34b() {
-       [ ! -f $DIR/test_34_file ] && run_one 34a
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
-       $OPENFILE -f O_RDONLY $DIR/test_34_file
-       $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
+       [ ! -f $DIR/f34 ] && test_34a
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
+       $OPENFILE -f O_RDONLY $DIR/f34
+       $LFIND $DIR/f34 2>&1 | grep -q "no stripe info" || error
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
 }
 run_test 34b "O_RDONLY opening file doesn't create objects ====="
 
 test_34c() {
-       [ ! -f $DIR/test_34_file ] && run_one 34a 
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
-       $OPENFILE -f O_RDWR $DIR/test_34_file
-       $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" && error
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
+       [ ! -f $DIR/f34 ] && test_34a 
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
+       $OPENFILE -f O_RDWR $DIR/f34
+       $LFIND $DIR/f34 2>&1 | grep -q "no stripe info" && error
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
 }
 run_test 34c "O_RDWR opening file-with-size works =============="
 
 test_34d() {
-       dd if=/dev/zero of=$DIR/test_34_file conv=notrunc bs=4k count=1 || error
-       $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
-       rm $DIR/test_34_file
+       dd if=/dev/zero of=$DIR/f34 conv=notrunc bs=4k count=1 || error
+       $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
+       rm $DIR/f34
 }
 run_test 34d "write to sparse file ============================="
 
 test_34e() {
-       rm -f $DIR/test_34_file
-       $MCREATE $DIR/test_34_file || error
-       $TRUNCATE $DIR/test_34_file 1000 || error
-       $CHECKSTAT -s 1000 $DIR/test_34_file || error
-       $OPENFILE -f O_RDWR $DIR/test_34_file
-       $CHECKSTAT -s 1000 $DIR/test_34_file || error
+       rm -f $DIR/f34e
+       $MCREATE $DIR/f34e || error
+       $TRUNCATE $DIR/f34e 1000 || error
+       $CHECKSTAT -s 1000 $DIR/f34e || error
+       $OPENFILE -f O_RDWR $DIR/f34e
+       $CHECKSTAT -s 1000 $DIR/f34e || error
 }
 run_test 34e "create objects, some with size and some without =="
 
 test_35a() {
-       cp /bin/sh $DIR/test_35a_file
-       chmod 444 $DIR/test_35a_file
-       chown $RUNAS_ID $DIR/test_35a_file
-       $RUNAS $DIR/test_35a_file && error || true
-       rm $DIR/test_35a_file
+       cp /bin/sh $DIR/f35a
+       chmod 444 $DIR/f35a
+       chown $RUNAS_ID $DIR/f35a
+       $RUNAS $DIR/f35a && error || true
+       rm $DIR/f35a
 }
 run_test 35a "exec file with mode 444 (should return and not leak) ====="
 
-
 test_36a() {
-       rm -f $DIR/test_36_file
-       utime $DIR/test_36_file || error
+       rm -f $DIR/f36
+       utime $DIR/f36 || error
 }
 run_test 36a "MDS utime check (mknod, utime) ==================="
 
 test_36b() {
-       echo "" > $DIR/test_36_file
-       utime $DIR/test_36_file || error
+       echo "" > $DIR/f36
+       utime $DIR/f36 || error
 }
 run_test 36b "OST utime check (open, utime) ===================="
 
 test_36c() {
-       rm -f $DIR/d36/test_36_file
+       rm -f $DIR/d36/f36
        mkdir $DIR/d36
        chown $RUNAS_ID $DIR/d36
-       $RUNAS utime $DIR/d36/test_36_file || error
+       $RUNAS utime $DIR/d36/f36 || error
 }
 run_test 36c "non-root MDS utime check (mknod, utime) =========="
 
 test_36d() {
-       [ ! -d $DIR/d36 ] && run_one 36c
-       echo "" > $DIR/d36/test_36_file
-       $RUNAS utime $DIR/d36/test_36_file || error
+       [ ! -d $DIR/d36 ] && test_36c
+       echo "" > $DIR/d36/f36
+       $RUNAS utime $DIR/d36/f36 || error
 }
 run_test 36d "non-root OST utime check (open, utime) ==========="
 
 test_36e() {
        [ $RUNAS_ID -eq $UID ] && return
        [ ! -d $DIR/d36 ] && mkdir $DIR/d36
-       touch $DIR/d36/test_36_file2
-       $RUNAS utime $DIR/d36/test_36_file2 && error || true
+       touch $DIR/d36/f36e
+       $RUNAS utime $DIR/d36/f36e && error "utime worked, want failure" || true
 }
 run_test 36e "utime on non-owned file (should return error) ===="
 
@@ -1190,16 +1239,23 @@ stop_kupdated() {
        trap start_kupdated EXIT
 }
 
+# ensure that all stripes have some grant before we test client-side cache
+for i in `seq -f $DIR/f42-%g 1 $STRIPECOUNT`; do
+       dd if=/dev/zero of=$i bs=4k count=1
+       rm $i
+done
+
 # Tests 42* verify that our behaviour is correct WRT caching, file closure,
 # file truncation, and file removal.
 test_42a() {
        cancel_lru_locks OSC
        stop_kupdated
-        sync # just to be safe
-        BEFOREWRITES=`count_ost_writes`
-        dd if=/dev/zero of=$DIR/f42a bs=1024 count=100
-        AFTERWRITES=`count_ost_writes`
-        [ $BEFOREWRITES -eq $AFTERWRITES ] || \
+       sync; sleep 1; sync # just to be safe
+       BEFOREWRITES=`count_ost_writes`
+       grep [0-9] /proc/fs/lustre/osc/OSC*MNT*/cur_grant_bytes
+       dd if=/dev/zero of=$DIR/f42a bs=1024 count=100
+       AFTERWRITES=`count_ost_writes`
+       [ $BEFOREWRITES -eq $AFTERWRITES ] || \
                error "$BEFOREWRITES < $AFTERWRITES"
        start_kupdated
 }
@@ -1236,7 +1292,7 @@ run_test 42b "test destroy of file with cached dirty data ======"
 # any number of fixes (don't get {0,EOF} on open, match
 # composite locks, do smarter file size management) fix
 # this, but for now we want these tests to verify that
-# the cancelation with truncate intent works, so we
+# the cancellation with truncate intent works, so we
 # start the file with a full-file pw lock to match against
 # until the truncate.
 trunc_test() {
@@ -1264,7 +1320,7 @@ test_42c() {
             error "$BEFOREWRITES < $AFTERWRITES on truncate"
         rm $file
 }
-run_test 42c "test partial truncate of file with cached dirty data ===="
+run_test 42c "test partial truncate of file with cached dirty data"
 
 test_42d() {
         trunc_test 42d 0
@@ -1272,51 +1328,49 @@ test_42d() {
             error "beforewrites $BEFOREWRITES != afterwrites $AFTERWRITES on truncate"
         rm $file
 }
-run_test 42d "test complete truncate of file with cached dirty data ===="
+run_test 42d "test complete truncate of file with cached dirty data"
 
 test_43() {
        mkdir $DIR/d43
        cp -p /bin/ls $DIR/d43/f
-       exec 100>> $DIR/d43/f   
+       exec 100>> $DIR/d43/f
        $DIR/d43/f && error || true
        exec 100<&-
 }
-run_test 43 "execution of file opened for write should return -ETXTBSY=="
+run_test 43 "execution of file opened for write should return -ETXTBSY"
 
 test_43a() {
         mkdir -p $DIR/d43
        cp -p `which multiop` $DIR/d43/multiop
-        touch $DIR/d43/g
-        $DIR/d43/multiop $DIR/d43/g o_c &
+        $DIR/d43/multiop $TMP/test43.junk O_c &
         MULTIPID=$!
         sleep 1
         multiop $DIR/d43/multiop Oc && error "expected error, got success"
         kill -USR1 $MULTIPID || return 2
         wait $MULTIPID || return 3
 }
-run_test 43a "open(RDWR) of file being executed should return -ETXTBSY=="
+run_test 43a "open(RDWR) of file being executed should return -ETXTBSY"
 
 test_43b() {
         mkdir -p $DIR/d43
        cp -p `which multiop` $DIR/d43/multiop
-        touch $DIR/d43/g
-        $DIR/d43/multiop $DIR/d43/g o_c &
+        $DIR/d43/multiop $TMP/test43.junk O_c &
         MULTIPID=$!
         sleep 1
         truncate $DIR/d43/multiop 0 && error "expected error, got success"
         kill -USR1 $MULTIPID || return 2
         wait $MULTIPID || return 3
 }
-run_test 43b "truncate of file being executed should return -ETXTBSY===="
+run_test 43b "truncate of file being executed should return -ETXTBSY"
 
 test_43c() {
-       local testdir="$DIR/43a"
+       local testdir="$DIR/d43c"
        mkdir -p $testdir
        cp $SHELL $testdir/
-       ( cd $(dirname $SHELL) && md5sum $(basename $SHELL) ) |  \
+       ( cd $(dirname $SHELL) && md5sum $(basename $SHELL) ) | \
                ( cd $testdir && md5sum -c)
 }
-run_test 43c "md5sum of copy into lustre================================"
+run_test 43c "md5sum of copy into lustre========================"
 
 test_44() {
        [  "$STRIPECOUNT" -lt "2" ] && echo "skipping 2-stripe test" && return
@@ -1337,20 +1391,20 @@ test_44a() {
     OFFSETS="0 $((stride/2)) $((stride-1))"
     for offset in $OFFSETS ; do
       for i in `seq 0 $((nstripe-1))`; do
-        rm -f $DIR/44a
+        rm -f $DIR/d44a
         local GLOBALOFFSETS=""
         local size=$((((i + 2 * $nstripe )*$stride + $offset)))  # Bytes
-        ll_sparseness_write $DIR/44a $size  || error "ll_sparseness_write"
+        ll_sparseness_write $DIR/d44a $size  || error "ll_sparseness_write"
         GLOBALOFFSETS="$GLOBALOFFSETS $size"
-        ll_sparseness_verify $DIR/44a $GLOBALOFFSETS \
+        ll_sparseness_verify $DIR/d44a $GLOBALOFFSETS \
                             || error "ll_sparseness_verify $GLOBALOFFSETS"
 
         for j in `seq 0 $((nstripe-1))`; do
             size=$((((j + $nstripe )*$stride + $offset)))  # Bytes
-            ll_sparseness_write $DIR/44a $size || error "ll_sparseness_write"
+            ll_sparseness_write $DIR/d44a $size || error "ll_sparseness_write"
             GLOBALOFFSETS="$GLOBALOFFSETS $size"
         done
-        ll_sparseness_verify $DIR/44a $GLOBALOFFSETS \
+        ll_sparseness_verify $DIR/d44a $GLOBALOFFSETS \
                             || error "ll_sparseness_verify $GLOBALOFFSETS"
       done
     done
@@ -1372,7 +1426,7 @@ do_dirty_record() {
        echo before $before, after $after
 }
 test_45() {
-       f="$DIR/45"
+       f="$DIR/f45"
        # Obtain grants from OST if it supports it
        echo blah > ${f}_grant
        stop_kupdated
@@ -1388,7 +1442,7 @@ test_45() {
        do_dirty_record "echo blah > $f"
        [ $before -eq $after ] && error "write wasn't cached"
        do_dirty_record "cancel_lru_locks OSC"
-       [ $before -gt $after ] || error "lock cancelation didn't lower dirty count"
+       [ $before -gt $after ] || error "lock cancellation didn't lower dirty count"
        start_kupdated
 }
 run_test 45 "osc io page accounting ============================"
@@ -1402,7 +1456,7 @@ page_size() {
 # objects offset and an assert hit when an rpc was built with 63's mapped 
 # offset 31 and 31's raw 31 offset. it also found general redirtying bugs.
 test_46() {
-       f="$DIR/46"
+       f="$DIR/f46"
        stop_kupdated
        sync
        dd if=/dev/zero of=$f bs=`page_size` seek=31 count=1
@@ -1427,7 +1481,7 @@ test_48() {
         mkdir $DIR/d48 || error "recreate diectory failed"
         ls || error "can't list after recreate directory"
 }
-run_test 48 "Access renamed current working directory ========="
+run_test 48 "Access renamed current working directory =========="
 
 test_50() {
        # bug 1485
@@ -1470,7 +1524,7 @@ test_52a() {
 
        rm -fr $DIR/d52a || error
 }
-run_test 52a "append-only flag test ============================"
+run_test 52a "append-only flag test (should return errors) ====="
 
 test_52b() {
        [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
@@ -1490,10 +1544,10 @@ test_52b() {
 
        rm -fr $DIR/d52b || error
 }
-run_test 52b "immutable flag test =============================="
+run_test 52b "immutable flag test (should return errors) ======="
 
 test_53() {
-        for i in /proc/fs/lustre/osc/OSC*mds1 ; do
+        for i in `ls -d /proc/fs/lustre/osc/OSC*mds1 2> /dev/null` ; do
                 ostname=`echo $i | cut -d _ -f 3-4 | sed -e s/_mds1//`
                 ost_last=`cat /proc/fs/lustre/obdfilter/$ostname/last_id`
                 mds_last=`cat $i/prealloc_last_id`
@@ -1503,7 +1557,7 @@ test_53() {
                 fi
         done
 }
-run_test 53 "verify that MDS and OSTs agree on pre-creation====="
+run_test 53 "verify that MDS and OSTs agree on pre-creation ===="
 
 test_54() {
        $SOCKETSERVER $DIR/socket &
@@ -1513,6 +1567,126 @@ test_54() {
 }
 run_test 54 "unix damain socket test ==========================="
 
+test_55() {
+        rm -rf $DIR/d55
+        mkdir $DIR/d55
+        mount -t ext3 -o loop,iopen $EXT3_DEV $DIR/d55 || error
+        touch $DIR/d55/foo
+        $IOPENTEST1 $DIR/d55/foo $DIR/d55 || error
+        $IOPENTEST2 $DIR/d55 || error
+        echo "check for $EXT3_DEV. Please wait..."
+        rm -rf $DIR/d55/*
+        umount $DIR/d55 || error
+}
+run_test 55 "check iopen_connect_dentry()======================="
+
+test_56() {
+        rm -rf $DIR/d56
+        mkdir $DIR/d56
+        mkdir $DIR/d56/dir
+        NUMFILES=3
+        NUMFILESx2=$(($NUMFILES * 2))
+        for i in `seq 1 $NUMFILES` ; do
+                touch $DIR/d56/file$i
+                touch $DIR/d56/dir/file$i
+        done
+
+        # test lfs find with --recursive
+        FILENUM=`$LFIND --recursive $DIR/d56 | grep -c obdidx`
+        [ $FILENUM -eq $NUMFILESx2 ] || error \
+                "lfs find --recursive $DIR/d56 wrong: found $FILENUM, expected $NUMFILESx2"
+        FILENUM=`$LFIND $DIR/d56 | grep -c obdidx`
+        [ $FILENUM -eq $NUMFILES ] || error \
+                "lfs find $DIR/d56 without --recursive wrong: found $FILENUM,
+               expected $NUMFILES"
+        echo "lfs find --recursive passed."
+
+        # test lfs find with file instead of dir
+        FILENUM=`$LFIND $DIR/d56/file1 | grep -c obdidx`
+        [ $FILENUM  -eq 1 ] || error \
+                 "lfs find $DIR/d56/file1 wrong:found $FILENUM, expected 1"
+        echo "lfs find file passed."
+
+        #test lfs find with --verbose
+        [ `$LFIND --verbose $DIR/d56 | grep -c lmm_magic` -eq $NUMFILES ] ||\
+                error "lfs find --verbose $DIR/d56 wrong: should find $NUMFILES lmm_magic info"
+        [ `$LFIND $DIR/d56 | grep -c lmm_magic` -eq 0 ] || error \
+                "lfs find $DIR/d56 without --verbose wrong: should not show lmm_magic info"
+        echo "lfs find --verbose passed."
+
+        #test lfs find with --obd
+        $LFIND --obd wrong_uuid $DIR/d56 2>&1 | grep -q "unknown obduuid" || \
+                error "lfs find --obd wrong_uuid should return error information"
+
+        [  "$STRIPECOUNT" -lt 2 ] && \
+                echo "skipping other lfs find --obd test" && return
+        FILENUM=`$LFIND --recursive $DIR/d56 | sed -n '/^[      ]*1[    ]/p' | wc -l`
+        OBDUUID=`$LFIND --recursive $DIR/d56 | sed -n '/^[      ]*1:/p' | awk '{print $2}'`
+        FOUND=`$LFIND -r --obd $OBDUUID $DIR/d56 | wc -l`
+        [ $FOUND -eq $FILENUM ] || \
+                error "lfs find --obd wrong: found $FOUND, expected $FILENUM"
+        [ `$LFIND -r -v --obd $OBDUUID $DIR/d56 | sed '/^[      ]*1[    ]/d' | \
+                sed -n '/^[     ]*[0-9][0-9]*[  ]/p' | wc -l` -eq 0 ] || \
+                error "lfs find --obd wrong: should not show file on other obd"
+        echo "lfs find --obd passed."
+}
+run_test 56 "check lfs find ===================================="
+
+test_57a() {
+       # note test will not do anything if MDS is not local
+       for DEV in `cat /proc/fs/lustre/mds/*/mntdev`; do
+               dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV"
+               DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump`
+               [ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE"
+               rm $TMP/t57a.dump
+       done
+}
+run_test 57a "verify MDS filesystem created with large inodes =="
+
+test_57b() {
+       FILECOUNT=100
+       FILE1=$DIR/d57b/f1
+       FILEN=$DIR/d57b/f$FILECOUNT
+       rm -rf $DIR/d57b || error "removing $DIR/d57b"
+       mkdir -p $DIR/d57b || error "creating $DIR/d57b"
+       echo "mcreating $FILECOUNT files"
+       createmany -m $DIR/d57b/f 1 $FILECOUNT || \
+               error "creating files in $DIR/d57b"
+
+       # verify that files do not have EAs yet
+       $LFIND $FILE1 2>&1 | grep -q "no stripe" || error "$FILE1 has an EA"
+       $LFIND $FILEN 2>&1 | grep -q "no stripe" || error "$FILEN has an EA"
+
+       MDSFREE="`cat /proc/fs/lustre/mds/*/kbytesfree`"
+       MDCFREE="`cat /proc/fs/lustre/mdc/*/kbytesfree`"
+       echo "opening files to create objects/EAs"
+       for FILE in `seq -f $DIR/d57b/f%g 1 $FILECOUNT`; do
+               $OPENFILE -f O_RDWR $FILE > /dev/null || error "opening $FILE"
+       done
+
+       # verify that files have EAs now
+       $LFIND $FILE1 | grep -q "obdidx" || error "$FILE1 missing EA"
+       $LFIND $FILEN | grep -q "obdidx" || error "$FILEN missing EA"
+
+       MDSFREE2="`cat /proc/fs/lustre/mds/*/kbytesfree`"
+       MDCFREE2="`cat /proc/fs/lustre/mdc/*/kbytesfree`"
+       if [ "$MDCFREE" != "$MDCFREE2" ]; then
+               if [ "$MDSFREE" != "$MDSFREE2" ]; then
+                       error "MDC before $MDCFREE != after $MDCFREE2"
+               else
+                       echo "MDC before $MDCFREE != after $MDCFREE2"
+                       echo "unable to confirm if MDS has large inodes"
+               fi
+       fi
+       rm -rf $DIR/d57b
+}
+run_test 57b "default LOV EAs are stored inside large inodes ==="
+
+test_58() {
+       wiretest
+}
+run_test 58 "verify cross-platform wire constants =============="
+
 test_59() {
        echo "touch 130 files"
        for i in `seq 1 130` ; do
@@ -1526,7 +1700,7 @@ test_59() {
        sleep 2
         # wait for commitment of removal
 }
-run_test 59 "verify cancellation of llog records async=========="
+run_test 59 "verify cancellation of llog records async ========="
 
 test_60() {
        echo 60 "llog tests run from kernel mode"
@@ -1541,7 +1715,7 @@ test_61() {
        multiop $f OSMWUc || error
        sync
 }
-run_test 61 "mmap() writes don't make sync hang =========="
+run_test 61 "mmap() writes don't make sync hang ================"
 
 # bug 2330 - insufficient obd_match error checking causes LBUG
 test_62() {
@@ -1549,20 +1723,19 @@ test_62() {
         echo foo > $f
         cancel_lru_locks OSC
         echo 0x405 > /proc/sys/lustre/fail_loc
-        cat $f && error # expect -EIO
-        multiop $f Owc && error
+        cat $f && error "cat succeeded, expect -EIO"
         echo 0 > /proc/sys/lustre/fail_loc
 }
 run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)"
 
-# bug 2319 - osic_wait() interrupted causes crash because of invalid waitq.
+# bug 2319 - oig_wait() interrupted causes crash because of invalid waitq.
 test_63() {
        MAX_DIRTY_MB=`cat /proc/fs/lustre/osc/*/max_dirty_mb | head -1`
        for i in /proc/fs/lustre/osc/*/max_dirty_mb ; do
-       echo 0 > $i
+               echo 0 > $i
        done
        for i in `seq 10` ; do
-               dd if=/dev/zero of=$DIR/syncwrite_testfile bs=8k &
+               dd if=/dev/zero of=$DIR/f63 bs=8k &
                sleep 5
                kill $!
                sleep 1
@@ -1573,7 +1746,18 @@ test_63() {
        done
        true
 }
-run_test 63 "Verify osic_wait interruption does not crash"
+run_test 63 "Verify oig_wait interruption does not crash ======"
+
+test_64a () {
+       df $DIR
+       grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/cur*
+}
+run_test 64a "verify filter grant calculations (in kernel) ======"
+
+test_64b () {
+       sh oos.sh $MOUNT
+}
+run_test 64b "check out-of-space detection on client ============"
 
 # on the LLNL clusters, runas will still pick up root's $TMP settings,
 # which will not be writable for the runas user, and then you get a CVS
@@ -1587,7 +1771,6 @@ OLDHOME=$HOME
 [ $RUNAS_ID -ne $UID ] && HOME=/tmp
 
 test_99a() {
-       echo 99 "cvs operations ===================================="
        mkdir -p $DIR/d99cvsroot
        chown $RUNAS_ID $DIR/d99cvsroot
        $RUNAS cvs -d $DIR/d99cvsroot init || error
@@ -1595,14 +1778,14 @@ test_99a() {
 run_test 99a "cvs init ========================================="
 
 test_99b() {
-       [ ! -d $DIR/d99cvsroot ] && run_one 99a
+       [ ! -d $DIR/d99cvsroot ] && test_99a
        cd /etc/init.d
        $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" d99reposname vtag rtag
 }
 run_test 99b "cvs import ======================================="
 
 test_99c() {
-       [ ! -d $DIR/d99cvsroot ] && run_one 99b
+       [ ! -d $DIR/d99cvsroot ] && test_99b
        cd $DIR
        mkdir -p $DIR/d99reposname
        chown $RUNAS_ID $DIR/d99reposname
@@ -1611,7 +1794,7 @@ test_99c() {
 run_test 99c "cvs checkout ====================================="
 
 test_99d() {
-       [ ! -d $DIR/d99cvsroot ] && run_one 99c
+       [ ! -d $DIR/d99cvsroot ] && test_99c
        cd $DIR/d99reposname
        $RUNAS touch foo99
        $RUNAS cvs add -m 'addmsg' foo99
@@ -1619,14 +1802,14 @@ test_99d() {
 run_test 99d "cvs add =========================================="
 
 test_99e() {
-       [ ! -d $DIR/d99cvsroot ] && run_one 99c
+       [ ! -d $DIR/d99cvsroot ] && test_99c
        cd $DIR/d99reposname
        $RUNAS cvs update
 }
 run_test 99e "cvs update ======================================="
 
 test_99f() {
-       [ ! -d $DIR/d99cvsroot ] && run_one 99d
+       [ ! -d $DIR/d99cvsroot ] && test_99d
        cd $DIR/d99reposname
        $RUNAS cvs commit -m 'nomsg' foo99
 }
@@ -1637,9 +1820,11 @@ TMP=$OLDTMP
 HOME=$OLDHOME
 
 log "cleanup: ======================================================"
-if [ "$I_MOUNTED" = "yes" -a "`mount | grep ^$NAME`" ]; then
+if [ "`mount | grep ^$NAME`" ]; then
        rm -rf $DIR/[Rdfs][1-9]*
-       sh llmountcleanup.sh || error
+       if [ "$I_MOUNTED" = "yes" ]; then
+               sh llmountcleanup.sh || error
+       fi
 fi
 
 echo '=========================== finished ==============================='