[sheepdog] [PATCH v8 10/10] sheep: add functional test case for hyper volume

Robin Dong robin.k.dong at gmail.com
Wed Nov 20 07:04:47 CET 2013


Add test case for writing, reading and recovery of hyper volume.

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/079     |   55 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/functional/079.out |   11 +++++++++
 tests/functional/group   |    1 +
 3 files changed, 67 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tests/functional/077
 create mode 100755 tests/functional/079
 create mode 100644 tests/functional/079.out

diff --git a/tests/functional/077 b/tests/functional/077
old mode 100644
new mode 100755
diff --git a/tests/functional/079 b/tests/functional/079
new file mode 100755
index 0000000..d4c1786
--- /dev/null
+++ b/tests/functional/079
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Test sheep write/read/recovery logic for hyper volume
+
+. ./common
+
+for i in `seq 0 2`; do
+    _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+_cluster_format
+
+$DOG vdi create test 16P -y
+_vdi_list
+
+# write many 2MB data from different offset of vdi
+for i in `seq 0 15`; do
+	_random | head -c 2M > $STORE/b$i
+	cat $STORE/b$i | md5sum > $STORE/cs$i
+	dd if=$STORE/b$i 2>/dev/null | $DOG vdi write test ${i}P 2M
+done
+
+# read these data out and check
+for i in `seq 0 15`; do
+	$DOG vdi read test ${i}P 2M > $STORE/c$i
+	cat $STORE/c$i | md5sum > $STORE/csum$i
+	diff -u -a $STORE/cs$i $STORE/csum$i
+done
+
+_vdi_list
+
+_cleanup
+
+# test sheep recovery logic for hyper volume (B-tree)
+for i in `seq 0 2`; do
+    _start_sheep $i
+done
+
+_wait_for_sheep 3
+
+_cluster_format
+
+$DOG vdi create test 16P -y
+_vdi_list
+_random | $DOG vdi write test 15P 2M
+$DOG vdi read test 15P 2M | md5sum > $STORE/csum1
+
+_kill_sheep 2;
+$DOG vdi read test 15P 2M | md5sum > $STORE/csum2
+
+diff -u $STORE/csum1 $STORE/csum2
+
+_vdi_list
diff --git a/tests/functional/079.out b/tests/functional/079.out
new file mode 100644
index 0000000..a21e2b0
--- /dev/null
+++ b/tests/functional/079.out
@@ -0,0 +1,11 @@
+QA output created by 079
+using backend plain store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   16 PB  0.0 MB  0.0 MB DATE   7c2b25     3              
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   16 PB   64 MB  0.0 MB DATE   7c2b25     3              
+using backend plain store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   16 PB  0.0 MB  0.0 MB DATE   7c2b25     3              
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   16 PB  4.0 MB  0.0 MB DATE   7c2b25     3              
diff --git a/tests/functional/group b/tests/functional/group
index 9460834..4de1f73 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -93,3 +93,4 @@
 076 auto quick vdi md
 077 auto quick vdi
 078 auto quick vdi md
+079 auto quick vdi md
-- 
1.7.1




More information about the sheepdog mailing list