|
11 | 11 | from lib.vm import VM |
12 | 12 | from tests.storage import ( |
13 | 13 | MAX_VDI_SIZE, |
| 14 | + CBTTest, |
14 | 15 | CoalesceOperation, |
15 | 16 | ImageFormat, |
16 | 17 | XVACompression, |
| 18 | + assert_cbt_log_does_not_exist_file_sr, |
| 19 | + assert_cbt_log_exists_file_sr, |
17 | 20 | coalesce_integrity, |
18 | 21 | full_vdi_write, |
19 | 22 | vdi_export_import, |
|
25 | 28 | # - one XCP-ng host >= 8.0 with an additional unused disk for the SR |
26 | 29 |
|
27 | 30 | # Make sure this fixture is called before the parametrized one |
| 31 | + |
| 32 | + |
28 | 33 | @pytest.mark.usefixtures('image_format') |
29 | 34 | class TestNFSSR: |
30 | 35 | @pytest.mark.quicktest |
@@ -160,3 +165,59 @@ def test_reboot(self, host: Host, dispatch_nfs: VM) -> None: |
160 | 165 | vm.shutdown(verify=True) |
161 | 166 |
|
162 | 167 | # *** 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