[sheepdog] [PATCH 2/2] tests/functional: add 069 for testing vdi creation during session timeout

Kai Zhang kyle at zelin.io
Tue Jul 2 08:31:57 CEST 2013


Signed-off-by: Kai Zhang <kyle at zelin.io>
---
 tests/functional/069       |   34 ++++++++++++++++++++++++++++++++++
 tests/functional/069.out   |    5 +++++
 tests/functional/common.rc |    1 +
 tests/functional/group     |    1 +
 4 files changed, 41 insertions(+)
 create mode 100755 tests/functional/069
 create mode 100644 tests/functional/069.out

diff --git a/tests/functional/069 b/tests/functional/069
new file mode 100755
index 0000000..45fbb13
--- /dev/null
+++ b/tests/functional/069
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Test collie vdi create during session timeout
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+
+# 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
+
+_kill_zk_session 0
+
+$COLLIE vdi create test1 10M &
+$COLLIE vdi create test2 10M
+
+_wait_for_sheep 3 0
+
+$COLLIE vdi list | _filter_short_date
diff --git a/tests/functional/069.out b/tests/functional/069.out
new file mode 100644
index 0000000..f02c87a
--- /dev/null
+++ b/tests/functional/069.out
@@ -0,0 +1,5 @@
+QA output created by 069
+using backend plain store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test1        0   10 MB  0.0 MB  0.0 MB DATE   fd32fc     3              
+  test2        0   10 MB  0.0 MB  0.0 MB DATE   fd3815     3              
diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index f621261..ce229f2 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -486,6 +486,7 @@ _kill_zk_session()
 		_kill_sheep $1
 		_wait_for_sheep_stop $1
 		_start_sheep $1
+		sleep 1
 	fi
 }
 
diff --git a/tests/functional/group b/tests/functional/group
index ab34281..eb2184e 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -82,3 +82,4 @@
 066 auto quick cluster md
 067 auto quick cluster
 068 auto quick cluster
+069 auto cluster
-- 
1.7.9.5




More information about the sheepdog mailing list