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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4DE99C433F5 for ; Wed, 16 Feb 2022 17:51:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2B5083A6A; Wed, 16 Feb 2022 18:51:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.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=konsulko.com header.i=@konsulko.com header.b="kUXSp4Fh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9035783A6B; Wed, 16 Feb 2022 18:51:52 +0100 (CET) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (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 D058883A69 for ; Wed, 16 Feb 2022 18:51:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf36.google.com with SMTP id f19so3350519qvb.6 for ; Wed, 16 Feb 2022 09:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IZhDLJS+hq7tb2b4ax/fsk7iDuXlxfAhXY6nUZLjTts=; b=kUXSp4FhrsBXaRUiFnm7rs+rpqsP6DEwg35ErzPg0pABGGoTJwx0MjZ85+c1+4K6q4 vSETW87mzuMiCq8bHVj5f25sb9rlav8eVgZYu4Aq+bzyMollJUwMTucvf4iXsaQnxpmK ALFXdLaRODm4CKuFG8hRS2So0MTDeFYvt0HVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IZhDLJS+hq7tb2b4ax/fsk7iDuXlxfAhXY6nUZLjTts=; b=Yu4Gz7Pc/7qz0Fzo2Sxqt/KV2YoL7Ry/iyevqj0sjaapGzIvwsr6uNsv80ggWCWBX2 vHOmzu2pZNcyVBdqUK06rUS5q5L8Y9AGZHGLJQYIh/dWhVtusV/fI/l5vslOcO4e5alK D1SxHpqgALJk5MQgzyKq+e0V2k94p9nbCZP1+iVSYsRVwIWCi6yon/wHmAKR5GmcnbYI iWaDPtl4fa502V41rNR3uySO264WaW7PkKV3jzKGcs9rl9HiwZAKuoyo5bGv/8oHIa57 H/QoMh2cHoZcnXYzYn9jem0Isx/Ur0dModvxr1OBGfjEZ+2/1Ojj029UQmfm3AIS+QEZ t4sA== X-Gm-Message-State: AOAM53016sVE1lNLokinuFzxXZ0AvA4noKHAwpFqm5751RKffEhlf+OH uLJ4ICz46bwo73tL+ZGR8WhP/w== X-Google-Smtp-Source: ABdhPJwzhYsC+h/pMkNs/e+Fo/cAvIRfaHaTP4DV37LfZOY1yqlm5FN6H5LudPgsFGj8suSOAiXTXw== X-Received: by 2002:ac8:4616:0:b0:2d2:e038:ea49 with SMTP id p22-20020ac84616000000b002d2e038ea49mr2871354qtn.340.1645033907446; Wed, 16 Feb 2022 09:51:47 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id s2sm18365832qks.60.2022.02.16.09.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 09:51:46 -0800 (PST) Date: Wed, 16 Feb 2022 12:51:44 -0500 From: Tom Rini To: Heinrich Schuchardt Cc: Simon Glass , U-Boot Mailing List , Patrick Delaunay , Patrice Chotard , Alexander Graf , AKASHI Takahiro , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Etienne Carriere , Sughosh Ganu , Paul Liu , Masami Hiramatsu Subject: Re: [PATCH] test/py: efi_capsule: Handle expected reset after capsule on disk Message-ID: <20220216175144.GC1576803@bill-the-cat> References: <41b3551c-5223-a924-99a3-cd245baac51c@gmx.de> <164491595065.536855.9457820061065514578.stgit@localhost> <20220216154642.GA1576803@bill-the-cat> <4ba143f8-6114-db0e-08e2-d97ac9dc6e13@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: <4ba143f8-6114-db0e-08e2-d97ac9dc6e13@gmx.de> X-Clacks-Overhead: GNU Terry Pratchett 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.5 at phobos.denx.de X-Virus-Status: Clean --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 16, 2022 at 06:45:32PM +0100, Heinrich Schuchardt wrote: > On 2/16/22 16:46, Tom Rini wrote: > > On Wed, Feb 16, 2022 at 04:32:40PM +0100, Heinrich Schuchardt wrote: > > > On 2/16/22 16:26, Simon Glass wrote: > > > > Hi Masami, > > > >=20 > > > > On Tue, 15 Feb 2022 at 02:05, Masami Hiramatsu > > > > wrote: > > > > >=20 > > > > > Since now the capsule_on_disk will restart the u-boot sandbox rig= ht > > > > > after the capsule update, if CONFIG_EFI_CAPSULE_ON_DISK_EARLY=3Dy= , the > > > > > boot with a new capsule file will repeat reboot sequence. On the > > > > > other hand, if CONFIG_EFI_CAPSULE_ON_DISK_EARLY=3Dn, the 'env pri= nt -e' > > > > > command will execute the capsule update on disk and reboot. > > > > >=20 > > > > > Thus this update the uboot_console for those 2 cases; > > > > >=20 > > > > > - restart_uboot(): Add expect_earlyreset optional parameter so= that > > > > > it can handle the reboot while booting. > > > > > - run_command(): Add wait_for_reboot optional parameter so tha= t it > > > > > can handle the reboot after executing a command. > > > > >=20 > > > > > And enable those options in the test_capsule_firmware.py test cas= es. > > > > >=20 > > > > > Signed-off-by: Masami Hiramatsu > > > > > --- > > > > > .../test_efi_capsule/test_capsule_firmware.py | 39 ++++= ++-- > > > > > test/py/u_boot_console_base.py | 95 ++++= +++++++++++----- > > > > > test/py/u_boot_console_sandbox.py | 6 + > > > > > 3 files changed, 102 insertions(+), 38 deletions(-) > > > >=20 > > > > We have a means to avoid actually doing the reset, see the reset dr= iver. > > >=20 > > > The UEFI specification requires a cold reset after a capsule is updat= ed > > > and before the console is reached. How could the reset driver help to > > > fix the Python tests? > >=20 > > Is this test going to be able to run on qemu, sandbox, real hardware, or > > all 3? The tests may well end up having to know a bit more, sadly, > > about the type of system they're testing. >=20 > Currently the test will only run on the sandbox in Gitlab (see usage of > @pytest.mark.boardspec('sandbox') in test/py/tests/test_efi_capsule/). OK, I'll leave sandbox commentary to Simon. > You will not want to update the firmware on real hardware especially if > there is a rollback protection. But testing on QEMU would make sense. On QEMU we should be able to since we can turn boards off and on and would be writing to our emulated flash. Then on real hardware, we should be able to do the same tests, or at least the ones involving "update was successful" ? We have DFU tests today too, so I'm not immediately sure why we couldn't (aside from possibly wearing down flash life, and gating HW tests on emulator tests passing is always a good idea). --=20 Tom --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmINOa0ACgkQFHw5/5Y0 tyy7cAv/Turm8yEepn/CHegCIbsZXAu8SR3JVIftCcsB5JQcZnG/1Nl1VNcsN/E+ m3T0iWJ15DA0Gz3h13bqDpyjxmdEGuuhSfvK9zYC3JFsKr9LruktyLjIn511CTW7 6pRC0oTiNmpAmG+LjHCxaGas+xLnqVSrndDXdyJIJjiebwpfW6SbHRKBhsElBnF3 F+F94/GK3PE9+R9mFXcg0lqyeCm6lMXXYFkljGRIz3cMam5JKWNt8WaGX2/ipHrY wLFtf8S1Jc5R99sPlFUAjNMnztAeFGISsbFrbXB65KO0kPr4KtqUq/R0fved/Spy cqOnS6LJe6XDLnuPJ/i8Tl9hSf9zuG03acDWZZh/kmTslfmX9UjUsm2GAKDrWhKR xCgE3T1DdPsl7YVoeyRWsl2Hf73Udj8V8E/DGEI0U5y0x1tk+HQPsOOwwsmSfn77 Fz5rfAJ4SB2QNz3307grfaIawPBjNQL67hFvAOQoRaoCgmORFmuW0Hux5WL3kw+p EJNmtw1x =obOd -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu--