From patchwork Mon Aug 7 15:17:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 711130 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1602345rwb; Mon, 7 Aug 2023 08:18:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH99adpNDv/NgEpLB7scjMtBtxJ85z4nOK1wpiMrS790sHDEvtdfepjS1iEfh1xxhImcy/0 X-Received: by 2002:adf:fac1:0:b0:317:6734:c2ae with SMTP id a1-20020adffac1000000b003176734c2aemr5384613wrs.11.1691421516169; Mon, 07 Aug 2023 08:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691421516; cv=none; d=google.com; s=arc-20160816; b=Z+/RONRxt5UOLrpokkJzXLXOjqTmO0m/RrUrWzvo7J/74JfF9FGmLkpHJ5/Vl7uKpK pixx7FU8daCx/KWXuCXVfuu4nzMx8t0rTxGK1FS1LRLfo0deLyLNR0fhhfR+MbCEnita RE5JEb6PS1Ukt9nme/QKSoUQUVShGNalPWSyYFgvLaaMSKuzn5J1u5UJt8Qw8lhURJ8l C8NUwUVCi36mRPgkx9sJo/qvtdy1D6lcsEdzrgmd1ubdcKe0vENak72+LzQAn9Jv0j/G zmCARsHwy15Z7yAMXhDYxg06fdDKB+Wxk59T4ACA4SgyRoulxksBtWGBhJJlcPQT+nxg Djyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JhHKLINhKXLm+dd/9dvYc9LThPJT82hxti8eXPV4tjc=; fh=x3v0/GoXJuL1oFKziP5cRNs3+Fqz1zxSh3t+0A/5jr0=; b=SymIRgoX4h1aM3dRAyfa+EvafnwGzJrXAs+6B/5yOyA5hJ5p7IOaHdGbXa4YQCZnKD Ccx01TrdvnT43pWJkGCi2iEwp7GWNyPjUzsyYwVJJRrqULsrA2RQ4TNjZq0ZXl1OhZM4 M4GMxE337fVsd6Ns9n6Kxsa+zHGlZl6Q01c3ecM5yGj64KnGRuGkrCTqQZGZcv3c3rAb +GJLy3fomlR1o7/e4rlWpNnPMhRxKJWLAbzYGQYnE7mSd4tijtv9teQGiFRzBgKY8gOK 0HV9kklB192TtIqLjQOHPNSkBAXtg+OdXT91keLvceXJFareARaiMNWDuD++Yjg7ILIO LAIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=J0Ldy89Y; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id c16-20020a5d4cd0000000b00314240f7362si3905937wrt.227.2023.08.07.08.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 08:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=J0Ldy89Y; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0CCE86878; Mon, 7 Aug 2023 17:17:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.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=ibm.com header.i=@ibm.com header.b="J0Ldy89Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A11888468A; Mon, 7 Aug 2023 17:17:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 898E9847BC for ; Mon, 7 Aug 2023 17:17:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eajames@linux.ibm.com Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 377FEuf7032013; Mon, 7 Aug 2023 15:17:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=JhHKLINhKXLm+dd/9dvYc9LThPJT82hxti8eXPV4tjc=; b=J0Ldy89YUB7mz1RkvixR8BI2XgcJZG3FMDuzTCEQDFShRa6aRIF5FWrWpea6HwIwn4Vc uyqM1g/PZJCR36jHhoGi5RFaiQCAfFeZi8SbzKpzTaOECKLcaJPG4wKHY+Afyyqoq23V SA+x7PFHz5rkx2iprmE6V6e9N+30h6MDi7vABR3l6gtmrpvATGQcZcokJYpy3vlXBvRB TBXfaCeEw9aW7dJjraMMW7d9tvRu0jhZ2ljEhw5jbWmhLIo9PYDEcxZe56QqaH3cUewQ 1GfRkY8pmmk5RjB46ncZRCOzfi4ybbd/9iBXDSFfpgUmSbE1qr2lnL0QeiPM1orHIfW3 Ng== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sb33581u3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Aug 2023 15:17:40 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 377FGJup002884; Mon, 7 Aug 2023 15:17:39 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sb33581tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Aug 2023 15:17:39 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 377EX54F001801; Mon, 7 Aug 2023 15:17:38 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3sa3f1djtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Aug 2023 15:17:38 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 377FHcp72360016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Aug 2023 15:17:38 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DA8258051; Mon, 7 Aug 2023 15:17:38 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B2665805F; Mon, 7 Aug 2023 15:17:38 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.130.18]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 7 Aug 2023 15:17:37 +0000 (GMT) From: Eddie James To: u-boot@lists.denx.de Cc: ilias.apalodimas@linaro.org, sjg@chromium.org, xypron.glpk@gmx.de, joel@jms.id.au, eajames@linux.ibm.com Subject: [PATCH v10 09/10] test/py: only run 'tpm2 autostart' to init the tpm Date: Mon, 7 Aug 2023 10:17:34 -0500 Message-Id: <20230807151735.84093-10-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230807151735.84093-1-eajames@linux.ibm.com> References: <20230807151735.84093-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: sa8cQNcEsUdaSOyrLskydpBiJUVw8SGt X-Proofpoint-ORIG-GUID: 2TIxHfHhzd9_1zXDEWOYqeGtnXfb59Q_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-07_16,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 phishscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308070139 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean From: Ilias Apalodimas commit xxxxxxxx ("") replaced the forced and sandbox tpm2 initialization running 'tpm2 autostart' instead of the startup tpm sequence. The difference is that the new function handles the internal tpm_init state internally and doesn't return an error when trying to initialize the tpm multiple times. Replace the remaining instances Signed-off-by: Ilias Apalodimas --- test/py/tests/test_tpm2.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py index 8cd3046285..5bbb2d2069 100644 --- a/test/py/tests/test_tpm2.py +++ b/test/py/tests/test_tpm2.py @@ -61,7 +61,7 @@ def test_tpm2_init(u_boot_console): 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 init') + u_boot_console.run_command('tpm2 autostart') output = u_boot_console.run_command('echo $?') assert output.endswith('0') @@ -97,11 +97,7 @@ def test_tpm2_sandbox_self_test_full(u_boot_console): """ 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') + u_boot_console.run_command('tpm2 autostart') output = u_boot_console.run_command('echo $?') assert output.endswith('0')