From 577e45f36f7602905ea9fff3f7f14c33cc60e689 Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Fri, 23 Jul 2021 06:18:26 -0600 Subject: test/py: tpm2: Skip tpm pytest based on env variable Tpm test cases relies on tpm device setup. Provide an environment variable "env__tpm_device_test_skip = True" to skip the test case if tpm device is not present. Only needed will have to add variable to the py-test framework. Test runs successfully even this variable is absent. Signed-off-by: T Karthik Reddy Signed-off-by: Ashok Reddy Soma Acked-by: Ilias Apalodimas --- test/py/tests/test_tpm2.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py index ac04f71..c7a9dc1 100644 --- a/test/py/tests/test_tpm2.py +++ b/test/py/tests/test_tpm2.py @@ -18,6 +18,15 @@ any password. * Commands like pcr_setauthpolicy and pcr_resetauthpolicy are not implemented here because they would fail the tests in most cases (TPMs do not implement them and return an error). + + +Note: +This test doesn't rely on boardenv_* configuration value but can change test +behavior. + +* Setup env__tpm_device_test_skip to True if tests with TPM devices should be +skipped. + """ updates = 0 @@ -29,6 +38,9 @@ def force_init(u_boot_console, force=False): twice will spawn an error used to detect that the TPM was not reset and no initialization code should be run. """ + skip_test = u_boot_console.config.env.get('env__tpm_device_test_skip', False) + if skip_test: + pytest.skip('skip TPM device test') output = u_boot_console.run_command('tpm2 init') if force or not 'Error' in output: u_boot_console.run_command('echo --- start of init ---') @@ -44,6 +56,10 @@ def force_init(u_boot_console, force=False): def test_tpm2_init(u_boot_console): """Init the software stack to use TPMv2 commands.""" + 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 init') output = u_boot_console.run_command('echo $?') assert output.endswith('0') @@ -55,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') @@ -66,6 +85,9 @@ def test_tpm2_self_test_full(u_boot_console): Ask the TPM to perform all self tests to also enable full capabilities. """ + 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 self_test full') output = u_boot_console.run_command('echo $?') assert output.endswith('0') @@ -78,6 +100,9 @@ def test_tpm2_continue_self_test(u_boot_console): to enter a fully operational state. """ + 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 self_test continue') output = u_boot_console.run_command('echo $?') assert output.endswith('0') @@ -95,6 +120,9 @@ def test_tpm2_clear(u_boot_console): PLATFORM hierarchies are also available. """ + 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 clear TPM2_RH_LOCKOUT') output = u_boot_console.run_command('echo $?') assert output.endswith('0') -- cgit v1.1 From 66fd01fe5935d4be5f556f67284efb1b67fa4143 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Fri, 17 Sep 2021 14:27:13 +0300 Subject: net: update NXP copyright text NXP Legal insists that the following are not fine: - Saying "NXP Semiconductors" instead of "NXP", since the company's registered name is "NXP" - Putting a "(c)" sign in the copyright string - Putting a comma in the copyright string The only accepted copyright string format is "Copyright NXP". This patch changes the copyright headers in the networking files that were sent by me, or derived from code sent by me. Signed-off-by: Vladimir Oltean Reviewed-by: Ramon Fried --- test/dm/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/dm/dsa.c b/test/dm/dsa.c index 18c1776..c857106 100644 --- a/test/dm/dsa.c +++ b/test/dm/dsa.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright 2020-2021 NXP Semiconductors + * Copyright 2020-2021 NXP */ #include -- cgit v1.1