[sheepdog] [PATCH 2/3] tests: add test to check vdi deletion

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 16 09:32:43 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/046     |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/046.out |   20 ++++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 71 insertions(+), 0 deletions(-)
 create mode 100755 tests/046
 create mode 100644 tests/046.out

diff --git a/tests/046 b/tests/046
new file mode 100755
index 0000000..01a8379
--- /dev/null
+++ b/tests/046
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Test vdi deletion
+
+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 -c 2
+
+echo "delete snapshot image before current one"
+$COLLIE vdi create test 4G
+$COLLIE vdi snapshot test -s snap
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi delete test -s snap
+$COLLIE vdi delete test -s snap # error
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi delete test
+$COLLIE vdi delete test # error
+$COLLIE vdi list | _filter_short_date
+
+echo "delete current image before snapshot one"
+$COLLIE vdi create test 4G
+$COLLIE vdi snapshot test -s snap
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi delete test
+$COLLIE vdi delete test # error
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi delete test -s snap
+$COLLIE vdi delete test -s snap # error
+$COLLIE vdi list | _filter_short_date
diff --git a/tests/046.out b/tests/046.out
new file mode 100644
index 0000000..da67af8
--- /dev/null
+++ b/tests/046.out
@@ -0,0 +1,20 @@
+QA output created by 046
+using backend farm store
+delete snapshot image before current one
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
+  test         2  4.0 GB  0.0 MB  0.0 MB DATE   7c2b26     2              
+Failed to delete test: Failed to find requested tag
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         2  4.0 GB  0.0 MB  0.0 MB DATE   7c2b26     2              
+Failed to delete test: No VDI found
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+delete current image before snapshot one
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
+  test         2  4.0 GB  0.0 MB  0.0 MB DATE   7c2b27     2              
+Failed to delete test: No VDI found
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
+Failed to delete test: No VDI found
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
diff --git a/tests/group b/tests/group
index 356c791..695431f 100644
--- a/tests/group
+++ b/tests/group
@@ -57,3 +57,4 @@
 043 auto quick store
 044 auto quick vdi
 045 auto quick store
+046 auto quick vdi
-- 
1.7.2.5




More information about the sheepdog mailing list