[sheepdog] [PATCH v6 16/17] tests/functional: add a new test of the object reclaim for cloned VDIs
Hitoshi Mitake
mitake.hitoshi at gmail.com
Wed Mar 5 16:28:57 CET 2014
From: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
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/088 | 47 +++++++++++++++++++++++++++++++++++++++++++++++
tests/functional/088.out | 42 ++++++++++++++++++++++++++++++++++++++++++
tests/functional/group | 1 +
3 files changed, 90 insertions(+)
create mode 100755 tests/functional/088
create mode 100644 tests/functional/088.out
diff --git a/tests/functional/088 b/tests/functional/088
new file mode 100755
index 0000000..6f0377d
--- /dev/null
+++ b/tests/functional/088
@@ -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/088.out b/tests/functional/088.out
new file mode 100644
index 0000000..953742f
--- /dev/null
+++ b/tests/functional/088.out
@@ -0,0 +1,42 @@
+QA output created by 088
+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 7 1 0 0 2 0
+1 4 2 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
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 7 2 0 0 2 0
+1 6 3 0 0 0 0
+2 7 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 9 2 0 0 4 0
+1 8 3 0 0 2 0
+2 7 3 0 0 2 0
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 5 2 0 0 2 0
+1 6 3 0 0 2 0
+2 5 3 0 0 0 0
+STORE DATA VDI VMSTATE ATTR LEDGER STALE
+0 3 2 0 0 2 0
+1 5 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 0991ad7..ec6ffdd 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -102,3 +102,4 @@
085 auto quick vdi md
086 auto quick vdi md
087 auto quick vdi
+088 auto quick vdi
--
1.8.3.2
More information about the sheepdog
mailing list