diff --git a/microsoft/testsuites/cvm/cvm_attestation.py b/microsoft/testsuites/cvm/cvm_attestation.py index 9c5fd68eb7..51b4ecc211 100644 --- a/microsoft/testsuites/cvm/cvm_attestation.py +++ b/microsoft/testsuites/cvm/cvm_attestation.py @@ -16,7 +16,8 @@ from lisa.operating_system import Ubuntu from lisa.sut_orchestrator import AZURE from lisa.testsuite import TestResult, simple_requirement -from lisa.tools import Ls +from lisa.tools import Ls, Lscpu +from lisa.tools.lscpu import CpuType from lisa.util import SkippedException, UnsupportedDistroException from microsoft.testsuites.cvm.cvm_attestation_tool import ( AzureCVMAttestationTests, @@ -61,6 +62,10 @@ def verify_azure_cvm_attestation_report( result: TestResult, variables: Dict[str, Any], ) -> None: + if node.tools[Lscpu].get_cpu_type() != CpuType.AMD: + raise SkippedException( + "CVM attestation report supports only SEV-SNP (AMD) CPU." + ) node.tools[AzureCVMAttestationTests].run_cvm_attestation( result, environment, @@ -105,6 +110,10 @@ def verify_nested_cvm_attestation_report( result: TestResult, variables: Dict[str, Any], ) -> None: + if node.tools[Lscpu].get_cpu_type() != CpuType.AMD: + raise SkippedException( + "CVM attestation report supports only SEV-SNP (AMD) CPU." + ) host_data = variables.get("host_data", "") if not host_data: raise SkippedException("host_data is empty")