]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test/py: tpm2: skip tpm2_startup when env__tpm_device_test_skip=True
authorMichal Simek <michal.simek@amd.com>
Wed, 30 Aug 2023 16:36:23 +0000 (18:36 +0200)
committerMichal Simek <michal.simek@amd.com>
Thu, 21 Sep 2023 11:20:11 +0000 (13:20 +0200)
All tpm2 tests should be possible to skip when
env__tpm_device_test_skip=True but test_tpm2_startup is missing it.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/41f932e52bdd206b1b68d5ff313fc29b794a70e7.1693413381.git.michal.simek@amd.com
test/py/tests/test_tpm2.py

index fce689cd992d4def8a5d402bbb190ee10ebe75ee..c2579fa02c58deb386add444944738d659ba7474 100644 (file)
@@ -71,6 +71,9 @@ def test_tpm2_startup(u_boot_console):
 
     Initiate the TPM internal state machine.
     """
+    skip_test = u_boot_console.config.env.get('env__tpm_device_test_skip', False)
+    if skip_test:
+        pytest.skip('skip TPM device test')
     u_boot_console.run_command('tpm2 startup TPM2_SU_CLEAR')
     output = u_boot_console.run_command('echo $?')
     assert output.endswith('0')