Skip to content

Commit 51abf89

Browse files
committed
implement cbt tests on XFSSR
Signed-off-by: Goulven Riou <goulven.riou@vates.tech>
1 parent 2eb3d4e commit 51abf89

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

tests/storage/xfs/test_xfs_sr.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
from lib.vm import VM
1414
from tests.storage import (
1515
MAX_VDI_SIZE,
16+
CBTTest,
1617
CoalesceOperation,
1718
ImageFormat,
1819
XVACompression,
20+
assert_cbt_log_does_not_exist_file_sr,
21+
assert_cbt_log_exists_file_sr,
1922
coalesce_integrity,
2023
full_vdi_write,
2124
vdi_export_import,
@@ -129,3 +132,59 @@ def test_xfsprogs_missing(self, host: Host, xfs_sr: SR) -> None:
129132
host.yum_install(['xfsprogs'])
130133

131134
# *** End of tests with reboots
135+
136+
137+
class TestXFSCBT(CBTTest):
138+
"""Test CBT functionality on XFS SR"""
139+
140+
@staticmethod
141+
def assert_cbt_log_exists(host: Host, sr: SR, vdi: VDI) -> None:
142+
assert_cbt_log_exists_file_sr(host, sr, vdi)
143+
144+
@staticmethod
145+
def assert_cbt_log_does_not_exist(host: Host, sr: SR, vdi: VDI) -> None:
146+
assert_cbt_log_does_not_exist_file_sr(host, sr, vdi)
147+
148+
def test_enable_disable_cbt(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
149+
self._test_enable_disable_cbt(host, xfs_sr, vdi_on_xfs_sr)
150+
151+
def test_cbt_log_creation(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
152+
self._test_cbt_log_creation(host, xfs_sr, vdi_on_xfs_sr)
153+
154+
def test_snapshot_with_cbt(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
155+
self._test_snapshot_with_cbt(host, xfs_sr, vdi_on_xfs_sr)
156+
157+
@pytest.mark.small_vm
158+
def test_changed_blocks_tracking(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI, vm_on_xfs_sr: VM) -> None:
159+
self._test_changed_blocks_tracking(host, xfs_sr, vdi_on_xfs_sr, vm_on_xfs_sr)
160+
161+
@pytest.mark.small_vm
162+
def test_cbt_after_coalesce(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI, vm_on_xfs_sr: VM) -> None:
163+
self._test_cbt_after_coalesce(host, xfs_sr, vdi_on_xfs_sr, vm_on_xfs_sr)
164+
165+
@pytest.mark.small_vm
166+
def test_incremental_snap_scenario(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI, vm_on_xfs_sr: VM) -> None:
167+
self._test_incremental_snap_scenario(host, xfs_sr, vdi_on_xfs_sr, vm_on_xfs_sr)
168+
169+
def test_disable_cbt_removes_log(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
170+
self._test_disable_cbt_removes_log(host, xfs_sr, vdi_on_xfs_sr)
171+
172+
def test_destroy_vdi_removes_cbt_log(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
173+
self._test_destroy_vdi_removes_cbt_log(host, xfs_sr, vdi_on_xfs_sr)
174+
175+
def test_cbt_persist_after_sr_reboot(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
176+
self._test_cbt_persist_after_sr_reboot(host, xfs_sr, vdi_on_xfs_sr)
177+
178+
def test_cbt_on_snapshot_chain(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
179+
self._test_cbt_on_snapshot_chain(host, xfs_sr, vdi_on_xfs_sr)
180+
181+
def test_cbt_parent_disable_does_not_affect_snapshot(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
182+
self._test_cbt_parent_disable_does_not_affect_snapshot(host, xfs_sr, vdi_on_xfs_sr)
183+
184+
@pytest.mark.small_vm
185+
def test_cbt_bitmap_non_zero_after_write(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI,
186+
vm_on_xfs_sr: VM) -> None:
187+
self._test_cbt_bitmap_non_zero_after_write(host, xfs_sr, vdi_on_xfs_sr, vm_on_xfs_sr)
188+
189+
def test_cbt_data_destroy(self, host: Host, xfs_sr: SR, vdi_on_xfs_sr: VDI) -> None:
190+
self._test_cbt_data_destroy(host, xfs_sr, vdi_on_xfs_sr)

0 commit comments

Comments
 (0)