Whamcloud - gitweb
b=2432,2494
[fs/lustre-release.git] / lustre / tests / replay-single.sh
index 20aecdf..9292b0a 100755 (executable)
@@ -52,13 +52,20 @@ if [ "$ONLY" == "cleanup" ]; then
     exit
 fi
 
-gen_config
+SETUP=${SETUP:-"setup"}
+CLEANUP=${CLEANUP:-"cleanup"}
 
-start ost --reformat $OSTLCONFARGS 
-start ost2 --reformat $OSTLCONFARGS 
-[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-start mds $MDSLCONFARGS --reformat
-zconf_mount $MOUNT
+setup() {
+    gen_config
+
+    start ost --reformat $OSTLCONFARGS 
+    start ost2 --reformat $OSTLCONFARGS 
+    [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
+    start mds $MDSLCONFARGS --reformat
+    zconf_mount $MOUNT
+}
+
+$SETUP
 
 if [ "$ONLY" == "setup" ]; then
     exit 0
@@ -665,5 +672,20 @@ test_35() {
 }
 run_test 35 "test recovery from llog for unlink op"
 
+# b=2432 resent cancel after replay uses wrong cookie,
+# so don't resend cancels
+test_36() {
+    replay_barrier mds
+    touch $DIR/$tfile
+    checkstat $DIR/$tfile
+    facet_failover mds
+    cancel_lru_locks MDC
+    if dmesg | grep "unknown lock cookie"; then 
+       echo "cancel after replay failed"
+       return 1
+    fi
+}
+run_test 36 "don't resend cancel"
+
 equals_msg test complete, cleaning up
-cleanup
+$CLEANUP