Whamcloud - gitweb
b=14512
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 4a2b57a..6014d52 100755 (executable)
@@ -5,6 +5,10 @@ set -e
 #         bug  5494 7288 5493
 ALWAYS_EXCEPT="24   27   52 $RECOVERY_SMALL_EXCEPT"
 
+# also long tests: 19, 21a, 21e, 21f, 23, 27                           
+#                                     1     2.5    4    4          (min)"  
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="17    26b    50   51     57" 
+
 PTLDEBUG=${PTLDEBUG:--1}
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
@@ -15,32 +19,12 @@ build_test_filter
 
 # Allow us to override the setup if we already have a mounted system by
 # setting SETUP=" " and CLEANUP=" "
-SETUP=${SETUP:-"setup"}
-CLEANUP=${CLEANUP:-"cleanup"}
-
-setup() {
-    [ "$REFORMAT" ] && formatall
-    setupall
-}
-
-cleanup() {
-       cleanupall || { echo "FAILed to clean up"; exit 20; }
-}
-
-if [ ! -z "$EVAL" ]; then
-    eval "$EVAL"
-    exit $?
-fi
+SETUP=${SETUP:-""}
+CLEANUP=${CLEANUP:-""}
 
-if [ "$ONLY" == "cleanup" ]; then
-    sysctl -w lnet.debug=0 || true
-    cleanup
-    exit
-fi
-
-$SETUP
-
-[ "$ONLY" == "setup" ] && exit
+cleanup_and_setup_lustre
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
 
 test_1() {
     drop_request "mcreate $MOUNT/1"  || return 1
@@ -237,7 +221,7 @@ test_18a() {
     pgcache_empty || return 1
 
     # 1 stripe on ost2
-    lfs setstripe $f $((128 * 1024)) 1 1
+    lfs setstripe $f -s $((128 * 1024)) -i 1 -c 1
 
     do_facet client cp /etc/termcap $f
     sync
@@ -262,8 +246,8 @@ test_18b() {
     pgcache_empty || return 1
 
     # shouldn't have to set stripe size of count==1
-    lfs setstripe $f $((128 * 1024)) 0 1
-    lfs setstripe $f2 $((128 * 1024)) 0 1
+    lfs setstripe $f -s $((128 * 1024)) -i 0 -c 1
+    lfs setstripe $f2 -s $((128 * 1024)) -i 0 -c 1
 
     do_facet client cp /etc/termcap $f
     sync
@@ -572,7 +556,7 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it
        rc=$?
        sysctl -w lustre.fail_loc=0x0
        client_reconnect
-       [ $rc -eq 0 ] && error "multiop didn't fail fsync: rc $rc" || true
+       [ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true
 }
 run_test 24 "fsync error (should return error)"
 
@@ -603,6 +587,7 @@ run_test 26 "evict dead exports"
 test_26b() {      # bug 10140 - evict dead exports by pinger
        client_df
         zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2"
+        sleep 1 # wait connections being established
        MDS_FILE=$LPROC/mdt/${mds1_svc}/num_exports
         MDS_NEXP1="`do_facet $SINGLEMDS cat $MDS_FILE | cut -d' ' -f2`"
        OST_FILE=$LPROC/obdfilter/${ost1_svc}/num_exports
@@ -680,7 +665,7 @@ test_50() {
        rc=$?
        echo writemany returned $rc
        #these may fail because of eviction due to slow AST response.
-       return $rc
+       [ $rc -eq 0 ] || error_ignore 13652 "writemany returned rc $rc" || true
 }
 run_test 50 "failover MDS under load"
 
@@ -708,7 +693,7 @@ test_51() {
        wait $CLIENT_PID 
        rc=$?
        echo writemany returned $rc
-       return $rc
+       [ $rc -eq 0 ] || error_ignore 13652 "writemany returned rc $rc" || true
 }
 run_test 51 "failover MDS during recovery"
 
@@ -750,7 +735,7 @@ run_test 52 "failover OST under load"
 # test of open reconstruct
 test_53() {
        touch $DIR/$tfile
-       drop_ldlm_reply "./openfile -f O_RDWR:O_CREAT -m 0755 $DIR/$tfile" ||\
+       drop_ldlm_reply "openfile -f O_RDWR:O_CREAT -m 0755 $DIR/$tfile" ||\
                return 2
 }
 run_test 53 "touch: drop rep"
@@ -876,6 +861,19 @@ test_58() { # bug 11546
 }
 run_test 58 "Eviction in the middle of open RPC reply processing"
 
+test_59() { # bug 10589
+       zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2"
+#define OBD_FAIL_LDLM_CANCEL_EVICT_RACE  0x311
+       sysctl -w lustre.fail_loc=0x311
+       writes=`dd if=/dev/zero of=$DIR2/$tfile count=1 2>&1 | awk 'BEGIN { FS="+" } /out/ {print $1}'`
+       sysctl -w lustre.fail_loc=0
+       sync
+       zconf_umount `hostname` $DIR2 -f
+       reads=`dd if=$DIR/$tfile of=/dev/null 2>&1 | awk 'BEGIN { FS="+" } /in/ {print $1}'`
+       [ $reads -eq $writes ] || error "read" $reads "blocks, must be" $writes
+}
+run_test 59 "Read cancel race on client eviction"
+
 equals_msg `basename $0`: test complete, cleaning up
-$CLEANUP
+check_and_cleanup_lustre
 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true