From patchwork Wed Oct 25 07:25:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 737828 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp148118wrq; Wed, 25 Oct 2023 00:25:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEa3CWQQ+AazkQIWeEClOcnLk53sSHlQaw1PPSwNpoHQ4/Tim9kyvGe5s6jOJYtMbO2uq3P X-Received: by 2002:a19:5014:0:b0:507:a40e:d8c6 with SMTP id e20-20020a195014000000b00507a40ed8c6mr9515643lfb.11.1698218738484; Wed, 25 Oct 2023 00:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698218738; cv=none; d=google.com; s=arc-20160816; b=saoMhQP37BHpa1ialOfVqMJ8Jt0Pa2y93/oCpQErIzkD3hrnA6AbmX8y7UdnYg2wL8 4UR12km4so1OQJLwT4DF3YTp9Hrbu0Ftcb/0dACEqYJEn/04oaILzn0PB1KeXh9W9WUL FRiRP8lAJ6nUWP09WuasWTf+bmdexWqL1xkcwmnq/KElTzJQMUiTdl849OOdaXFWVXXN ix5E9gIn1furyWBwq+0F12TT0VdyOTE7LvwLZ5nZhpZFFzmj/LyiLnmo6xzPcmPyptx0 f7t7E9xUWYnanAY2r+SmMwbIw704I3ezmncQRFCyc/q4OadwkHKHy5lcpgKIAgOe03JQ HnKQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=fbU+2yr6L/fmyx0oqKAB4VS1Is66G/S7LiZOcoQnnPI=; fh=kWuTbV4bHn4pHGlO1K2ZZS9t3dSyeIvo+U0bBXs0euk=; b=FLXEhjpBNndOY0Wn4oP5S0pgNXHB0YzOxh/HATdYrhE3mJNZSb4yDUNVks9vdf62b+ EmVwRl2R6YCp4wFUkWLOlTxkZq9WiZVZ9LkjlL1WqP+PmQWCdih6g1h8bMYqJNsB2arK sap7fkiJUfkAcImMeSreCAHD7DbeJAahuBsX9kdW8Tp9c1i+g4CvkYmNI9Ke/WH6eaJ/ Y1wGybK01BhcycfXm8MBJbX37D7C8Gliww+ZlJNCoQMpi4ofsJoN1T2cr6oQuwCQ5+TE IRcuKJE9K4upEOH0EKhxs7+dI2ttfd4N7GUL5qzuRr5d3S3J4DdLSshOOFepN8UymFMu kXUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lxUJ1BjT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id y3-20020a5d6143000000b0032d850e145csi6898591wrt.207.2023.10.25.00.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:25:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lxUJ1BjT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0AFE5870B4; Wed, 25 Oct 2023 09:25:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="lxUJ1BjT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F9A18716C; Wed, 25 Oct 2023 09:25:36 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9FC1E86FE2 for ; Wed, 25 Oct 2023 09:25:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-533d31a8523so7943238a12.1 for ; Wed, 25 Oct 2023 00:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698218733; x=1698823533; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fbU+2yr6L/fmyx0oqKAB4VS1Is66G/S7LiZOcoQnnPI=; b=lxUJ1BjTBZijBBZo1PcjzDHj4G9nqbb0OKh6k1SFX5N3UyUlL/hpyDZEy8SmSc/AyO 8TuGX4xf71c60TAfwAH5/1UKM4briEx/PNrdU4It8xV+4HjqLrllIm40qWWIx8cYKjCy r6QbyQU2Q5PPHaskdajl2wO+ipNxiBPBmXjnTgtpu+GNfhHWvuVaHkdXng66FuuUhjeO /8CsNJ4sia6PmjmclQch/fbJgHYRN+Jv7S8MKh2rtpkdyILEBipX8iX68hrFieK0eGyG 3ngNLpKiq0Pglh3VfPgYaby8/7DD+uAGe0dVtyOG02N/xLQHWD86f8IoY6Dp3E9yqiUD K+OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698218733; x=1698823533; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fbU+2yr6L/fmyx0oqKAB4VS1Is66G/S7LiZOcoQnnPI=; b=qV46DIa5BNmhhsnuhB/CcmXHhfzn/yYlqgHxwX97uHZxde//iFVd94QXKNUz51wBT7 Y4jd72Rf9jiw/xVt3IlS+Jrt6aRZKElsHycpU348cxZx+yn9hDcycZgc4SnbZ7L5CMBp qkfBntoTmbdyAWJt5TrAR6eIsJCniw9yxW+KSalMwqLLQUWuMoGg8LKU1e0TkTeCoxs4 JjpKDkBvdugIlqFwILzbYDu8DEVzXo3t6A6wi9xwaNNYUR573s7hNm71CF+8wzfYklZ3 eZnA5H1fsNAerzojAjQ0qOBKZi2dHA5MVG0O3y0vtBkw/mMSMF6XSRa5FNMamS5h6UaC amWA== X-Gm-Message-State: AOJu0YzplrznXgRBLTQBIapkSv9ONSXN+TZpwYHPVdPr3Y28N25tpTT8 n62IVCWS3vvFAeO/oq18TMUR8vpmnBFJJasroHChAA== X-Received: by 2002:a50:d596:0:b0:53f:b9d2:d019 with SMTP id v22-20020a50d596000000b0053fb9d2d019mr10674471edi.11.1698218733162; Wed, 25 Oct 2023 00:25:33 -0700 (PDT) Received: from hades.. (ppp046103219117.access.hol.gr. [46.103.219.117]) by smtp.gmail.com with ESMTPSA id cn10-20020a0564020caa00b0053e8f1f79afsm9030363edb.30.2023.10.25.00.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:25:32 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: sjg@chromium.org, Ilias Apalodimas , Michal Simek Subject: [PATCH] test/py: always use autostart on tpm2 selftests Date: Wed, 25 Oct 2023 10:25:25 +0300 Message-Id: <20231025072525.3960316-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 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 commit 789ed2784256 ("test/py: replace 'tpm2 init, startup, selftest' sequences") changed some of the tpm2 init sequences to 'tpm2 autostart' instead of calling 'tpm init', 'tpm startup TPM2_SU_CLEAR', 'tpm2 self_test full'. The autostart command calls the afforementioned sequence and on top of that deals with the 'tpm2 init' return codes if the tpm is already started. Since we initialize the tpm from various subsystems now, replace the last remaining instances of 'tpm2 init' with 'tpm2 autostart'. Since the latter calls 'tpm2 init' anyway we will still be implicitly testing the validity of that command It's worth noting that since 'tpm2 autostart' performs the startup and self tests sequences of the tpm we could drop 'test_tpm2_sandbox_self_test_full' and 'test_tpm2_startup, but let's keep the since they test tpm commands and options Signed-off-by: Ilias Apalodimas --- test/py/tests/test_tpm2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py index 47392b87a98f..1d654cd4a23b 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') @@ -100,7 +100,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') + u_boot_console.run_command('tpm2 autostart') output = u_boot_console.run_command('echo $?') assert output.endswith('0')