Whamcloud - gitweb
Move test 66[ab] from sanity.sh to recovery-small.sh because we need to do
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index e688313..7f10811 100755 (executable)
@@ -2,8 +2,8 @@
 
 set -e
 
-# 17 = bug 2732
-ALWAYS_EXCEPT="17"
+# 17 = bug 2732   2986
+ALWAYS_EXCEPT="17 19b"
 
 
 LUSTRE=${LUSTRE:-`dirname $0`/..}
@@ -210,17 +210,16 @@ test_15() {
 run_test 15 "failed open (-ENOMEM)"
 
 test_16() {
-# OBD_FAIL_PTLRPC_BULK_PUT_NET | OBD_FAIL_ONCE
     do_facet client cp /etc/termcap $MOUNT
     sync
 
+#define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
     sysctl -w lustre.fail_loc=0x80000504
     cancel_lru_locks OSC
-    # wil get evicted here
+    # will get evicted here
     do_facet client "diff /etc/termcap $MOUNT/termcap"  && return 1
     sysctl -w lustre.fail_loc=0
     do_facet client "diff /etc/termcap $MOUNT/termcap"  || return 2
-
 }
 run_test 16 "timeout bulk put, evict client (2732)"
 
@@ -237,20 +236,39 @@ test_17() {
 }
 run_test 17 "timeout bulk get, evict client (2732)"
 
-test_18() {
+test_18a() {
+    do_facet client mkdir -p $MOUNT/$tdir
+    f=$MOUNT/$tdir/$tfile
+
+    cancel_lru_locks OSC
+    pgcache_empty || return 1
+
+    # 1 stripe on ost2
+    lfs setstripe $f $((128 * 1024)) 1 1
+
+    do_facet client cp /etc/termcap $f
+    sync
+    local osc2_dev=`$LCTL device_list | \
+       awk '(/ost2.*client_facet/){print $4}' `
+    $LCTL --device %$osc2_dev deactivate
+    # my understanding is that there should be nothing in the page
+    # cache after the client reconnects?     
+    rc=0
+    pgcache_empty || rc=2
+    $LCTL --device %$osc2_dev activate
+    rm -f $f
+    return $rc
+}
+run_test 18a "manual ost invalidate clears page cache immediately"
+
+test_18b() {
 # OBD_FAIL_PTLRPC_BULK_PUT_NET|OBD_FAIL_ONCE
     do_facet client mkdir -p $MOUNT/$tdir
     f=$MOUNT/$tdir/$tfile
     f2=$MOUNT/$tdir/${tfile}-2
 
     cancel_lru_locks OSC
-    for a in /proc/fs/lustre/llite/*/dump_page_cache; do
-        if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then
-                echo there is still data in page cache $a ?
-                cat $a;
-                return 1;
-        fi
-    done
+    pgcache_empty || return 1
 
     # shouldn't have to set stripe size of count==1
     lfs setstripe $f $((128 * 1024)) 0 1
@@ -264,17 +282,38 @@ test_18() {
     sync
     sysctl -w lustre.fail_loc=0
     # allow recovery to complete
-    sleep 10
+    sleep $((TIMEOUT + 2))
     # my understanding is that there should be nothing in the page
     # cache after the client reconnects?     
-    for a in /proc/fs/lustre/llite/*/dump_page_cache; do
-        if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then
-                echo there is still data in page cache $a ?
-                cat $a;
-                return 1;
-        fi
-    done
+    rc=0
+    pgcache_empty || rc=2
+    rm -f $f $f2
+    return $rc
+}
+run_test 18b "eviction and reconnect clears page cache (2766)"
+
+test_19a() {   # bug 2983 - ldlm_handle_enqueue cleanup
+       mkdir -p $DIR/d19
+       multiop $DIR/d19/f19a O_wc &
+       MULTI_PID=$!
+       usleep 500
+       cancel_lru_locks OSC
+#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
+       do_facet ost sysctl -w lustre.fail_loc=0x80000308
+       kill -USR1 $MULTI_PID
+       wait $MULTI_PID && error "multiop didn't fail enqueue" || true
 }
-run_test 18 "eviction and reconnect clears page cache (2766)"
+run_test 19a "ldlm_handle_enqueue error (should return error) ==="
+
+test_19b() {   # bug 2986 - ldlm_handle_enqueue error during open
+       mkdir $DIR/d19
+       touch $DIR/d19/f19b
+       cancel_lru_locks OSC
+#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
+       do_facet ost sysctl -w lustre.fail_loc=0x80000308
+       dd if=/etc/hosts of=$DIR/d19/f19b && error "didn't fail enqueue" || true
+}
+run_test 19b "ldlm_handle_enqueue error (should return error) ==="
+
 
 $CLEANUP