diff --git a/tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py b/tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py index 2de63d3d36a..be172cfb32d 100644 --- a/tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py +++ b/tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py @@ -5,6 +5,7 @@ import json import logging +import platform from pathlib import Path import pytest @@ -16,7 +17,7 @@ guest_run_fio_iteration, populate_data_store, ) -from framework.utils_cpuid import CpuVendor, get_cpu_vendor +from framework.utils_cpu_templates import get_supported_cpu_templates from framework.utils_vsock import check_vsock_device from integration_tests.functional.test_balloon import ( get_stable_rss_mem_by_pid, @@ -74,9 +75,10 @@ def get_snapshot_dirs(): """Get all the snapshot directories""" snapshot_root_name = "snapshot_artifacts" snapshot_root_dir = Path(FC_WORKSPACE_DIR) / snapshot_root_name - cpu_templates = ["C3", "T2", "T2S", "None"] - if get_cpu_vendor() != CpuVendor.INTEL: + cpu_templates = [] + if platform.machine() == "x86_64": cpu_templates = ["None"] + cpu_templates += get_supported_cpu_templates() for cpu_template in cpu_templates: for snapshot_dir in snapshot_root_dir.glob(f"*_{cpu_template}_guest_snapshot"): assert snapshot_dir.is_dir() diff --git a/tools/create_snapshot_artifact/main.py b/tools/create_snapshot_artifact/main.py index ae54fb8080c..3bf7b6d9e9f 100755 --- a/tools/create_snapshot_artifact/main.py +++ b/tools/create_snapshot_artifact/main.py @@ -5,6 +5,7 @@ import json import os +import platform import re import shutil import sys @@ -21,10 +22,9 @@ generate_mmds_get_request, generate_mmds_session_token, ) -from framework.utils_cpuid import CpuVendor, get_cpu_vendor +from framework.utils_cpu_templates import get_supported_cpu_templates from host_tools.cargo_build import get_firecracker_binaries - # pylint: enable=wrong-import-position # Default IPv4 address to route MMDS requests. @@ -78,8 +78,8 @@ def main(): | -> vm.mem -> vm.vmstate - -> ubuntu-18.04.id_rsa - -> ubuntu-18.04.ext4 + -> ubuntu-22.04.id_rsa + -> ubuntu-22.04.ext4 -> __guest_snapshot | ... @@ -90,9 +90,10 @@ def main(): shutil.rmtree(SNAPSHOT_ARTIFACTS_ROOT_DIR, ignore_errors=True) vm_factory = MicroVMFactory(*get_firecracker_binaries()) - cpu_templates = ["None"] - if get_cpu_vendor() == CpuVendor.INTEL: - cpu_templates.extend(["C3", "T2", "T2S"]) + cpu_templates = [] + if platform.machine() == "x86_64": + cpu_templates = ["None"] + cpu_templates += get_supported_cpu_templates() for cpu_template in cpu_templates: for kernel in kernels(glob="vmlinux-*"):