[sheepdog-users] [PATCH stable-0.7 2/2] tests/functional: add a new test for lost and corrupted objects
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Mon Dec 16 03:18:48 CET 2013
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
Conflicts:
tests/functional/group
Conflicts were resolved by Hitoshi Mitake. In addition, the test was a
little bit modified for stable-0.7.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
tests/functional/077 | 77 ++++++++++++++++++++++++++++++++++++++++++++++
tests/functional/077.out | 16 ++++++++++
tests/functional/group | 1 +
3 files changed, 94 insertions(+)
create mode 100755 tests/functional/077
create mode 100644 tests/functional/077.out
diff --git a/tests/functional/077 b/tests/functional/077
new file mode 100755
index 0000000..d1b95d6
--- /dev/null
+++ b/tests/functional/077
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Test vdi repair functionality
+
+. ./common
+
+for i in `seq 0 2`; do
+ _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+_cluster_format
+
+$DOG vdi create test 12M
+_vdi_list
+
+echo "original data" | $DOG vdi write test
+
+# single object lost
+
+rm $STORE/0/obj/007c2b2500000000
+
+$DOG vdi check test
+
+$DOG vdi read test 0 14
+
+$DOG cluster shutdown
+
+# single broken object
+
+for i in `seq 0 2`; do
+ _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+_random | dd of=$STORE/1/obj/007c2b2500000000 bs=4096 count=1024 &> /dev/null
+
+
+$DOG vdi check test
+
+$DOG vdi read test 0 14
+
+$DOG cluster shutdown
+
+# two object lost
+
+for i in `seq 0 2`; do
+ _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+rm $STORE/0/obj/007c2b2500000000
+rm $STORE/1/obj/007c2b2500000000
+
+$DOG vdi check test
+
+$DOG vdi read test 0 14
+
+$DOG cluster shutdown
+
+# single object lost, single broken object. no majority
+
+for i in `seq 0 2`; do
+ _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+rm $STORE/0/obj/007c2b2500000000
+_random | dd of=$STORE/1/obj/007c2b2500000000 bs=4096 count=1024 &> /dev/null
+
+$DOG vdi check test
+
+$DOG cluster shutdown
diff --git a/tests/functional/077.out b/tests/functional/077.out
new file mode 100644
index 0000000..5bddb9b
--- /dev/null
+++ b/tests/functional/077.out
@@ -0,0 +1,16 @@
+QA output created by 077
+using backend plain store
+ Name Id Size Used Shared Creation time VDI id Copies Tag
+ test 0 12 MB 0.0 MB 0.0 MB DATE 7c2b25 3
+fixed missing 7c2b2500000000
+finish check&repair test
+original data
+fixed replica 7c2b2500000000
+finish check&repair test
+original data
+fixed missing 7c2b2500000000
+fixed missing 7c2b2500000000
+finish check&repair test
+original data
+no majority of 7c2b2500000000
+finish check&repair test
diff --git a/tests/functional/group b/tests/functional/group
index 15a60af..96a31ce 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -88,3 +88,4 @@
071 auto quick store md
072 auto quick store
073 auto quick sheepfs
+077 auto quick vdi
--
1.7.10.4
More information about the sheepdog-users
mailing list