Skip to content

Commit c6f0da0

Browse files
authored
De-quarantine: test_pause_unpause_vm (#2926)
##### Short description: - Root cause fix is in python-wrapper (full details in jira ticket) - Refactor pause/unpause function names - drop optional migraion (never used) - remove admin_client dependency ##### More details: Actual fix is in python-wrapper: RedHatQE/openshift-python-wrapper#2596 ##### What this PR does / why we need it: ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: ##### jira-ticket: https://issues.redhat.com/browse/CNV-72168 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Simplified VM pause/unpause utilities by removing optional migration paths and renaming helper functions for clearer, more consistent behavior. * **Tests** * Updated tests to use the streamlined utilities across OS and GPU scenarios; removed expected-failure markers so previously quarantined pause/unpause tests now run as active tests. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 27d36f4 commit c6f0da0

File tree

12 files changed

+37
-47
lines changed

12 files changed

+37
-47
lines changed

tests/infrastructure/instance_types/supported_os/test_rhel_os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
running_vm,
2121
update_vm_efi_spec_and_restart,
2222
validate_libvirt_persistent_domain,
23-
validate_pause_optional_migrate_unpause_linux_vm,
23+
validate_pause_unpause_linux_vm,
2424
validate_virtctl_guest_agent_data_over_time,
2525
wait_for_console,
2626
)
@@ -135,12 +135,12 @@ def test_migrate_vm(self, skip_access_mode_rwo_scope_class, golden_image_rhel_vm
135135
@pytest.mark.polarion("CNV-11836")
136136
@pytest.mark.dependency(depends=[f"{TESTS_MODULE_IDENTIFIER}::{TESTS_MIGRATE_VM}"])
137137
def test_pause_unpause_vm(self, golden_image_rhel_vm_with_instance_type):
138-
validate_pause_optional_migrate_unpause_linux_vm(vm=golden_image_rhel_vm_with_instance_type)
138+
validate_pause_unpause_linux_vm(vm=golden_image_rhel_vm_with_instance_type)
139139

140140
@pytest.mark.polarion("CNV-11837")
141141
@pytest.mark.dependency(depends=[f"{TESTS_MODULE_IDENTIFIER}::{TESTS_MIGRATE_VM}"])
142142
def test_pause_unpause_after_migrate(self, golden_image_rhel_vm_with_instance_type, ping_process_in_rhel_os):
143-
validate_pause_optional_migrate_unpause_linux_vm(
143+
validate_pause_unpause_linux_vm(
144144
vm=golden_image_rhel_vm_with_instance_type,
145145
pre_pause_pid=ping_process_in_rhel_os(golden_image_rhel_vm_with_instance_type),
146146
)

tests/virt/cluster/common_templates/centos/test_centos_os_support.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
migrate_vm_and_verify,
2222
running_vm,
2323
validate_libvirt_persistent_domain,
24-
validate_pause_optional_migrate_unpause_linux_vm,
24+
validate_pause_unpause_linux_vm,
2525
validate_virtctl_guest_agent_after_guest_reboot,
2626
validate_virtctl_guest_agent_data_over_time,
2727
wait_for_console,
@@ -117,7 +117,7 @@ def test_vm_smbios_default(self, smbios_from_kubevirt_config, matrix_centos_os_v
117117
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::start_vm"])
118118
@pytest.mark.polarion("CNV-5918")
119119
def test_pause_unpause_vm(self, matrix_centos_os_vm_from_template):
120-
validate_pause_optional_migrate_unpause_linux_vm(vm=matrix_centos_os_vm_from_template)
120+
validate_pause_unpause_linux_vm(vm=matrix_centos_os_vm_from_template)
121121

122122
@pytest.mark.rwx_default_storage
123123
@pytest.mark.polarion("CNV-5841")
@@ -132,9 +132,7 @@ def test_migrate_vm(self, matrix_centos_os_vm_from_template):
132132
@pytest.mark.polarion("CNV-5904")
133133
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])
134134
def test_pause_unpause_after_migrate(self, matrix_centos_os_vm_from_template, ping_process_in_centos_os):
135-
validate_pause_optional_migrate_unpause_linux_vm(
136-
vm=matrix_centos_os_vm_from_template, pre_pause_pid=ping_process_in_centos_os
137-
)
135+
validate_pause_unpause_linux_vm(vm=matrix_centos_os_vm_from_template, pre_pause_pid=ping_process_in_centos_os)
138136

139137
@pytest.mark.polarion("CNV-6008")
140138
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])

