[sheepdog] [PATCH v4 7/7] tsets: add 057 to test md hot-plug and hot-unplug

Liu Yuan namei.unix at gmail.com
Wed Apr 3 17:03:02 CEST 2013


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/057     |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/057.out |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 113 insertions(+)
 create mode 100755 tests/057
 create mode 100644 tests/057.out

diff --git a/tests/057 b/tests/057
new file mode 100755
index 0000000..94d02af
--- /dev/null
+++ b/tests/057
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Test md hot-plug and hot-unplug
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+md=true
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
+
+for i in 0 1 2; do
+	_start_sheep $i
+done
+_wait_for_sheep 3
+$COLLIE cluster format
+sleep 1
+$COLLIE vdi create test 100M -P
+
+$COLLIE node md info | awk '{$2="MASKED";print $0}'
+
+# plug during node event
+_start_sheep 3
+_wait_for_sheep 4
+$COLLIE node md plug  $STORE/0/d3,$STORE/0/d4
+_wait_for_sheep_recovery 0
+$COLLIE node md info | awk '{$2="MASKED";print $0}'
+$COLLIE vdi check test
+$COLLIE cluster info | _filter_cluster_info
+
+# plug duplicate path
+$COLLIE node md plug  $STORE/0/d3
+$COLLIE node recovery
+$COLLIE node md info | awk '{$2="MASKED";print $0}'
+
+# unplug
+$COLLIE node md unplug  $STORE/0/d0,$STORE/0/d1
+_wait_for_sheep_recovery 0
+$COLLIE node md info | awk '{$2="MASKED";print $0}'
+$COLLIE vdi check test
+$COLLIE cluster info | _filter_cluster_info
+
+
+# unplug invalid path
+$COLLIE node md unplug  $STORE/0/d0
+$COLLIE node recovery
+$COLLIE node md info | awk '{$2="MASKED";print $0}'
+$COLLIE cluster info | _filter_cluster_info
+
+# check stale object purging
+find $STORE/*/d*/.stale/ -type f
diff --git a/tests/057.out b/tests/057.out
new file mode 100644
index 0000000..ec3e7c1
--- /dev/null
+++ b/tests/057.out
@@ -0,0 +1,55 @@
+QA output created by 057
+using backend farm store
+Id MASKED Use Path
+0 MASKED GB 48 MB /tmp/sheepdog/0/d0
+1 MASKED GB 24 MB /tmp/sheepdog/0/d1
+2 MASKED GB 32 MB /tmp/sheepdog/0/d2
+Id MASKED Use Path
+0 MASKED GB 16 MB /tmp/sheepdog/0/d0
+1 MASKED GB 12 MB /tmp/sheepdog/0/d1
+2 MASKED GB 32 MB /tmp/sheepdog/0/d2
+3 MASKED GB 8.0 MB /tmp/sheepdog/0/d3
+4 MASKED GB 28 MB /tmp/sheepdog/0/d4
+finish check&repair test
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+Failed to execute request, look for sheep.log for more information
+Nodes In Recovery:
+  Id   Host:Port         V-Nodes       Zone
+Id MASKED Use Path
+0 MASKED GB 16 MB /tmp/sheepdog/0/d0
+1 MASKED GB 12 MB /tmp/sheepdog/0/d1
+2 MASKED GB 32 MB /tmp/sheepdog/0/d2
+3 MASKED GB 8.0 MB /tmp/sheepdog/0/d3
+4 MASKED GB 28 MB /tmp/sheepdog/0/d4
+Id MASKED Use Path
+0 MASKED GB 32 MB /tmp/sheepdog/0/d2
+1 MASKED GB 24 MB /tmp/sheepdog/0/d3
+2 MASKED GB 40 MB /tmp/sheepdog/0/d4
+finish check&repair test
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+Failed to execute request, look for sheep.log for more information
+Nodes In Recovery:
+  Id   Host:Port         V-Nodes       Zone
+Id MASKED Use Path
+0 MASKED GB 32 MB /tmp/sheepdog/0/d2
+1 MASKED GB 24 MB /tmp/sheepdog/0/d3
+2 MASKED GB 40 MB /tmp/sheepdog/0/d4
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
diff --git a/tests/group b/tests/group
index 66d970d..ed786cc 100644
--- a/tests/group
+++ b/tests/group
@@ -70,3 +70,4 @@
 054 auto quick cluster md
 055 auto cluster md
 056 auto quick cluster md
+057 auto quick cluster md
-- 
1.7.9.5




More information about the sheepdog mailing list