Skip to content

Commit 2d0d509

Browse files
committed
test: enable ARM CPU template tests
This enables the tests that are not currently on CI. We should enable them only in Linux 6.1 since they won't work in any other kernel. Fixes: c358311 Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
1 parent b449122 commit 2d0d509

File tree

6 files changed

+11
-26
lines changed

6 files changed

+11
-26
lines changed

tests/framework/properties.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def __init__(self):
9595
self.instance = "NA"
9696
self.ami = "NA"
9797

98+
@property
99+
def host_linux_version_tpl(self):
100+
"""Host Linux version major.minor, as a tuple for easy comparison"""
101+
return tuple(int(x) for x in self.host_linux_version.split("."))
102+
98103
@property
99104
def is_ec2(self):
100105
"""Are we running on an EC2 instance?"""

tests/framework/utils_cpu_templates.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ def get_supported_cpu_templates():
2323
"""
2424
Return the list of CPU templates supported by the platform.
2525
"""
26+
# pylint:disable=too-many-return-statements
2627
match cpuid_utils.get_cpu_vendor():
2728
case cpuid_utils.CpuVendor.INTEL:
2829
# T2CL template is only supported on Cascade Lake and newer CPUs.
29-
3030
if global_props.cpu_codename == cpuid_utils.CpuModel.INTEL_SKYLAKE:
3131
return sorted(set(INTEL_TEMPLATES) - set(["T2CL"]))
3232
return INTEL_TEMPLATES
3333
case cpuid_utils.CpuVendor.AMD:
3434
return AMD_TEMPLATES
3535
case cpuid_utils.CpuVendor.ARM:
36+
if global_props.host_linux_version_tpl < (6, 1):
37+
return []
3638
match global_props.cpu_model:
3739
case cpuid_utils.CpuModel.ARM_NEOVERSE_N1:
3840
return []
@@ -59,13 +61,14 @@ def get_supported_custom_cpu_templates():
5961
match cpuid_utils.get_cpu_vendor():
6062
case cpuid_utils.CpuVendor.INTEL:
6163
# T2CL template is only supported on Cascade Lake and newer CPUs.
62-
skylake_model = "Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz"
63-
if global_props.cpu_model == skylake_model:
64+
if global_props.cpu_codename == cpuid_utils.CpuModel.INTEL_SKYLAKE:
6465
return set(INTEL_TEMPLATES) - {"T2CL"}
6566
return INTEL_TEMPLATES
6667
case cpuid_utils.CpuVendor.AMD:
6768
return AMD_TEMPLATES
6869
case cpuid_utils.CpuVendor.ARM:
70+
if global_props.host_linux_version_tpl < (6, 1):
71+
return []
6972
match global_props.cpu_model:
7073
case cpuid_utils.CpuModel.ARM_NEOVERSE_N1:
7174
return AARCH64_CUSTOM_CPU_TEMPLATES_G2
@@ -87,10 +90,3 @@ def static_cpu_templates_params():
8790
"""Return Static CPU templates as pytest parameters"""
8891
for name in sorted(get_supported_cpu_templates()):
8992
yield pytest.param(name, id="static_" + name)
90-
91-
92-
def nonci_on_arm(func):
93-
"""Temporary decorator used to mark specific cpu template related tests as nonci on ARM platforms"""
94-
if cpuid_utils.get_cpu_vendor() == cpuid_utils.CpuVendor.ARM:
95-
return pytest.mark.nonci(func)
96-
return func

tests/integration_tests/functional/test_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import host_tools.network as net_tools
1919
from framework import utils_cpuid
2020
from framework.utils import get_firecracker_version_from_toml, is_io_uring_supported
21-
from framework.utils_cpu_templates import nonci_on_arm
2221

2322
MEM_LIMIT = 1000000000
2423

@@ -462,7 +461,6 @@ def test_negative_machine_config_api(test_microvm_with_api):
462461
)
463462

464463