tests/virt/cluster/common_templates/fedora/test_fedora_os_support.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
migrate_vm_and_verify,
2525
running_vm,
2626
validate_libvirt_persistent_domain,
27-
validate_pause_optional_migrate_unpause_linux_vm,
27+
validate_pause_unpause_linux_vm,
2828
validate_virtctl_guest_agent_after_guest_reboot,
2929
validate_virtctl_guest_agent_data_over_time,
3030
wait_for_console,
@@ -194,7 +194,7 @@ def test_vm_machine_type(self, matrix_fedora_os_vm_from_template):
194194
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::start_vm"])
195195
@pytest.mark.polarion("CNV-5917")
196196
def test_pause_unpause_vm(self, matrix_fedora_os_vm_from_template):
197-
validate_pause_optional_migrate_unpause_linux_vm(vm=matrix_fedora_os_vm_from_template)
197+
validate_pause_unpause_linux_vm(vm=matrix_fedora_os_vm_from_template)
198198

199199
@pytest.mark.rwx_default_storage
200200
@pytest.mark.ibm_bare_metal
@@ -211,9 +211,7 @@ def test_migrate_vm(self, matrix_fedora_os_vm_from_template):
211211
@pytest.mark.polarion("CNV-5901")
212212
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])
213213
def test_pause_unpause_after_migrate(self, matrix_fedora_os_vm_from_template, ping_process_in_fedora_os):
214-
validate_pause_optional_migrate_unpause_linux_vm(
215-
vm=matrix_fedora_os_vm_from_template, pre_pause_pid=ping_process_in_fedora_os
216-
)
214+
validate_pause_unpause_linux_vm(vm=matrix_fedora_os_vm_from_template, pre_pause_pid=ping_process_in_fedora_os)
217215

218216
@pytest.mark.polarion("CNV-6006")
219217
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])

tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
vm_os_version,
1616
)
1717
from utilities import console
18-
from utilities.constants import LINUX_STR, QUARANTINED
18+
from utilities.constants import LINUX_STR
1919
from utilities.infra import validate_os_info_vmi_vs_linux_os
2020
from utilities.virt import (
2121
assert_linux_efi,
@@ -26,7 +26,7 @@
2626
running_vm,
2727
update_vm_efi_spec_and_restart,
2828
validate_libvirt_persistent_domain,
29-
validate_pause_optional_migrate_unpause_linux_vm,
29+
validate_pause_unpause_linux_vm,
3030
validate_virtctl_guest_agent_after_guest_reboot,
3131
validate_virtctl_guest_agent_data_over_time,
3232
wait_for_console,
@@ -174,13 +174,12 @@ def test_vm_machine_type(self, matrix_rhel_os_vm_from_template):
174174
def test_vm_smbios_default(self, smbios_from_kubevirt_config, matrix_rhel_os_vm_from_template):
175175
check_vm_xml_smbios(vm=matrix_rhel_os_vm_from_template, cm_values=smbios_from_kubevirt_config)
176176

177-
@pytest.mark.xfail(reason=f"{QUARANTINED}: Flake in pause VM checks; CNV-70033", run=False)
178177
@pytest.mark.arm64
179178
@pytest.mark.sno
180179
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::start_vm"])
181180
@pytest.mark.polarion("CNV-5916")
182181
def test_pause_unpause_vm(self, matrix_rhel_os_vm_from_template):
183-
validate_pause_optional_migrate_unpause_linux_vm(vm=matrix_rhel_os_vm_from_template)
182+
validate_pause_unpause_linux_vm(vm=matrix_rhel_os_vm_from_template)
184183

185184
@pytest.mark.arm64
186185
@pytest.mark.smoke
@@ -199,7 +198,7 @@ def test_migrate_vm(self, matrix_rhel_os_vm_from_template):
199198
@pytest.mark.polarion("CNV-5902")
200199
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])
201200
def test_pause_unpause_after_migrate(self, matrix_rhel_os_vm_from_template, ping_process_in_rhel_os):
202-
validate_pause_optional_migrate_unpause_linux_vm(
201+
validate_pause_unpause_linux_vm(
203202
vm=matrix_rhel_os_vm_from_template,
204203
pre_pause_pid=ping_process_in_rhel_os(matrix_rhel_os_vm_from_template),
205204
)

tests/virt/cluster/common_templates/windows/test_windows_os_support.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
validate_os_info_virtctl_vs_windows_os,
1313
validate_user_info_virtctl_vs_windows_os,
1414
)
15-
from tests.virt.utils import validate_pause_optional_migrate_unpause_windows_vm
15+
from tests.virt.utils import validate_pause_unpause_windows_vm
1616
from utilities.constants import OS_FLAVOR_WINDOWS
1717
from utilities.guest_support import assert_windows_efi, check_vm_xml_hyperv, check_windows_vm_hvinfo
1818
from utilities.ssp import validate_os_info_vmi_vs_windows_os
@@ -113,7 +113,7 @@ def test_vm_machine_type(self, matrix_windows_os_vm_from_template):
113113
@pytest.mark.polarion("CNV-3087")
114114
def test_pause_unpause_vm(self, matrix_windows_os_vm_from_template):
115115
"""Test VM pause and unpause"""
116-
validate_pause_optional_migrate_unpause_windows_vm(vm=matrix_windows_os_vm_from_template)
116+
validate_pause_unpause_windows_vm(vm=matrix_windows_os_vm_from_template)
117117

118118
@pytest.mark.sno
119119
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::start_vm"])
@@ -134,7 +134,7 @@ def test_migrate_vm(self, matrix_windows_os_vm_from_template):
134134
@pytest.mark.polarion("CNV-5903")
135135
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::migrate_vm_and_verify"])
136136
def test_pause_unpause_after_migrate(self, matrix_windows_os_vm_from_template, regedit_process_in_windows_os):
137-
validate_pause_optional_migrate_unpause_windows_vm(
137+
validate_pause_unpause_windows_vm(
138138
vm=matrix_windows_os_vm_from_template, pre_pause_pid=regedit_process_in_windows_os
139139
)
140140

tests/virt/node/gpu/gpu_pci_passthrough/test_rhel_vm_with_gpu_pci_passthrough.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from utilities.virt import (
2424
CIRROS_IMAGE,
2525
VirtualMachineForTests,
26-
pause_optional_migrate_unpause_and_check_connectivity,
26+
pause_unpause_vm_and_check_connectivity,
2727
)
2828

2929
pytestmark = [
@@ -119,7 +119,7 @@ def test_pause_unpause_hostdevices_rhel_vm(self, gpu_vma):
119119
Test VM with Device using hostdevices spec, can be paused and unpaused successfully.
120120
"""
121121
with running_sleep_in_linux(vm=gpu_vma):
122-
pause_optional_migrate_unpause_and_check_connectivity(vm=gpu_vma)
122+
pause_unpause_vm_and_check_connectivity(vm=gpu_vma)
123123

124124
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_RHEL_HOSTDEVICES_NAME}::test_access_hostdevices_rhel_vm"])
125125
@pytest.mark.polarion("CNV-5641")
@@ -164,7 +164,7 @@ def test_pause_unpause_gpus_rhel_vm(self, gpu_vma):
164164
Test VM with Device using GPUS spec, can be paused and unpaused successfully.
165165
"""
166166
with running_sleep_in_linux(vm=gpu_vma):
167-
pause_optional_migrate_unpause_and_check_connectivity(vm=gpu_vma)
167+
pause_unpause_vm_and_check_connectivity(vm=gpu_vma)
168168

169169
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_RHEL_GPUS_NAME}::access_gpus_rhel_vm"])
170170
@pytest.mark.polarion("CNV-5642")

tests/virt/node/gpu/gpu_pci_passthrough/test_windows_vm_with_gpu_pci_passthrough.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from tests.virt.node.gpu.utils import (
1212
restart_and_check_gpu_exists,
1313
)
14-
from tests.virt.utils import validate_pause_optional_migrate_unpause_windows_vm, verify_gpu_device_exists_in_vm
14+
from tests.virt.utils import validate_pause_unpause_windows_vm, verify_gpu_device_exists_in_vm
1515
from utilities.constants import Images
1616

1717
pytestmark = [
@@ -72,7 +72,7 @@ def test_pause_unpause_hostdevices_win_vm(self, gpu_vma):
7272
"""
7373
Test Windows VM with Device using hostdevices spec, can be paused and unpaused successfully.
7474
"""
75-
validate_pause_optional_migrate_unpause_windows_vm(vm=gpu_vma)
75+
validate_pause_unpause_windows_vm(vm=gpu_vma)
7676

7777
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::test_access_hostdevices_win_vm"])
7878
@pytest.mark.polarion("CNV-5648")
@@ -96,7 +96,7 @@ def test_pause_unpause_gpus_win_vm(self, gpu_vma):
9696
"""
9797
Test Windows VM with Device using gpus spec, can be paused and unpaused successfully.
9898
"""
99-
validate_pause_optional_migrate_unpause_windows_vm(vm=gpu_vma)
99+
validate_pause_unpause_windows_vm(vm=gpu_vma)
100100

101101
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::test_access_gpus_win_vm"])
102102
@pytest.mark.polarion("CNV-5744")

tests/virt/node/gpu/vgpu/test_rhel_vm_with_vgpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828
from utilities.virt import (
2929
VirtualMachineForTestsFromTemplate,
30-
pause_optional_migrate_unpause_and_check_connectivity,
30+
pause_unpause_vm_and_check_connectivity,
3131
running_vm,
3232
vm_instance_from_template,
3333
)
@@ -152,7 +152,7 @@ def test_pause_unpause_vgpus_rhel_vm(self, gpu_vma):
152152
Test VM with vGPU using GPUs spec, can be paused and unpaused successfully.
153153
"""
154154
with running_sleep_in_linux(vm=gpu_vma):
155-
pause_optional_migrate_unpause_and_check_connectivity(vm=gpu_vma)
155+
pause_unpause_vm_and_check_connectivity(vm=gpu_vma)
156156

157157
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::test_access_vgpus_rhel_vm"])
158158
@pytest.mark.polarion("CNV-4767")

tests/virt/node/gpu/vgpu/test_windows_vm_with_vgpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)
1616
from tests.virt.utils import (
1717
get_gpu_device_name_from_windows_vm,
18-
validate_pause_optional_migrate_unpause_windows_vm,
18+
validate_pause_unpause_windows_vm,
1919
verify_gpu_device_exists_in_vm,
2020
)
2121
from utilities.constants import Images
@@ -102,7 +102,7 @@ def test_pause_unpause_gpus_win_vm(self, gpu_vma):
102102
"""
103103
Test Windows VM with vGPU using gpus spec, can be paused and unpaused successfully.
104104
"""
105-
validate_pause_optional_migrate_unpause_windows_vm(vm=gpu_vma)
105+
validate_pause_unpause_windows_vm(vm=gpu_vma)
106106

107107
@pytest.mark.dependency(depends=[f"{TESTS_CLASS_NAME}::test_access_vgpus_win_vm"])
108108
@pytest.mark.polarion("CNV-8083")

tests/virt/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
get_vm_boot_time,
5959
kill_processes_by_name_linux,
6060
migrate_vm_and_verify,
61-
pause_optional_migrate_unpause_and_check_connectivity,
61+
pause_unpause_vm_and_check_connectivity,
6262
start_and_fetch_processid_on_linux_vm,
6363
start_and_fetch_processid_on_windows_vm,
6464
verify_vm_migrated,
@@ -283,11 +283,11 @@ def kill_processes_by_name_windows(vm, process_name):
283283
run_ssh_commands(host=vm.ssh_exec, commands=cmd, tcp_timeout=TCP_TIMEOUT_30SEC)
284284

285285

286-
def validate_pause_optional_migrate_unpause_windows_vm(vm, pre_pause_pid=None, migrate=False):
286+
def validate_pause_unpause_windows_vm(vm: VirtualMachineForTests, pre_pause_pid: int | None = None) -> None:
287287
proc_name = OS_PROC_NAME["windows"]
288288
if not pre_pause_pid:
289289
pre_pause_pid = start_and_fetch_processid_on_windows_vm(vm=vm, process_name=proc_name)
290-
pause_optional_migrate_unpause_and_check_connectivity(vm=vm, migrate=migrate)
290+
pause_unpause_vm_and_check_connectivity(vm=vm)
291291
post_pause_pid = fetch_pid_from_windows_vm(vm=vm, process_name=proc_name)
292292
kill_processes_by_name_windows(vm=vm, process_name=proc_name)
293293
assert post_pause_pid == pre_pause_pid, (

0 commit comments

Comments
 (0)