diff --git a/tests/lib/tdx-tools/src/tdxtools/host.py b/tests/lib/tdx-tools/src/tdxtools/host.py index ff19c270..38fbdb9b 100644 --- a/tests/lib/tdx-tools/src/tdxtools/host.py +++ b/tests/lib/tdx-tools/src/tdxtools/host.py @@ -25,7 +25,7 @@ def support_tdx(): """ Check whether support TDX in CPU info """ - return 'tdx' in cpuinfo.get_cpu_info()['flags'] + return 'tdx_host_platform' in cpuinfo.get_cpu_info()['flags'] def support_sgx(): diff --git a/tests/tests/test_host_tdx_software.py b/tests/tests/test_host_tdx_software.py index 6da83330..c7c30bf1 100644 --- a/tests/tests/test_host_tdx_software.py +++ b/tests/tests/test_host_tdx_software.py @@ -19,6 +19,14 @@ import re import subprocess +import tdxtools + +def test_host_tdx_cpu(): + """ + Check that the CPU has TDX support enabled + (the flag tdx_host_platform is present) + """ + assert tdxtools.host.support_tdx() def test_host_tdx_software():