465-
@nonci_on_arm
466464
def test_api_cpu_config(test_microvm_with_api, custom_cpu_template):
467465
"""
468466
Test /cpu-config PUT scenarios.

tests/integration_tests/functional/test_cpu_features_aarch64.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pytest
99

1010
import framework.utils_cpuid as cpuid_utils
11-
from framework.utils_cpu_templates import nonci_on_arm
1211
from framework.utils_cpuid import CpuModel
1312

1413
PLATFORM = platform.machine()
@@ -94,7 +93,6 @@ def test_default_cpu_features(microvm_factory, guest_kernel, rootfs_ubuntu_22):
9493
PLATFORM != "aarch64",
9594
reason="This is aarch64 specific test.",
9695
)
97-
@nonci_on_arm
9896
def test_cpu_features_with_static_template(
9997
microvm_factory, guest_kernel, rootfs_ubuntu_22, cpu_template
10098
):
@@ -115,7 +113,6 @@ def test_cpu_features_with_static_template(
115113
PLATFORM != "aarch64",
116114
reason="This is aarch64 specific test.",
117115
)
118-
@nonci_on_arm
119116
def test_cpu_features_with_custom_template(
120117
microvm_factory, guest_kernel, rootfs_ubuntu_22, custom_cpu_template
121118
):

tests/integration_tests/functional/test_cpu_template_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from framework import utils
1212
from framework.defs import SUPPORTED_HOST_KERNELS
1313
from framework.properties import global_props
14-
from framework.utils_cpu_templates import nonci_on_arm
1514
from framework.utils_cpuid import get_guest_cpuid
1615
from host_tools import cargo_build
1716

@@ -405,7 +404,6 @@ def test_guest_cpu_config_change(
405404
)
406405

407406

408-
@nonci_on_arm
409407
def test_json_static_templates(
410408
test_microvm_with_api, cpu_template_helper, tmp_path, custom_cpu_template
411409
):

tests/integration_tests/security/test_vulnerabilities.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
)
2121
from framework.properties import global_props
2222
from framework.utils import CommandReturn
23-
from framework.utils_cpu_templates import nonci_on_arm
2423

2524
CHECKER_URL = "https://meltdown.ovh"
2625
CHECKER_FILENAME = "spectre-meltdown-checker.sh"
@@ -299,7 +298,6 @@ def test_spectre_meltdown_checker_on_restored_guest(
299298
global_props.instance == "c7g.metal" and global_props.host_linux_version == "4.14",
300299
reason="c7g host 4.14 requires modifications to the 5.10 guest kernel to boot successfully.",
301300
)
302-
@nonci_on_arm
303301
def test_spectre_meltdown_checker_on_guest_with_template(
304302
spectre_meltdown_checker, build_microvm_with_template
305303
):
@@ -320,7 +318,6 @@ def test_spectre_meltdown_checker_on_guest_with_template(
320318
global_props.instance == "c7g.metal" and global_props.host_linux_version == "4.14",
321319
reason="c7g host 4.14 requires modifications to the 5.10 guest kernel to boot successfully.",
322320
)
323-
@nonci_on_arm
324321
def test_spectre_meltdown_checker_on_guest_with_custom_template(
325322
spectre_meltdown_checker, build_microvm_with_custom_template
326323
):
@@ -340,7 +337,6 @@ def test_spectre_meltdown_checker_on_guest_with_custom_template(
340337
global_props.instance == "c7g.metal" and global_props.host_linux_version == "4.14",
341338
reason="c7g host 4.14 requires modifications to the 5.10 guest kernel to boot successfully.",
342339
)
343-
@nonci_on_arm
344340
def test_spectre_meltdown_checker_on_restored_guest_with_template(
345341
spectre_meltdown_checker, build_microvm_with_template, microvm_factory
346342
):
@@ -363,7 +359,6 @@ def test_spectre_meltdown_checker_on_restored_guest_with_template(
363359
global_props.instance == "c7g.metal" and global_props.host_linux_version == "4.14",
364360
reason="c7g host 4.14 requires modifications to the 5.10 guest kernel to boot successfully.",
365361
)
366-
@nonci_on_arm
367362
def test_spectre_meltdown_checker_on_restored_guest_with_custom_template(
368363
spectre_meltdown_checker,
369364
build_microvm_with_custom_template,
@@ -506,15 +501,13 @@ def test_vulnerabilities_files_on_restored_guest(build_microvm, microvm_factory)
506501
check_vulnerabilities_files_ab(with_restore(build_microvm, microvm_factory))
507502

508503

509-
@nonci_on_arm
510504
def test_vulnerabilities_files_on_guest_with_template(build_microvm_with_template):
511505
"""
512506
Test vulnerabilities files on guest with CPU template.
513507
"""
514508
check_vulnerabilities_files_ab(build_microvm_with_template)
515509

516510

517-
@nonci_on_arm
518511
def test_vulnerabilities_files_on_guest_with_custom_template(
519512
build_microvm_with_custom_template,
520513
):
@@ -524,7 +517,6 @@ def test_vulnerabilities_files_on_guest_with_custom_template(
524517
check_vulnerabilities_files_ab(build_microvm_with_custom_template)
525518

526519

527-
@nonci_on_arm
528520
def test_vulnerabilities_files_on_restored_guest_with_template(
529521
build_microvm_with_template, microvm_factory
530522
):
@@ -536,7 +528,6 @@ def test_vulnerabilities_files_on_restored_guest_with_template(
536528
)
537529

538530

539-
@nonci_on_arm
540531
def test_vulnerabilities_files_on_restored_guest_with_custom_template(
541532
build_microvm_with_custom_template, microvm_factory, custom_cpu_template
542533
):

0 commit comments

Comments
 (0)