[sheepdog] [PATCH v2 2/2] tests: add test of vdi rollback

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Sep 1 14:18:31 CEST 2012


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

diff --git a/tests/039 b/tests/039
new file mode 100755
index 0000000..f31a413
--- /dev/null
+++ b/tests/039
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# Test vdi rollback
+
+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 `seq 0 4`; do
+    _start_sheep $i
+done
+
+_wait_for_sheep 5
+
+$COLLIE cluster format
+$COLLIE vdi create test 4G
+
+qemu-io -c "write 0 512 -P 1" sheepdog:test | _filter_qemu_io
+$COLLIE vdi snapshot test -s snap1
+qemu-io -c "write 0 512 -P 2" sheepdog:test | _filter_qemu_io
+
+$COLLIE vdi rollback test -s snap1
+qemu-io -c "read 0 512 -P 1" sheepdog:test | _filter_qemu_io
+$COLLIE vdi tree | _filter_short_date
+$COLLIE vdi list | _filter_short_date
+
+qemu-io -c "write 0 512 -P 2" sheepdog:test | _filter_qemu_io
+$COLLIE vdi snapshot test -s snap2
+qemu-io -c "write 0 512 -P 3" sheepdog:test | _filter_qemu_io
+
+$COLLIE vdi rollback test -s snap1
+qemu-io -c "read 0 512 -P 1" sheepdog:test | _filter_qemu_io
+$COLLIE vdi tree | _filter_short_date
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi rollback test -s snap2
+qemu-io -c "read 0 512 -P 2" sheepdog:test | _filter_qemu_io
+$COLLIE vdi tree | _filter_short_date
+$COLLIE vdi list | _filter_short_date
+
+$COLLIE vdi rollback test -s snap1
+qemu-io -c "read 0 512 -P 1" sheepdog:test | _filter_qemu_io
+$COLLIE vdi tree | _filter_short_date
+$COLLIE vdi list | _filter_short_date
+
+qemu-io -c "write 0 512 -P 3" sheepdog:test | _filter_qemu_io
+$COLLIE vdi snapshot test -s snap3
+qemu-io -c "write 0 512 -P 4" sheepdog:test | _filter_qemu_io
+$COLLIE vdi snapshot test -s snap4
+
+$COLLIE vdi rollback test -s snap3
+qemu-io -c "read 0 512 -P 3" sheepdog:test | _filter_qemu_io
+$COLLIE vdi tree | _filter_short_date
+$COLLIE vdi list | _filter_short_date
diff --git a/tests/039.out b/tests/039.out
new file mode 100644
index 0000000..206a91c
--- /dev/null
+++ b/tests/039.out
@@ -0,0 +1,54 @@
+QA output created by 039
+using backend farm store
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]---(you are here)
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
+  test         2  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]-+-[DATE]
+                          `-(you are here)
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
+s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b27     3         snap2
+  test         3  4.0 GB  0.0 MB  4.0 MB DATE   7c2b29     3              
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]---[DATE]---(you are here)
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
+s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b27     3         snap2
+  test         3  4.0 GB  0.0 MB  4.0 MB DATE   7c2b2a     3              
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]-+-[DATE]
+                          `-(you are here)
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
+s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b27     3         snap2
+  test         3  4.0 GB  0.0 MB  4.0 MB DATE   7c2b2b     3              
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]-+-[DATE]
+                          `-[DATE]-+-[DATE]
+                                               `-(you are here)
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
+s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b27     3         snap2
+s test         3  4.0 GB  4.0 MB  0.0 MB DATE   7c2b2b     3         snap3
+s test         4  4.0 GB  4.0 MB  0.0 MB DATE   7c2b2c     3         snap4
+  test         5  4.0 GB  0.0 MB  4.0 MB DATE   7c2b2e     3              
diff --git a/tests/group b/tests/group
index de658b9..3b61aca 100644
--- a/tests/group
+++ b/tests/group
@@ -50,3 +50,4 @@
 036 auto quick cluster
 037 auto quick cluster
 038 auto quick cluster
+039 auto quick vdi
-- 
1.7.2.5




More information about the sheepdog mailing list