|
20 | 20 | import framework.utils_cpuid as cpuid_utils |
21 | 21 | from framework import utils |
22 | 22 | from framework.defs import SUPPORTED_HOST_KERNELS |
| 23 | +from framework.microvm import SnapshotType |
23 | 24 | from framework.properties import global_props |
24 | 25 | from framework.utils_cpu_templates import SUPPORTED_CPU_TEMPLATES |
25 | 26 |
|
@@ -628,7 +629,7 @@ def test_cpu_cpuid_restore(microvm_factory, guest_kernel, msr_cpu_template): |
628 | 629 | PLATFORM != "x86_64", reason="CPU features are masked only on x86_64." |
629 | 630 | ) |
630 | 631 | @pytest.mark.parametrize("cpu_template", ["T2", "T2S", "C3"]) |
631 | | -def test_cpu_template(test_microvm_with_api, cpu_template): |
| 632 | +def test_cpu_template(test_microvm_with_api, cpu_template, microvm_factory): |
632 | 633 | """ |
633 | 634 | Test masked and enabled cpu features against the expected template. |
634 | 635 |
|
@@ -657,6 +658,13 @@ def test_cpu_template(test_microvm_with_api, cpu_template): |
657 | 658 | check_masked_features(test_microvm, cpu_template) |
658 | 659 | check_enabled_features(test_microvm, cpu_template) |
659 | 660 |
|
| 661 | + snapshot = test_microvm.make_snapshot(SnapshotType.FULL) |
| 662 | + restored_vm = microvm_factory.build() |
| 663 | + restored_vm.spawn() |
| 664 | + restored_vm.restore_from_snapshot(snapshot, resume=True) |
| 665 | + check_masked_features(restored_vm, cpu_template) |
| 666 | + check_enabled_features(restored_vm, cpu_template) |
| 667 | + |
660 | 668 |
|
661 | 669 | def check_masked_features(test_microvm, cpu_template): |
662 | 670 | """Verify the masked features of the given template.""" |
|
0 commit comments