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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE2FEC4338F for ; Tue, 3 Aug 2021 06:57:11 +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 1A8D760525 for ; Tue, 3 Aug 2021 06:57:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A8D760525 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.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 167AF82DB4; Tue, 3 Aug 2021 08:57:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="qVCrjmjs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F09982DEB; Tue, 3 Aug 2021 08:57:07 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::61c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 80C3C82D9C for ; Tue, 3 Aug 2021 08:57:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tkarthik@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QBtTKEzBE0aoG0rSOWHXAg8rMeFEvKZnsEOldowfKEDRYX4gSByKCpFXj0j7d7+tp0urGXn5d5/ZdZ1bONiWnOPNpxOTmSbahiQLdCJKqV2qfHxLsbc/OpjkqLohGV6dd10+1MoiluGp9V4fGppKC1CVCQRWDY4PUs56qjV/pC4sWNuZpiCYwVvPAQxREl/XnflaAnYWYCUVWxqMcHyb1JWjv9uJ88H2neqPHrth7vNGp5lRMhlF/t5KZiJu1dXBK1HIiUR4qez3JO4YvwH8fboLaKtMYqxMJ6drNhsZphEZVm3gZPBnc7C//45hSw+/vLDkJwNtiDe8lYFHie7bQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v6FmbMx54jG88WhI4VjMKziRYpiaS1uZ5niPoiOargE=; b=lBPo5smDqCLWDVPsTX247BfOTJ1rBtKMTi4HqcOP/hJTPz0lg+5WMcJNv95+fDOnzDiE/ZIZCr2oDMWFsH+GHyGsKHpffuQ0+gQVSbw3Vx7EysS+U+Kb5R22GoOyHlNnKwIDuOG29TK8Bmqu2W+pDgbAExWpecdKRwwYEFDzk9GVUg8Fe9xQyh8xT5/lsfs5gf3ThaZhP4rv9K/Rl8oeTds1XTgPtSgDOMIYyX6KM/qUVzzwl38xaO1jX9blTBG6fGnbg93bqn+ozpUcW5PTFy9ChFD2ykySJVajKiXT43hvRqX+u/US4Iv3NNXfP4A2sZEJQJq8G0QdaQNjgbGB9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=xilinx.com; dmarc=pass action=none header.from=xilinx.com; dkim=pass header.d=xilinx.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v6FmbMx54jG88WhI4VjMKziRYpiaS1uZ5niPoiOargE=; b=qVCrjmjsXsidPAA5mClmiHEf1hltch/Ytr6JUkhcfVGG2gLPFCr5wF+kDd3n+3gDS2Ej9yKBkyx97mazhuLRGb/ovy02Ha81rn62qk78nhtS3N8xGv9pb6TJNlqNZ0BimQr/EAOFUVa1u2vnQrUSzwJygcrneBeRK/5caQQn60M= Received: from CH2PR02MB6742.namprd02.prod.outlook.com (2603:10b6:610:7a::12) by CH0PR02MB8135.namprd02.prod.outlook.com (2603:10b6:610:10c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.20; Tue, 3 Aug 2021 06:56:54 +0000 Received: from CH2PR02MB6742.namprd02.prod.outlook.com ([fe80::d578:da3c:4a9a:7898]) by CH2PR02MB6742.namprd02.prod.outlook.com ([fe80::d578:da3c:4a9a:7898%4]) with mapi id 15.20.4373.026; Tue, 3 Aug 2021 06:56:54 +0000 From: T Karthik Reddy To: Ashok Reddy Soma , "u-boot@lists.denx.de" CC: "miquel.raynal@bootlin.com" , git , Ashok Reddy Soma Subject: RE: [PATCH] test/py: tpm2: Skip tpm pytest based on env variable Thread-Topic: [PATCH] test/py: tpm2: Skip tpm pytest based on env variable Thread-Index: AQHXf7zcG8RBxQl0XEerxBk7RtYo66thadDQ Date: Tue, 3 Aug 2021 06:56:53 +0000 Message-ID: References: <20210723121826.23072-1-ashok.reddy.soma@xilinx.com> In-Reply-To: <20210723121826.23072-1-ashok.reddy.soma@xilinx.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-TNEF-Correlator: authentication-results: xilinx.com; dkim=none (message not signed) header.d=none;xilinx.com; dmarc=none action=none header.from=xilinx.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3278a29a-7ef7-4ca8-4dac-08d9564be0ad x-ms-traffictypediagnostic: CH0PR02MB8135: x-ld-processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WhXzEZOi5ZW5mrBe/u3FhVpQX609Z0vc3gKqN8vJoCeHM6ZHJViC9pCvwm9HQrAxKfnUFKDNVRmYktkEDRpXJPxDQSqqlZhX4dGCKDqFM22c44u5tAAYCRhbxEM02NbdNUIWLew6JivPZQEg8jZGBeqlrlVU9JmBDQ8P/D2O7wKBlJMDlXxT8Vfy8hkHdO8i57K5ZBul03P5+yLbPH9zvGW+cHP2oIRMaYrK87vFLZFYhDaIW5qWjpPACOJwsM1JjHeUIKZSc6lWVeu4kT5w2utWnfWZ+5PIYyR5DE1Xg0ZbntU5978FiBQCN5LRoQhhVkNNvxof5Lef2XYUcPZyST4lGP0rLsPSLyQY4MBvdS9qz0cdqV3T8Czco9JAFhPOh9qe6MQhCD0HSe+ZTqLjK7gejFzJrmnOdQQspVv27HOZ4pyGltlOdDJRrV4LGjcgWRbl0aytDQbuD2J7j9NXCjlK0Z7r+8FMZM4Eql5cn5/C5oKBawAa6PbhpyW3z9wsdLG20f8V48xf1FHbMg7m2NpIE/gIeEFFVpwh+MM+2u1BI9fYBLl588+TOwpPZbSyLn8MUs4cnHAdWr2+tNdl5R3T0zwD2retQQHouxHiMm30p2mFfXZ/mDfIep29reGqVcaXa/Ck2gY0aoqSh45O6URTLRYoPQnngO/xcvVZgmkFi14ORL6UWMICCBlm5r1g2Ej7hITqRpZ2OVo34u1IPw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR02MB6742.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(136003)(396003)(366004)(66556008)(66476007)(64756008)(76116006)(66946007)(107886003)(316002)(478600001)(38070700005)(66446008)(52536014)(54906003)(110136005)(5660300002)(4326008)(9686003)(38100700002)(55016002)(8676002)(2906002)(83380400001)(33656002)(53546011)(6506007)(8936002)(122000001)(7696005)(86362001)(186003)(26005)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?C8WHTSU4v2brdGe9nqIrL2L+qXq8eJzQo3bfad53ho7spYKKt98SznLk?= =?Windows-1252?Q?XsOTOd6AeTRaLDdOzg/1+W5BMKq3QyG+BBF1qUQveIFTxok3Rp2QZmPj?= =?Windows-1252?Q?bJJ6UoUtpYY58u95piftKjp9gBqBOsvZdJzqljY3Tx3K4cm17TrfZ+kr?= =?Windows-1252?Q?APZxvP9jpnYckwJFgaRSDe16dipn8NvC2z7qtd+zRAv/7+YZKc7Y37uk?= =?Windows-1252?Q?0tPw1im3h9CTzCRGW0bm/4bmgvPTuxPec+tGWX9bx8yhcsLUaziX3bnf?= =?Windows-1252?Q?N/Uqci7SPbdiMXNqePFm8Giv4LQgx7gfWT+nEl9SD08Bpaq3bosYzHYu?= =?Windows-1252?Q?cH6IStcw0ox9aRUbqkHHqtLCDtjhQ4NgIDMmXYWxAXnmxOCHd98ajTMe?= =?Windows-1252?Q?5Fzzynnh1iX1C+L0PLqLr/8DEURyJVmsIh4CfFHLIHhtnZEREQJOal67?= =?Windows-1252?Q?4ZgUhJYU1QOISEwRMWPMxsYbdAO4owJm/DRmTPkuQc8fbiv1jHZazYLJ?= =?Windows-1252?Q?CFWIQowwBpH+DvqJ6dg/PptNq7zW7UMGXQ7O/em9Z7068/6R4MQJBz96?= =?Windows-1252?Q?cL8jzPZm9Ou39pIVmQqCxK5Xlr1rI16B3Zq0iEY8BPiecYOxujsCReuR?= =?Windows-1252?Q?0pcwR+EJ3Qxjb8TCKJRYPTO0pZFxUOdLR34PIMIG7gSF6VARnhsZlFXW?= =?Windows-1252?Q?kxia4SL6zkcqV8ZpeTHtYZs7ukxeyeUjVPZ+3XHyGXPWuxGH5FFJ12cM?= =?Windows-1252?Q?YUJNPjueOAvhiAD3iXw4W62MgUm0ozxRD53qY+efkHDJcuZU4YzuUnLo?= =?Windows-1252?Q?YjG7JW5ElZxcE00qihKCxNlgGBuSlYiRParq6IbR/cFf0J/GDSwglpVW?= =?Windows-1252?Q?RVOmQVpzUl1nSF31XPoDbhDFfuiRZDzrC78BaE8uoH8AP65SSStuwmQp?= =?Windows-1252?Q?WxsDWuGQsFKdWIlENTkge0QAarm+iKiADdekz7ahrMzwlcMiNQxIJHvO?= =?Windows-1252?Q?5Zcu43FQ0xv0wfFnYGHbnNhroyLpmDRvlICFOinQjsjtxDuMMZlaVJxt?= =?Windows-1252?Q?/VpwcocMNC3VAYQw4uUreexEWl5KPHwp0JPGIaMyoIPHmjuG4+VZzWXS?= =?Windows-1252?Q?Sun1HVd8BKmEH+9XDMd6Fci4Or3BXcq3ZE8W74R1rfO9Zdoz5iflE6xR?= =?Windows-1252?Q?ECscUU+jJxTbNQnIi5YsWbK9hdrsp5FPFCmnlOy0naV3N5sVFMUzPE2K?= =?Windows-1252?Q?cIgDeeJwQ3zbd1p+07pqjWa4ISF2EmndF5sXRDqMFUvcMZyRNdlC5SKj?= =?Windows-1252?Q?rLgqZSfq3+an5v9t0cR7WYWJJxk3dl3voKXi47K2adRuicccgwhn0BF+?= =?Windows-1252?Q?yHe4WPAGakPoSPSXYxYRIUQjop1YwqF5JJjulCtvoDfTgD6A4vnC1WLF?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR02MB6742.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3278a29a-7ef7-4ca8-4dac-08d9564be0ad X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2021 06:56:53.9295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3HJxhsXiIv44ovpgds60BBn/2abfOPQJVzIKTfKLfMhMqH5KEc2y1h5w/GOtcpe4O0qwgJn/JQb7TL8uvR/D1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR02MB8135 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 Hi, Any update on this patch? Thanks T Karthik > -----Original Message----- > From: Ashok Reddy Soma > Sent: Friday, July 23, 2021 5:48 PM > To: u-boot@lists.denx.de > Cc: miquel.raynal@bootlin.com; git ; T Karthik Reddy > ; Ashok Reddy Soma > Subject: [PATCH] test/py: tpm2: Skip tpm pytest based on env variable >=20 > From: T Karthik Reddy >=20 > Tpm test cases relies on tpm device setup. Provide an environment variabl= e > "env__tpm_device_test_skip =3D 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. >=20 > Signed-off-by: T Karthik Reddy > Signed-off-by: Ashok Reddy Soma > --- >=20 > test/py/tests/test_tpm2.py | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) >=20 > diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py inde= x > 70f906da51..bb147d4e88 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 d= o > 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. > + > """ >=20 > updates =3D 0 > @@ -29,6 +38,9 @@ def force_init(u_boot_console, force=3DFalse): > twice will spawn an error used to detect that the TPM was not reset = and > no > initialization code should be run. > """ > + skip_test =3D > u_boot_console.config.env.get('env__tpm_device_test_skip', False) > + if skip_test: > + pytest.skip('skip TPM device test') > output =3D 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=3DFalse): > def test_tpm2_init(u_boot_console): > """Init the software stack to use TPMv2 commands.""" >=20 > + skip_test =3D > 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 =3D 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. > """ >=20 > + skip_test =3D > 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 =3D 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 capabiliti= es. > """ >=20 > + skip_test =3D > 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 =3D 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. > """ >=20 > + skip_test =3D > 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 =3D 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. > """ >=20 > + skip_test =3D > 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 =3D u_boot_console.run_command('echo $?') > assert output.endswith('0') > -- > 2.17.1