From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 310F3C433EF for ; Mon, 15 Nov 2021 17:21:12 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 359586120F for ; Mon, 15 Nov 2021 17:21:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 359586120F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC4DC836BB; Mon, 15 Nov 2021 18:21:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="vZ+3Y/yE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD2D0836E4; Mon, 15 Nov 2021 18:21:06 +0100 (CET) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8362836A1 for ; Mon, 15 Nov 2021 18:21:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-88-152-144-157.hsi03.unitymediagroup.de [88.152.144.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 6FD65411A5; Mon, 15 Nov 2021 17:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636996863; bh=YWSRAxViRk1COKyfB+Q1dof3EplUSjk3pv/HgVVdVmI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=vZ+3Y/yEtRkyxJ1BwBuNi5A9DgSPaOSq2FablAvPZKts3DRUskTDX4DboVuVdqjdf JqgEvN6l4+cDHmBFBx4yRAlW8ppT8rRDjp91+qAUiIn1EMsagFLR7koo6//xIz/aZt rsEhkk1TolJDXBzj41Rji1I5dJWGSb/0avWRTNeSG1sx0KuE2sNMAqv5Wo9aaGN+Y3 oPJZb0TP17VqcUt6acS3WIFq7o820qY0Q3sAwUuYZojwuJrF8Ka99kMdSv14WqbSR1 kK9phOk+D0ha2UTJ00nSjqQy01jQ1ABbSXaGHIdEl9sIFyMPcMaYYbxCFc8ky2V4pJ 7+JL16+ADNKFA== From: Heinrich Schuchardt To: Ilias Apalodimas Cc: Alexander Graf , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] test: unit test for the EFI_TCG2_PROTOCOL Date: Mon, 15 Nov 2021 18:21:02 +0100 Message-Id: <20211115172102.192613-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Encapsulate the UEFI EFI_TCG2_PROTOCOL unit test in an Python test. Signed-off-by: Heinrich Schuchardt --- This patch should be merged after [PATCH 1/1] tpm: clear state post probing https://lists.denx.de/pipermail/u-boot/2021-November/467308.html [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation https://lists.denx.de/pipermail/u-boot/2021-November/467265.html --- test/py/tests/test_efi_selftest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index 63218efbc2..08d4e40537 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -212,3 +212,23 @@ def test_efi_selftest_text_input_ex(u_boot_console): if m != 0: raise Exception('Failures occurred during the EFI selftest') u_boot_console.restart_uboot() + +@pytest.mark.buildconfigspec('cmd_bootefi_selftest') +@pytest.mark.buildconfigspec('efi_tcg2_protocol') +def test_efi_selftest_tcg2(u_boot_console): + """Test the EFI_TCG2 PROTOCOL + + :param u_boot_console: U-Boot console + + This function executes the 'tcg2' unit test. + """ + u_boot_console.restart_uboot() + u_boot_console.run_command(cmd='setenv efi_selftest list') + output = u_boot_console.run_command('bootefi selftest') + assert '\'tcg2\'' in output + u_boot_console.run_command(cmd='setenv efi_selftest tcg2') + u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False) + m = u_boot_console.p.expect(['Summary: 0 failures', 'Press any key']) + if m != 0: + raise Exception('Failures occurred during the EFI selftest') + u_boot_console.restart_uboot() -- 2.32.0