Commit 8008d88e authored by Nícolas F. R. A. Prado's avatar Nícolas F. R. A. Prado Committed by Shuah Khan

selftests/tpm2: Split async tests call to separate shell script runner

When the async test case was introduced, despite being a completely
independent test case, the command to run it was added to the same shell
script as the smoke test case. Since a shell script implicitly returns
the error code from the last run command, this effectively caused the
script to only return as error code the result from the async test case,
hiding the smoke test result (which could then only be seen from the
python unittest logs).

Move the async test case call to its own shell script runner to avoid
the aforementioned issue. This also makes the output clearer to read,
since each kselftest KTAP result now matches with one python unittest
report.

While at it, also make it so the async test case is skipped if
/dev/tpmrm0 doesn't exist, since commit 8335adb8 ("selftests: tpm:
add async space test with noneexisting handle") added a test that relies
on it.
Signed-off-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 177f504c
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
include ../lib.mk include ../lib.mk
TEST_PROGS := test_smoke.sh test_space.sh TEST_PROGS := test_smoke.sh test_space.sh test_async.sh
TEST_PROGS_EXTENDED := tpm2.py tpm2_tests.py TEST_PROGS_EXTENDED := tpm2.py tpm2_tests.py
#!/bin/sh
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
[ -e /dev/tpm0 ] || exit $ksft_skip
[ -e /dev/tpmrm0 ] || exit $ksft_skip
python3 -m unittest -v tpm2_tests.AsyncTest
...@@ -7,4 +7,3 @@ ksft_skip=4 ...@@ -7,4 +7,3 @@ ksft_skip=4
[ -e /dev/tpm0 ] || exit $ksft_skip [ -e /dev/tpm0 ] || exit $ksft_skip
python3 -m unittest -v tpm2_tests.SmokeTest python3 -m unittest -v tpm2_tests.SmokeTest
python3 -m unittest -v tpm2_tests.AsyncTest
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment