Whamcloud - gitweb
Land b_smallfix onto HEAD (20040223_1817)
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 35ab934..1d4d976 100755 (executable)
@@ -3,6 +3,7 @@
 set -e
 
 LUSTRE=${LUSTRE:-`dirname $0`/..}
+UPCALL=${UPCALL:-$PWD/recovery-small-upcall.sh}
 . $LUSTRE/tests/test-framework.sh
 
 init_test_env $@
@@ -34,11 +35,11 @@ setup() {
     start ost2 --reformat $OSTLCONFARGS 
     [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
     start mds $MDSLCONFARGS --reformat
-    zconf_mount $MOUNT
+    zconf_mount `hostname`  $MOUNT
 }
 
 cleanup() {
-    zconf_umount $MOUNT
+    zconf_umount `hostname` $MOUNT
     stop mds ${FORCE} $MDSLCONFARGS
     stop ost2 ${FORCE} --dump cleanup.log
     stop ost ${FORCE} --dump cleanup.log
@@ -147,8 +148,53 @@ test_11(){
     drop_bl_callback multiop $MOUNT/$tfile Ow  || 
         echo "client evicted, as expected"
 
-    do_facet client unlink $MOUNT/$tfile  || return 4
+    do_facet client munlink $MOUNT/$tfile  || return 4
 }
 run_test 11 "wake up a thead waiting for completion after eviction (b=2460)"
+
+#b=2494
+test_12(){
+    $LCTL mark multiop $MOUNT/$tfile OS_c 
+    multiop $MOUNT/$tfile OS_c  &
+    PID=$!
+#define OBD_FAIL_MDS_CLOSE_NET           0x115
+    do_facet mds "sysctl -w lustre.fail_loc=0x115"
+    clear_failloc mds $((TIMEOUT * 2)) &
+    kill -USR1 $PID
+    echo "waiting for multiop $PID"
+    wait $PID || return 2
+    do_facet client munlink $MOUNT/$tfile  || return 3
+}
+run_test 12 "recover from timed out resend in ptlrpcd (b=2494)"
+
+# Bug 113, check that readdir lost recv timeout works.
+test_13() {
+    mkdir /mnt/lustre/readdir
+    touch /mnt/lustre/readdir/newentry
+# OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE
+    do_facet mds "sysctl -w lustre.fail_loc=0x80000104"
+    ls /mnt/lustre/readdir || return 1
+    do_facet mds "sysctl -w lustre.fail_loc=0"
+    rm -rf /mnt/lustre/readdir
+}
+run_test 13 "mdc_readpage restart test (bug 1138)"
+
+# Bug 113, check that readdir lost send timeout works.
+test_14() {
+    mkdir /mnt/lustre/readdir
+    touch /mnt/lustre/readdir/newentry
+# OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE
+    do_facet mds "sysctl -w lustre.fail_loc=0x80000106"
+    ls /mnt/lustre/readdir || return 1
+    do_facet mds "sysctl -w lustre.fail_loc=0"
+}
+run_test 14 "mdc_readpage resend test (bug 1138)"
+
+test_15() {
+    do_facet mds "sysctl -w lustre.fail_loc=0x80000128"
+    touch $DIR/$tfile && return 1
+    return 0
+}
+run_test 15 "failed open (-ENOMEM)"
+
 $CLEANUP
-