U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Michal Simek <michal.simek@amd.com>
Subject: Re: [PATCH 2/3] tpm: Convert sandbox-focussed tests to C
Date: Sun, 29 Oct 2023 10:33:34 -0400	[thread overview]
Message-ID: <20231029143334.GS496310@bill-the-cat> (raw)
In-Reply-To: <20231029172813.2.I8ff77e0c1288f6a4da564e9454eb223f72809839@changeid>

[-- Attachment #1: Type: text/plain, Size: 2735 bytes --]

On Sun, Oct 29, 2023 at 05:28:13PM +1300, Simon Glass wrote:

> Some of the Python tests are a pain because they don't reset the TPM
> state before each test. Driver model tests do this, so convert the
> tests to C.
> 
> This means that these tests won't run on real hardware, but we have
> tests which do TPM init, so there is still enough coverage.
> 
> Rename and update the Python tpm_init test to use 'tpm autostart',
> since this deals with starting up ready for the tests below.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

I worry that we're removing maybe a few too many of the tests we can be
used on real HW (and QEMU, another real use case) in favor of just
testing them on sandbox. We can certainly have parallel sandbox-only
test paths.

[snip]
> @@ -92,46 +79,6 @@ def tpm2_sandbox_init(u_boot_console):
>      if skip_test:
>          pytest.skip('skip TPM device test')
>  
> -@pytest.mark.buildconfigspec('cmd_tpm_v2')
> -def test_tpm2_sandbox_self_test_full(u_boot_console):
> -    """Execute a TPM2_SelfTest (full) command.
> -
> -    Ask the TPM to perform all self tests to also enable full capabilities.
> -    """
> -    if is_sandbox(u_boot_console):
> -        u_boot_console.restart_uboot()
> -        u_boot_console.run_command('tpm2 init')
> -        output = u_boot_console.run_command('echo $?')
> -        assert output.endswith('0')
> -
> -        u_boot_console.run_command('tpm2 startup TPM2_SU_CLEAR')
> -        output = u_boot_console.run_command('echo $?')
> -        assert output.endswith('0')
> -
> -    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')
> -
> -@pytest.mark.buildconfigspec('cmd_tpm_v2')
> -def test_tpm2_continue_self_test(u_boot_console):
> -    """Execute a TPM2_SelfTest (continued) command.
> -
> -    Ask the TPM to finish its self tests (alternative to the full test) in order
> -    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')
> -    if is_sandbox(u_boot_console):
> -        tpm2_sandbox_init(u_boot_console)
> -    u_boot_console.run_command('tpm2 self_test continue')
> -    output = u_boot_console.run_command('echo $?')
> -    assert output.endswith('0')
> -

I would think these are useful cases to check outside of sandbox. But
I'll let Ilias chime in as I'm just assuming.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2023-10-29 14:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  4:28 [PATCH 0/3] tpm: Start to tidy up TPM tests Simon Glass
2023-10-29  4:28 ` [PATCH 1/3] tpm: sandbox: Support self-test continue in emulator Simon Glass
2023-10-30  8:53   ` Ilias Apalodimas
2023-10-29  4:28 ` [PATCH 2/3] tpm: Convert sandbox-focussed tests to C Simon Glass
2023-10-29 14:33   ` Tom Rini [this message]
2023-10-30 11:40     ` Ilias Apalodimas
2023-10-30 11:41   ` Ilias Apalodimas
2023-10-29  4:28 ` [PATCH 3/3] tpm: Drop unwanted special cases for sandbox Simon Glass
2023-10-30 11:42   ` Ilias Apalodimas
2023-10-30 11:43 ` [PATCH 0/3] tpm: Start to tidy up TPM tests Ilias Apalodimas

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=20231029143334.GS496310@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=michal.simek@amd.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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