@@ -628,7 +628,7 @@ def test_cpu_cpuid_restore(microvm_factory, guest_kernel, msr_cpu_template):
628
628
PLATFORM != "x86_64" , reason = "CPU features are masked only on x86_64."
629
629
)
630
630
@pytest .mark .parametrize ("cpu_template" , ["T2" , "T2S" , "C3" ])
631
- def test_cpu_template (test_microvm_with_api , cpu_template ):
631
+ def test_cpu_template (test_microvm_with_api , cpu_template , microvm_factory ):
632
632
"""
633
633
Test masked and enabled cpu features against the expected template.
634
634
@@ -657,6 +657,15 @@ def test_cpu_template(test_microvm_with_api, cpu_template):
657
657
check_masked_features (test_microvm , cpu_template )
658
658
check_enabled_features (test_microvm , cpu_template )
659
659
660
+ # Check that cpu features are still correct
661
+ # after snap/restore cycle.
662
+ snapshot = test_microvm .snapshot_full ()
663
+ restored_vm = microvm_factory .build ()
664
+ restored_vm .spawn ()
665
+ restored_vm .restore_from_snapshot (snapshot , resume = True )
666
+ check_masked_features (restored_vm , cpu_template )
667
+ check_enabled_features (restored_vm , cpu_template )
668
+
660
669
661
670
def check_masked_features (test_microvm , cpu_template ):
662
671
"""Verify the masked features of the given template."""
0 commit comments