[sheepdog] [PATCH 2/2] tests: add 050 for IO NIC

Liu Yuan namei.unix at gmail.com
Tue Jan 15 12:41:10 CET 2013


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

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

diff --git a/tests/050 b/tests/050
new file mode 100755
index 0000000..3fa2fca
--- /dev/null
+++ b/tests/050
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Test IO NIC function
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+
+trap "_uninit; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_uninit()
+{
+	iptables -D INPUT -p tcp --sport 8001 -j DROP
+	iptables -D INPUT -p tcp --dport 8001 -j DROP
+}
+
+_cleanup
+
+for i in `seq 0 2`; do
+	_start_sheep $i "-i host=127.0.0.1,port=$((8000+$i))"
+done
+
+_wait_for_sheep 3
+
+$COLLIE cluster format
+
+$COLLIE vdi create test 100M
+dd if=/dev/zero | $COLLIE vdi write test &
+
+sleep 1
+# simulate IO NIC down of sheep 1
+iptables -A INPUT -p tcp --sport 8001 -j DROP
+iptables -A INPUT -p tcp --dport 8001 -j DROP
+
+# wait for collie to finish
+wait
+
+if [ "`grep fallback $STORE/0/sheep.log`" ];then
+	echo fallback done
+fi
+$COLLIE vdi check test
+
+status=0
diff --git a/tests/050.out b/tests/050.out
new file mode 100644
index 0000000..d480685
--- /dev/null
+++ b/tests/050.out
@@ -0,0 +1,4 @@
+QA output created by 050
+using backend farm store
+fallback done
+finish check&repair test
diff --git a/tests/group b/tests/group
index a5b61b6..145cbfa 100644
--- a/tests/group
+++ b/tests/group
@@ -62,3 +62,4 @@
 047 auto quick vdi
 048 auto quick collie
 049 auto quick cache
+050 auto quick cluster
-- 
1.7.9.5




More information about the sheepdog mailing list