public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Cc: Shuah Khan <shuah@kernel.org>,
	kernel@collabora.com, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] selftests/tpm2: Split async tests call to separate shell script runner
Date: Thu, 8 Dec 2022 07:52:47 +0000	[thread overview]
Message-ID: <Y5GXzyyc7cVhA48/@kernel.org> (raw)
In-Reply-To: <20221128220340.536558-1-nfraprado@collabora.com>

On Mon, Nov 28, 2022 at 05:03:40PM -0500, Nícolas F. R. A. Prado wrote:
> 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 8335adb8f9d3 ("selftests: tpm:
> add async space test with noneexisting handle") added a test that relies
> on it.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>


[nix-shell:~/linux-tpmdd]$ sudo make -C tools/testing/selftests TARGETS=tpm2 run_tests
make: Entering directory '/home/nixos/linux-tpmdd/tools/testing/selftests'
make[1]: Entering directory '/home/nixos/linux-tpmdd/tools/testing/selftests/tpm2'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/nixos/linux-tpmdd/tools/testing/selftests/tpm2'
make[1]: Entering directory '/home/nixos/linux-tpmdd/tools/testing/selftests/tpm2'
TAP version 13
1..3
# selftests: tpm2: test_smoke.sh
# test_read_partial_overwrite (tpm2_tests.SmokeTest) ... ok
# test_read_partial_resp (tpm2_tests.SmokeTest) ... ok
# test_seal_with_auth (tpm2_tests.SmokeTest) ... ok
# test_seal_with_policy (tpm2_tests.SmokeTest) ... ok
# test_seal_with_too_long_auth (tpm2_tests.SmokeTest) ... ok
# test_send_two_cmds (tpm2_tests.SmokeTest) ... ok
# test_too_short_cmd (tpm2_tests.SmokeTest) ... ok
# test_unseal_with_wrong_auth (tpm2_tests.SmokeTest) ... ok
# test_unseal_with_wrong_policy (tpm2_tests.SmokeTest) ... ok
#
# ----------------------------------------------------------------------
# Ran 9 tests in 82.385s
#
# OK
ok 1 selftests: tpm2: test_smoke.sh
# selftests: tpm2: test_space.sh
# test_flush_context (tpm2_tests.SpaceTest) ... ok
# test_get_handles (tpm2_tests.SpaceTest) ... ok
# test_invalid_cc (tpm2_tests.SpaceTest) ... ok
# test_make_two_spaces (tpm2_tests.SpaceTest) ... ok
#
# ----------------------------------------------------------------------
# Ran 4 tests in 73.287s
#
# OK
ok 2 selftests: tpm2: test_space.sh
# selftests: tpm2: test_async.sh
# test_async (tpm2_tests.AsyncTest) ... ok
# test_flush_invalid_context (tpm2_tests.AsyncTest) ... ok
#
# ----------------------------------------------------------------------
# Ran 2 tests in 0.018s
#
# OK
ok 3 selftests: tpm2: test_async.sh
make[1]: Leaving directory '/home/nixos/linux-tpmdd/tools/testing/selftests/tpm2'
make: Leaving directory '/home/nixos/linux-tpmdd/tools/testing/selftests'

[nix-shell:~/linux-tpmdd]$ lsmod|grep tpm
tpm_crb                20480  0
tpm_tis                16384  0
tpm_tis_core           32768  1 tpm_tis
tpm                    94208  3 tpm_tis,tpm_crb,tpm_tis_core
rng_core               20480  1 tpm

LGTM, thanks!

Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

      parent reply	other threads:[~2022-12-08  7:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 22:03 [PATCH] selftests/tpm2: Split async tests call to separate shell script runner Nícolas F. R. A. Prado
2022-11-29 21:45 ` Shuah Khan
2022-12-08  7:52 ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5GXzyyc7cVhA48/@kernel.org \
    --to=jarkko@kernel.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=nfraprado@collabora.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox