Skip to content

Commit a78ac30

Browse files
committed
Update virt tier2 tests for node to work on s390x
Signed-off-by: chandramerla <Chandra.Merla@ibm.com>
1 parent cd34a0b commit a78ac30

27 files changed

Lines changed: 209 additions & 38 deletions

tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
RHEL9_STR,
109109
RHEL_WITH_INSTANCETYPE_AND_PREFERENCE,
110110
RHSM_SECRET_NAME,
111+
S390X,
111112
SSP_CR_COMMON_TEMPLATES_LIST_KEY_NAME,
112113
TIMEOUT_3MIN,
113114
TIMEOUT_4MIN,
@@ -2770,7 +2771,13 @@ def cluster_modern_cpu_model_scope_class(
27702771
@pytest.fixture(scope="module")
27712772
def machine_type_from_kubevirt_config(kubevirt_config_scope_module, nodes_cpu_architecture):
27722773
"""Extract machine type default from kubevirt CR."""
2773-
return kubevirt_config_scope_module["architectureConfiguration"][nodes_cpu_architecture]["machineType"]
2774+
# Workaround for s390x (https://github.com/kubevirt/kubevirt/issues/14953), as machine type missing in config and
2775+
# hardcoded to s390_ccw_virtio in kubevirt code.
2776+
if nodes_cpu_architecture == S390X:
2777+
mc_type = "s390-ccw-virtio"
2778+
else:
2779+
mc_type = kubevirt_config_scope_module["architectureConfiguration"][nodes_cpu_architecture]["machineType"]
2780+
return mc_type
27742781

27752782

27762783
@pytest.fixture(scope="module")

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def update_cluster_cpu_model(admin_client, hco_namespace, hco_resource, cpu_mode
286286
hco_namespace=hco_namespace,
287287
path=["cpuModel"],
288288
value=cpu_model,
289-
timeout=30,
289+
timeout=60,
290290
)
291291
yield
292292

tests/virt/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ class MachineTypesNames:
3636
pc_q35_rhel7_4 = f"{pc_q35}-rhel7.4.0"
3737
pc_i440fx = "pc-i440fx"
3838
pc_i440fx_rhel7_6 = f"{pc_i440fx}-rhel7.6.0"
39+
s390_ccw_virtio = "s390-ccw-virtio"
40+
s390_ccw_virtio_rhel9_6 = f"{s390_ccw_virtio}-rhel9.6.0"
41+
s390_ccw_virtio_rhel8_6 = f"{s390_ccw_virtio}-rhel8.6.0"
42+
s390_ccw_virtio_rhel7_6 = f"{s390_ccw_virtio}-rhel7.6.0"

tests/virt/node/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
FOUR_GI_MEMORY,
1818
ONE_CPU_CORE,
1919
ONE_CPU_THREAD,
20+
S390X,
2021
TEN_GI_MEMORY,
2122
)
2223
from utilities.jira import is_jira_open
@@ -76,6 +77,7 @@ def hotplugged_vm(
7677
golden_image_data_source_scope_class,
7778
modern_cpu_for_migration,
7879
vmx_disabled_flag,
80+
nodes_cpu_architecture,
7981
):
8082
with VirtualMachineForTestsFromTemplate(
8183
name=request.param["vm_name"],
@@ -85,7 +87,8 @@ def hotplugged_vm(
8587
client=unprivileged_client,
8688
data_source=golden_image_data_source_scope_class,
8789
cpu_max_sockets=EIGHT_CPU_SOCKETS,
88-
memory_max_guest=TEN_GI_MEMORY,
90+
# s390x doesn't support maxGuest as it doesn't support hotplug
91+
memory_max_guest=TEN_GI_MEMORY if nodes_cpu_architecture != S390X else None,
8992
cpu_sockets=FOUR_CPU_SOCKETS,
9093
cpu_threads=ONE_CPU_THREAD,
9194
cpu_cores=ONE_CPU_CORE,

tests/virt/node/cpu_sockets_threads/test_cpu_support_sockets_threads.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,32 @@ def vm_with_cpu_support(request, namespace, unprivileged_client):
4545
[
4646
pytest.param(
4747
{"sockets": 2, "cores": 2, "threads": 2},
48-
marks=(pytest.mark.polarion("CNV-2820"), pytest.mark.gating, pytest.mark.conformance),
48+
marks=(pytest.mark.polarion("CNV-2820"), pytest.mark.gating, pytest.mark.conformance, pytest.mark.x86_64()),
4949
id="case1: 2 cores, 2 threads, 2 sockets",
5050
),
5151
pytest.param(
5252
{"sockets": None, "cores": 1, "threads": 2},
53-
marks=(pytest.mark.polarion("CNV-2823")),
53+
marks=(pytest.mark.polarion("CNV-2823"), pytest.mark.x86_64()),
5454
id="case2: 1 cores, 2 threads, no sockets",
5555
),
56+
pytest.param(
57+
{"sockets": 2, "cores": 2, "threads": 1},
58+
marks=(pytest.mark.gating(), pytest.mark.s390x()),
59+
id="case1: 2 cores, 1 threads, 2 sockets",
60+
),
61+
pytest.param(
62+
{"sockets": None, "cores": 1, "threads": 1},
63+
marks=[pytest.mark.s390x()],
64+
id="case2: 1 cores, 1 threads, no sockets",
65+
),
5666
pytest.param(
5767
{"sockets": 2, "cores": 1, "threads": None},
58-
marks=(pytest.mark.polarion("CNV-2822")),
68+
marks=(pytest.mark.polarion("CNV-2822"), pytest.mark.x86_64(), pytest.mark.s390x()),
5969
id="case3: 1 cores, no threads, 2 sockets",
6070
),
6171
pytest.param(
6272
{"sockets": None, "cores": 2, "threads": None},
63-
marks=(pytest.mark.polarion("CNV-2821")),
73+
marks=(pytest.mark.polarion("CNV-2821"), pytest.mark.x86_64(), pytest.mark.s390x()),
6474
id="case4: 2 cores, no threads, no sockets",
6575
),
6676
],
@@ -97,6 +107,8 @@ def no_cpu_settings_vm(namespace, unprivileged_client):
97107

98108
@pytest.mark.gating
99109
@pytest.mark.conformance
110+
@pytest.mark.x86_64
111+
@pytest.mark.s390x
100112
@pytest.mark.polarion("CNV-1485")
101113
def test_vm_with_no_cpu_settings(no_cpu_settings_vm):
102114
"""
@@ -108,6 +120,8 @@ def test_vm_with_no_cpu_settings(no_cpu_settings_vm):
108120

109121

110122
@pytest.mark.gating
123+
@pytest.mark.x86_64
124+
@pytest.mark.s390x
111125
@pytest.mark.polarion("CNV-2818")
112126
def test_vm_with_cpu_limitation(namespace, unprivileged_client):
113127
"""
@@ -130,6 +144,8 @@ def test_vm_with_cpu_limitation(namespace, unprivileged_client):
130144

131145

132146
@pytest.mark.polarion("CNV-2819")
147+
@pytest.mark.x86_64
148+
@pytest.mark.s390x
133149
def test_vm_with_cpu_limitation_negative(namespace, unprivileged_client):
134150
"""
135151
Test VM with cpu limitation

tests/virt/node/efi_secureboot/test_vm_with_efi_secureboot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
@pytest.mark.gating
1616
@pytest.mark.polarion("CNV-4465")
17+
@pytest.mark.x86_64
1718
def test_efi_secureboot_with_smm_disabled(namespace, unprivileged_client):
1819
"""Test that EFI secureBoot VM with SMM disabled, does not get created"""
1920
with pytest.raises(UnprocessibleEntityError):

tests/virt/node/general/test_custom_selinux_policy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from utilities.infra import ExecCommandOnPod
44

55

6+
@pytest.mark.x86_64
67
@pytest.mark.s390x
78
@pytest.mark.polarion("CNV-9918")
89
def test_customselinuxpolicy(workers_utility_pods, schedulable_nodes):
@@ -12,4 +13,4 @@ def test_customselinuxpolicy(workers_utility_pods, schedulable_nodes):
1213
out = pod_exec.exec(command="sudo semodule -l")
1314
if "virt_launcher" in out:
1415
nodes.append(node.name)
15-
assert not nodes, f"node: {nodes} still have virt-launcher policies."
16+
assert not nodes, f"node: {nodes} still have virt_launcher policies."

tests/virt/node/general/test_disable_pvspinlock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def vm_for_test_pvspinlock(
2020

2121

2222
@pytest.mark.polarion("CNV-6877")
23-
def test_disable_pvcpinlock(vm_for_test_pvspinlock):
23+
@pytest.mark.x86_64
24+
def test_disable_pvspinlock(vm_for_test_pvspinlock):
2425
assert vm_for_test_pvspinlock.privileged_vmi.xml_dict["domain"]["features"]["pvspinlock"]["@state"] == "off", (
2526
"pvspinlock is not disabled in domain xml."
2627
)

tests/virt/node/general/test_disk_io_option.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def disk_options_vm(
6767

6868
@pytest.mark.gating
6969
@pytest.mark.s390x
70+
@pytest.mark.x86_64
7071
@pytest.mark.parametrize(
7172
"golden_image_data_volume_scope_class,",
7273
[
@@ -115,6 +116,7 @@ def test_vm_with_disk_io_option_rhel(
115116

116117

117118
@pytest.mark.tier3
119+
@pytest.mark.x86_64
118120
@pytest.mark.parametrize(
119121
"golden_image_data_volume_scope_class,",
120122
[

tests/virt/node/general/test_legacy_machinetype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def rhel_8_10_vm(unprivileged_client, namespace, rhel_8_10_ds):
8888
)
8989
],
9090
)
91+
@pytest.mark.x86_64 # no legacy machinetype for s390x which is different from emulated machine types
9192
def test_legacy_machine_type(
9293
updated_hco_emulated_machine_i440fx,
9394
rhel_8_10_vm,

0 commit comments

Comments
 (0)