Skip to content

Commit afb58db

Browse files
committed
implement cbt_tests on nfs_sr
Signed-off-by: Goulven Riou <goulven.riou@vates.tech>
1 parent 51abf89 commit afb58db

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

tests/storage/nfs/test_nfs_sr.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
from lib.vm import VM
1212
from tests.storage import (
1313
MAX_VDI_SIZE,
14+
CBTTest,
1415
CoalesceOperation,
1516
ImageFormat,
1617
XVACompression,
18+
assert_cbt_log_does_not_exist_file_sr,
19+
assert_cbt_log_exists_file_sr,
1720
coalesce_integrity,
1821
full_vdi_write,
1922
vdi_export_import,
@@ -25,6 +28,8 @@
2528
# - one XCP-ng host >= 8.0 with an additional unused disk for the SR
2629

2730
# Make sure this fixture is called before the parametrized one
31+
32+
2833
@pytest.mark.usefixtures('image_format')
2934
class TestNFSSR:
3035
@pytest.mark.quicktest
@@ -160,3 +165,59 @@ def test_reboot(self, host: Host, dispatch_nfs: VM) -> None:
160165
vm.shutdown(verify=True)
161166

162167
# *** End of tests with reboots
168+
169+
170+
class TestNFSCBT(CBTTest):
171+
"""Test CBT functionality on NFS SR"""
172+
173+
@staticmethod
174+
def assert_cbt_log_exists(host: Host, sr: SR, vdi: VDI) -> None:
175+
assert_cbt_log_exists_file_sr(host, sr, vdi)
176+
177+
@staticmethod
178+
def assert_cbt_log_does_not_exist(host: Host, sr: SR, vdi: VDI) -> None:
179+
assert_cbt_log_does_not_exist_file_sr(host, sr, vdi)
180+
181+
def test_enable_disable_cbt(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
182+
self._test_enable_disable_cbt(host, nfs_sr, vdi_on_nfs_sr)
183+
184+
def test_cbt_log_creation(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
185+
self._test_cbt_log_creation(host, nfs_sr, vdi_on_nfs_sr)
186+
187+
def test_snapshot_with_cbt(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
188+
self._test_snapshot_with_cbt(host, nfs_sr, vdi_on_nfs_sr)
189+
190+
@pytest.mark.small_vm
191+
def test_changed_blocks_tracking(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI, vm_on_nfs_sr: VM) -> None:
192+
self._test_changed_blocks_tracking(host, nfs_sr, vdi_on_nfs_sr, vm_on_nfs_sr)
193+
194+
@pytest.mark.small_vm
195+
def test_cbt_after_coalesce(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI, vm_on_nfs_sr: VM) -> None:
196+
self._test_cbt_after_coalesce(host, nfs_sr, vdi_on_nfs_sr, vm_on_nfs_sr)
197+
198+
@pytest.mark.small_vm
199+
def test_incremental_snap_scenario(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI, vm_on_nfs_sr: VM) -> None:
200+
self._test_incremental_snap_scenario(host, nfs_sr, vdi_on_nfs_sr, vm_on_nfs_sr)
201+
202+
def test_disable_cbt_removes_log(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
203+
self._test_disable_cbt_removes_log(host, nfs_sr, vdi_on_nfs_sr)
204+
205+
def test_destroy_vdi_removes_cbt_log(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
206+
self._test_destroy_vdi_removes_cbt_log(host, nfs_sr, vdi_on_nfs_sr)
207+
208+
def test_cbt_persist_after_sr_reboot(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
209+
self._test_cbt_persist_after_sr_reboot(host, nfs_sr, vdi_on_nfs_sr)
210+
211+
def test_cbt_on_snapshot_chain(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
212+
self._test_cbt_on_snapshot_chain(host, nfs_sr, vdi_on_nfs_sr)
213+
214+
def test_cbt_parent_disable_does_not_affect_snapshot(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
215+
self._test_cbt_parent_disable_does_not_affect_snapshot(host, nfs_sr, vdi_on_nfs_sr)
216+
217+
@pytest.mark.small_vm
218+
def test_cbt_bitmap_non_zero_after_write(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI,
219+
vm_on_nfs_sr: VM) -> None:
220+
self._test_cbt_bitmap_non_zero_after_write(host, nfs_sr, vdi_on_nfs_sr, vm_on_nfs_sr)
221+
222+
def test_cbt_data_destroy(self, host: Host, nfs_sr: SR, vdi_on_nfs_sr: VDI) -> None:
223+
self._test_cbt_data_destroy(host, nfs_sr, vdi_on_nfs_sr)

0 commit comments

Comments
 (0)