Skip to content

Commit

Permalink
tests: add test to check tdx flag in CPU info (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
hector-cao authored Oct 10, 2024
1 parent 39cce6b commit d9d2dbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/lib/tdx-tools/src/tdxtools/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
8 changes: 8 additions & 0 deletions tests/tests/test_host_tdx_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():

Expand Down

0 comments on commit d9d2dbb

Please sign in to comment.