[sheepdog] [PATCH v8 16/17] tests/functional: add a new test of the object reclaim for cloned VDIs
Hitoshi Mitake
mitake.hitoshi at gmail.com
Sun Mar 30 16:10:09 CEST 2014
This patch adds a new test of the object reclaim algorithm. The test
creates branch of VDI tree and checks the GC works well for the case.
Cc: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Cc: Valerio Pachera <sirio81 at gmail.com>
Cc: Alessandro Bolgia <alessandro at extensys.it>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
tests/functional/091 | 47 +++++++++++++++++++++++++++++++++++++++++++++++
tests/functional/091.out | 42 ++++++++++++++++++++++++++++++++++++++++++
tests/functional/group | 1 +
3 files changed, 90 insertions(+)
create mode 100755 tests/functional/091
create mode 100644 tests/functional/091.out
diff --git a/tests/functional/091 b/tests/functional/091
new file mode 100755
index 0000000..6f0377d
--- /dev/null
+++ b/tests/functional/091
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# Test object reclaim for cloned VDIs
+
+. ./common
+
+for i in 0 1 2; do
+ _start_sheep $i
+done
+_wait_for_sheep 3
+_cluster_format -c 2
+
+$DOG vdi create test 16M -P
+_node_info
+
+$DOG vdi snapshot test
+$DOG vdi clone test -s 1 test_cloned
+
+$DOG vdi write test_cloned 0 512 < /dev/zero
+$DOG vdi write test_cloned $((4 * 1024 ** 2 * 1)) 512 < /dev/zero
+_node_info
+
+_vdi_list
+
+$DOG vdi clone test -s 1 test_cloned2 # create branch
+
+$DOG vdi write test_cloned2 0 512 < /dev/zero
+$DOG vdi write test_cloned2 $((4 * 1024 ** 2 * 1)) 512 < /dev/zero
+_node_info
+
+_vdi_list
+
+$DOG vdi delete test
+_node_info
+
+$DOG vdi delete test -s 1
+_node_info
+
+$DOG vdi delete test_cloned
+_node_info
+
+$DOG vdi delete test_cloned2
+echo there should be no object
+_node_info
+
+echo there should be no vdi
+_vdi_list
diff --git a/tests/functional/091.out b/tests/functional/091.out
new file mode 100644
index 0000000..bada989
--- /dev/null
+++ b/tests/functional/091.out
@@ -0,0 +1,42 @@
+QA output created by 091
+using backend plain store
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 3 0 0 0 0 0
+1 3 1 0 0 0 0
+2 2 1 0 0 0 0
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 5 1 0 0 2 0
+1 4 2 0 0 0 0
+2 3 3 0 0 2 0
+ Name Id Size Used Shared Creation time VDI id Copies Tag
+c test_cloned 0 16 MB 8.0 MB 8.0 MB DATE 34f19d 2
+s test 1 16 MB 16 MB 0.0 MB DATE 7c2b25 2
+ test 0 16 MB 0.0 MB 16 MB DATE 7c2b26 2
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 5 2 0 0 2 0
+1 6 3 0 0 0 0
+2 5 3 0 0 2 0
+ Name Id Size Used Shared Creation time VDI id Copies Tag
+c test_cloned 0 16 MB 8.0 MB 8.0 MB DATE 34f19d 2
+s test 1 16 MB 16 MB 0.0 MB DATE 7c2b25 2
+ test 0 16 MB 0.0 MB 16 MB DATE 7c2b26 2
+c test_cloned2 0 16 MB 8.0 MB 8.0 MB DATE f6ac5d 2
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 5 2 0 0 4 0
+1 6 3 0 0 2 0
+2 5 3 0 0 2 0
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 3 2 0 0 2 0
+1 4 3 0 0 2 0
+2 5 3 0 0 0 0
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 1 2 0 0 2 0
+1 3 3 0 0 2 0
+2 4 3 0 0 0 0
+there should be no object
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 0 2 0 0 0 0
+1 0 3 0 0 0 0
+2 0 3 0 0 0 0
+there should be no vdi
+ Name Id Size Used Shared Creation time VDI id Copies Tag
diff --git a/tests/functional/group b/tests/functional/group
index b47bf69..0c5147b 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -105,3 +105,4 @@
088 auto quick cluster
089 auto quick sheepfs
090 auto quick vdi md
+091 auto quick vdi
--
1.8.3.2
More information about the sheepdog
mailing list