Skip to content

Commit 25ea394

Browse files
committed
WIP ZFS-ng: test chain of VDI clones and their destuction
FIXME: * cloning a VDI without a snapshot is not implemented yet
1 parent 5ff3cdc commit 25ea394

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/storage/zfs_ng/test_zfs_sr.py

+26
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,29 @@ def test_vdi_and_snaps_destroy_intermediate_vdi(self, vdi_and_snaps_chain):
125125
vdi.destroy()
126126
# tell fixture we destroyed that one
127127
vdi_and_snaps_chain[2:3] = []
128+
129+
@pytest.fixture(scope='package')
130+
def vdi_chain(zfs_sr):
131+
""" A chain of VDI clones on first host. """
132+
vdis = [zfs_sr.create_vdi('ZFS-local-VDI-test')]
133+
for i in range(2):
134+
vdis.append(vdis[-1].clone())
135+
yield vdis
136+
# teardown
137+
for vdi in reversed(vdis):
138+
vdi.destroy()
139+
140+
@pytest.mark.xfail
141+
@pytest.mark.usefixtures("vdi_chain")
142+
class TestZfsngSrVdiDestroy:
143+
def test_destroy(self, vdi_chain):
144+
assert len(vdi_chain) == 3
145+
146+
def test_destroy_last(self, vdi_chain):
147+
vdi_chain[-1].destroy()
148+
149+
def test_destroy_first(self, vdi_chain):
150+
vdi_chain[0].destroy()
151+
152+
def test_destroy_intermediate(self, vdi_chain):
153+
vdi_chain[1].destroy()

0 commit comments

Comments
 (0)