[sheepdog] [PATCH v2 2/2] tests/functional: add a test for reducing identical snapshots

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Feb 12 09:27:00 CET 2015


This patch add a new test for the functionality of reducing identical
snapshots. With -R option, new snapshot isn't created if a VDI doesn't
have its own objects.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 tests/functional/100     | 32 ++++++++++++++++++++++++++++++++
 tests/functional/100.out |  9 +++++++++
 tests/functional/group   |  1 +
 3 files changed, 42 insertions(+)
 create mode 100755 tests/functional/100
 create mode 100644 tests/functional/100.out

diff --git a/tests/functional/100 b/tests/functional/100
new file mode 100755
index 0000000..2f059c8
--- /dev/null
+++ b/tests/functional/100
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Test the functionality of reducing identical snapshots
+
+. ./common
+
+for i in 0 1 2 3; do
+    _start_sheep $i
+done
+_wait_for_sheep 4
+_cluster_format -c 3
+
+# test normal case
+
+$DOG vdi create test 16M
+$DOG vdi snapshot test
+$DOG vdi snapshot test
+
+$DOG vdi list | _filter_short_date
+
+$DOG vdi delete test -s 1
+$DOG vdi delete test -s 2
+$DOG vdi delete test
+
+# test reduced case
+
+$DOG vdi create test 16M
+$DOG vdi snapshot test -R
+_random | $DOG vdi write test 0 512
+$DOG vdi snapshot test -R
+
+$DOG vdi list | _filter_short_date
diff --git a/tests/functional/100.out b/tests/functional/100.out
new file mode 100644
index 0000000..f0dba81
--- /dev/null
+++ b/tests/functional/100.out
@@ -0,0 +1,9 @@
+QA output created by 100
+using backend plain store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag   Block Size Shift
+s test         1   16 MB  0.0 MB  0.0 MB DATE   7c2b25      3                22
+s test         2   16 MB  0.0 MB  0.0 MB DATE   7c2b26      3                22
+  test         0   16 MB  0.0 MB  0.0 MB DATE   7c2b27      3                22
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag   Block Size Shift
+s test         1   16 MB  4.0 MB  0.0 MB DATE   7c2b25      3                22
+  test         0   16 MB  0.0 MB  4.0 MB DATE   7c2b26      3                22
diff --git a/tests/functional/group b/tests/functional/group
index 15edbf7..2e03738 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -114,3 +114,4 @@
 097 vdi cluster
 098 auto quick vdi cluster
 099 auto quick vdi cluster
+100 auto quick vdi
-- 
1.9.1




More information about the sheepdog mailing list