Skip to content

Commit cd2013b

Browse files
committed
feat(cpu-features-aarch64): add after snaphot test
Add verification of cpu features after loading a snapshot of a vm with cpu-template applied. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent 1e2abcf commit cd2013b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/integration_tests/functional/test_cpu_features_aarch64.py

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

1010
import framework.utils_cpuid as cpuid_utils
11+
from framework.microvm import SnapshotType
1112
from framework.utils_cpuid import CpuModel
1213

1314
PLATFORM = platform.machine()
@@ -108,6 +109,12 @@ def test_cpu_features_with_static_template(
108109
guest_kv = re.search(r"vmlinux-(\d+\.\d+)", guest_kernel.name).group(1)
109110
_check_cpu_features_arm(vm, guest_kv, "v1n1")
110111

112+
snapshot = vm.make_snapshot(SnapshotType.FULL)
113+
restored_vm = microvm_factory.build()
114+
restored_vm.spawn()
115+
restored_vm.restore_from_snapshot(snapshot, resume=True)
116+
_check_cpu_features_arm(restored_vm, guest_kv, "v1n1")
117+
111118

112119
@pytest.mark.skipif(
113120
PLATFORM != "aarch64",
@@ -128,3 +135,9 @@ def test_cpu_features_with_custom_template(
128135
vm.start()
129136
guest_kv = re.search(r"vmlinux-(\d+\.\d+)", guest_kernel.name).group(1)
130137
_check_cpu_features_arm(vm, guest_kv, custom_cpu_template["name"])
138+
139+
snapshot = vm.make_snapshot(SnapshotType.FULL)
140+
restored_vm = microvm_factory.build()
141+
restored_vm.spawn()
142+
restored_vm.restore_from_snapshot(snapshot, resume=True)
143+
_check_cpu_features_arm(restored_vm, guest_kv, custom_cpu_template["name"])

0 commit comments

Comments
 (0)