|
2 | 2 |
|
3 | 3 | from lib.commands import SSHCommandFailed |
4 | 4 | from lib.common import Defer, vm_image, wait_for |
| 5 | +from lib.host import Host |
5 | 6 | from lib.sr import SR |
6 | 7 | from lib.vdi import VDI, ImageFormat |
7 | 8 | from lib.vm import VM |
|
16 | 17 | vdi_is_open, |
17 | 18 | xva_export_import, |
18 | 19 | ) |
| 20 | +from tests.storage.storage import ( |
| 21 | + check_critical_journal_revert, |
| 22 | + check_vdi_revert, |
| 23 | + check_vdi_revert_cbt, |
| 24 | + check_vdi_revert_journal, |
| 25 | + check_vdi_revert_journal_cbt, |
| 26 | +) |
19 | 27 |
|
20 | 28 | # Requirements: |
21 | 29 | # - one XCP-ng host >= 8.2 |
@@ -82,6 +90,41 @@ def test_vdi_export_import(self, storage_test_vm: VM, lvmohba_sr: SR, image_form |
82 | 90 | temp_large_dir: str, defer: Defer): |
83 | 91 | vdi_export_import(storage_test_vm, lvmohba_sr, image_format, temp_large_dir, defer) |
84 | 92 |
|
| 93 | + @pytest.mark.small_vm |
| 94 | + @pytest.mark.big_vm |
| 95 | + def test_revert(self, vm_on_lvmohba_sr: VM, defer: Defer) -> None: |
| 96 | + check_vdi_revert(defer, vm_on_lvmohba_sr) |
| 97 | + |
| 98 | + @pytest.mark.small_vm |
| 99 | + @pytest.mark.big_vm |
| 100 | + def test_revert_cbt(self, vm_on_lvmohba_sr: VM, defer: Defer) -> None: |
| 101 | + check_vdi_revert_cbt(defer, vm_on_lvmohba_sr) |
| 102 | + |
| 103 | + @pytest.mark.small_vm |
| 104 | + @pytest.mark.big_vm |
| 105 | + def test_revert_journal_cbt(self, vm_on_lvmohba_sr: VM, defer: Defer, exit_on_fistpoint: None): |
| 106 | + check_vdi_revert_journal_cbt(defer, vm_on_lvmohba_sr, "LVM_revert_create_src") |
| 107 | + |
| 108 | + @pytest.mark.small_vm |
| 109 | + @pytest.mark.big_vm |
| 110 | + @pytest.mark.parametrize( |
| 111 | + "fistpoint", |
| 112 | + [ |
| 113 | + "LVM_revert_create_insert", |
| 114 | + "LVM_revert_create_src", |
| 115 | + "LVM_revert_create_dest", |
| 116 | + ] |
| 117 | + ) |
| 118 | + def test_revert_journal(self, vm_on_lvmohba_sr: VM, defer: Defer, exit_on_fistpoint: None, fistpoint: str): |
| 119 | + check_vdi_revert_journal(defer, vm_on_lvmohba_sr, fistpoint) |
| 120 | + |
| 121 | + @pytest.mark.small_vm |
| 122 | + @pytest.mark.big_vm |
| 123 | + def test_critical_journal_revert( |
| 124 | + self, vm_on_lvmohba_sr: VM, defer: Defer, exit_on_fistpoint: None, hostA2: Host |
| 125 | + ) -> None: |
| 126 | + check_critical_journal_revert(defer, vm_on_lvmohba_sr, hostA2, "LVM_revert_create_src") |
| 127 | + |
85 | 128 | # *** tests with reboots (longer tests). |
86 | 129 |
|
87 | 130 | @pytest.mark.reboot |
|
0 commit comments