[sheepdog] [PATCH v1 3/3] test: add test case for unplug all disks for one sheep daemon

Robin Dong robin.k.dong at gmail.com
Wed Jun 18 10:48:58 CEST 2014


From: Robin Dong <sanbai at taobao.com>

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/096     | 38 ++++++++++++++++++++++++++++++++++++++
 tests/functional/096.out | 34 ++++++++++++++++++++++++++++++++++
 tests/functional/group   |  1 +
 3 files changed, 73 insertions(+)
 create mode 100755 tests/functional/096
 create mode 100644 tests/functional/096.out

diff --git a/tests/functional/096 b/tests/functional/096
new file mode 100755
index 0000000..08e5820
--- /dev/null
+++ b/tests/functional/096
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Test md hot-unplug all disks
+
+. ./common
+
+MD=true
+
+for i in `seq 0 5`; do
+	_make_device $i $((80 * 1024 ** 2))
+done
+
+for i in `seq 0 5`; do
+	MD_STORE=",$STORE/$i/d0,$STORE/$i/d1,$STORE/$i/d2,$STORE/$i/d3"
+	_start_sheep $i
+done
+_wait_for_sheep 6
+_cluster_format -c 4:2
+
+_md_info
+
+_vdi_create test 99M
+
+_random | $DOG vdi write test
+
+$DOG vdi read test | md5sum > $STORE/csum.1
+
+# unplug all disks for a node
+$DOG node md unplug $STORE/0/d0
+$DOG node md unplug $STORE/0/d1
+$DOG node md unplug $STORE/0/d2
+$DOG node md unplug $STORE/0/d3
+
+$DOG vdi read test | md5sum > $STORE/csum.2
+
+diff -u $STORE/csum.1 $STORE/csum.2
+
+dog node list
diff --git a/tests/functional/096.out b/tests/functional/096.out
new file mode 100644
index 0000000..0766160
--- /dev/null
+++ b/tests/functional/096.out
@@ -0,0 +1,34 @@
+QA output created by 096
+using backend plain store
+STORE	DATA	VDI	VMSTATE	ATTR	LEDGER	STALE
+0/d0	0	0	0	0	0	0
+0/d1	0	0	0	0	0	0
+0/d2	0	0	0	0	0	0
+0/d3	0	0	0	0	0	0
+1/d0	0	0	0	0	0	0
+1/d1	0	0	0	0	0	0
+1/d2	0	0	0	0	0	0
+1/d3	0	0	0	0	0	0
+2/d0	0	0	0	0	0	0
+2/d1	0	0	0	0	0	0
+2/d2	0	0	0	0	0	0
+2/d3	0	0	0	0	0	0
+3/d0	0	0	0	0	0	0
+3/d1	0	0	0	0	0	0
+3/d2	0	0	0	0	0	0
+3/d3	0	0	0	0	0	0
+4/d0	0	0	0	0	0	0
+4/d1	0	0	0	0	0	0
+4/d2	0	0	0	0	0	0
+4/d3	0	0	0	0	0	0
+5/d0	0	0	0	0	0	0
+5/d1	0	0	0	0	0	0
+5/d2	0	0	0	0	0	0
+5/d3	0	0	0	0	0	0
+Failed to execute request, look for sheep.log for more information
+  Id   Host:Port         V-Nodes       Zone
+   0   127.0.0.1:7001      	128          1
+   1   127.0.0.1:7002      	128          2
+   2   127.0.0.1:7003      	128          3
+   3   127.0.0.1:7004      	128          4
+   4   127.0.0.1:7005      	128          5
diff --git a/tests/functional/group b/tests/functional/group
index 2094eab..4c6160a 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -110,3 +110,4 @@
 093 auto quick vdi
 094 auto quick store md
 095 auto quick store md
+096 auto quick store md
-- 
1.7.12.4




More information about the sheepdog mailing list