]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_idempotent_sequence: simple test script
authorSage Weil <sage.weil@dreamhost.com>
Fri, 13 Apr 2012 21:46:46 +0000 (14:46 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 14 Apr 2012 03:38:25 +0000 (20:38 -0700)
Takes seed and kill point, then verifies the result.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/test/filestore_test/run_seed_to.sh [new file with mode: 0755]

diff --git a/src/test/filestore_test/run_seed_to.sh b/src/test/filestore_test/run_seed_to.sh
new file mode 100755 (executable)
index 0000000..4473db3
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+seed=$1
+killat=$2
+
+echo seed $seed
+echo kill at $killat
+
+# run forever, until $killat...
+to=1000000000
+
+rm -fr a a.fail a.recover
+./test_filestore_idempotent_sequence run-sequence-to $to a a/journal \
+    --filestore-xattr-use-omap --test-seed $seed --osd-journal-size 100 \
+    --filestore-kill-at $killat \
+    --log-file a.fail --debug-filestore 20
+
+stop=`./test_filestore_idempotent_sequence get-last-op a a/journal --filestore-xattr-use-omap \
+    --log-file a.recover --debug-filestore 20`
+
+echo stopped at $stop
+
+rm -rf b b.clean
+./test_filestore_idempotent_sequence run-sequence-to $stop b b/journal \
+    --filestore-xattr-use-omap --test-seed $seed --osd-journal-size 100 \
+    --log-file b.clean --debug-filestore 20
+
+if ./test_filestore_idempotent_sequence diff a a/journal b b/journal \
+    --filestore-xattr-use-omap; then
+    echo OK
+    exit 0
+fi
+
+echo "FAIL"
+echo " see:"
+echo "   a.fail     -- leading up to failure"
+echo "   a.recovery -- journal replay"
+echo "   b.clean    -- the clean reference"
+exit 1
+