@@ -628,7 +628,7 @@ def test_cpu_cpuid_restore(microvm_factory, guest_kernel, msr_cpu_template):
628628 PLATFORM != "x86_64" , reason = "CPU features are masked only on x86_64."
629629)
630630@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 ):
632632 """
633633 Test masked and enabled cpu features against the expected template.
634634
@@ -657,6 +657,15 @@ def test_cpu_template(test_microvm_with_api, cpu_template):
657657 check_masked_features (test_microvm , cpu_template )
658658 check_enabled_features (test_microvm , cpu_template )
659659
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+
660669
661670def check_masked_features (test_microvm , cpu_template ):
662671 """Verify the masked features of the given template."""
0 commit comments