Skip to content

Commit

Permalink
ci(cross-kernel): use CPU templates functions
Browse files Browse the repository at this point in the history
Re-use the logic that other tests use to get the list of templates.

This starts testing T2A and T2CL templates when applicable.

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Jun 5, 2024
1 parent 931a6ef commit e3893d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import logging
import platform
from pathlib import Path

import pytest
Expand All @@ -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,
Expand Down Expand Up @@ -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()
Expand Down
15 changes: 8 additions & 7 deletions tools/create_snapshot_artifact/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import os
import platform
import re
import shutil
import sys
Expand All @@ -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.
Expand Down Expand Up @@ -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_kernel_supported_1>_<cpu_template>_guest_snapshot
|
...
Expand All @@ -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-*"):
Expand Down

0 comments on commit e3893d3

Please sign in to comment.