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 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 E7604C433EF for ; Sat, 12 Mar 2022 02:26:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6793583B36; Sat, 12 Mar 2022 03:25:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="nUXD/ByB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A173983AF5; Sat, 12 Mar 2022 03:25:22 +0100 (CET) Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (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 3970D83AE6 for ; Sat, 12 Mar 2022 03:24:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oo1-xc32.google.com with SMTP id s203-20020a4a3bd4000000b003191c2dcbe8so12675286oos.9 for ; Fri, 11 Mar 2022 18:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=pfKukLKhNGwjg/91sZtSj9jTk7FzeC0SSm7uUSD9ws4=; b=nUXD/ByBoO93itSWHGk37Vm6TKWfof1tKRx6u/K6LC2eMxYddInuiaBo+FkvoyA8is siHLvnBPCaVfF0xQ9MNNg5fTgO8m1RgvEVN5X4zRoLBps9AqUrsrSmue/iNpdjmdDLqp EV9NEb0yanIgDXTLr9DY6jNO8d4ii0fDCvw5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=pfKukLKhNGwjg/91sZtSj9jTk7FzeC0SSm7uUSD9ws4=; b=v5d6DXOU1JJQY0SVdRhLOxfXlRJwFSFbDSOIrlb1J/8MZOJTBX6OTP8cZPo13zqPcE pAS8zkqmGMEGOf0HHD80kv1Agfy+gUJk/+qsF+3tYZoXOoAooqwbmAJfmBdD/eHyrXKs tZ6CfsQIkClTQBOVHI/lVIuuECshnCvkE/xFZgKhJNJ/9rha3P8swMuR5xC+P4nWvilt IucJMnqkFNYmXUivTNwhcXhO/nQw0PVZGYTuOqf/ezyiSMwoILwztcja9i8Jfg+HGzgO +d3Kagw/nyFLxnw1XGx1DotkLdVyMIcw/lTOlBXII8P73mBskNd/vSk7hlSeiZ+dlkIg MvFg== X-Gm-Message-State: AOAM533MAqtFoigNEUvIdAB81cUQBnqoXLvtQy82gb8e+pjukZu9YorC jDnmRY8CBXxIAb5TOJX8xAr1e0ROtt6az4g+8A0NhA== X-Google-Smtp-Source: ABdhPJwAhhBoaHiQc1WnysQlnUldp4SLq9hVmCIrwyysCKskjVwvlTH1O9ewt9y1elG+v2VuwfHvoRD2991SS90wJFY= X-Received: by 2002:a05:6870:9612:b0:ce:c0c9:658 with SMTP id d18-20020a056870961200b000cec0c90658mr12299258oaq.170.1647051894520; Fri, 11 Mar 2022 18:24:54 -0800 (PST) MIME-Version: 1.0 References: <164491595065.536855.9457820061065514578.stgit@localhost> <20220216154642.GA1576803@bill-the-cat> <4ba143f8-6114-db0e-08e2-d97ac9dc6e13@gmx.de> <20220219011550.GB6672@laputa> In-Reply-To: <20220219011550.GB6672@laputa> From: Simon Glass Date: Fri, 11 Mar 2022 19:24:39 -0700 Message-ID: Subject: Re: [PATCH] test/py: efi_capsule: Handle expected reset after capsule on disk To: AKASHI Takahiro , Heinrich Schuchardt , Masami Hiramatsu , Tom Rini , U-Boot Mailing List , Patrick Delaunay , Patrice Chotard , Alexander Graf , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Etienne Carriere , Sughosh Ganu , Paul Liu , Simon Glass Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Takahiro, On Fri, 18 Feb 2022 at 18:16, AKASHI Takahiro wrote: > > On Fri, Feb 18, 2022 at 02:48:54PM +0100, Heinrich Schuchardt wrote: > > On 2/18/22 03:16, Masami Hiramatsu wrote: > > > Hi Simon, > > > > > > Thank you for your reply. > > > > > > 2022=E5=B9=B42=E6=9C=8818=E6=97=A5(=E9=87=91) 2:56 Simon Glass : > > > > > > > > > > > Hi Masami, > > > > > > > > On Wed, 16 Feb 2022 at 18:11, Masami Hiramatsu > > > > wrote: > > > > > > > > > > Hi Simon, > > > > > > > > > > Let me confirm your point. > > > > > So are you concerning the 'real' reset for the capsule update tes= t > > > > > case itself or this patch? > > > > > > > > > > I'm actually learning how the test is working, so please help me = to > > > > > understand how I can solve it. > > > > > > > > > > There are 3 environments to run the test, sandbox, Qemu, and a re= al board. > > > > > If we reset a sandbox, it will continue to run (just restart itse= lf), > > > > > > > > Here you should be able to avoid doing a reset. See > > > > dm_test_sysreset_base() which tests sysreset drivers on sandbox. > > > > > > Would you mean that reset-after-capsule-on-disk itself should not > > > make a reset on sandbox? > > > > We have several tests that do resets by calling do_reset(), e.g. the > > UEFI unit tests. There is nothing wrong about it. > > > > We want the sandbox to behave like any other board where capsule update= s > > lead to resets. > > > > > > > > In dm_test_sysreset_base(), I can see the below code, this means > > > sysreset_request() > > > will not execute real reset, but just mimic the reset, right? > > > > > > state->sysreset_allowed[SYSRESET_WARM] =3D true; > > > ut_asserteq(-EINPROGRESS, sysreset_request(dev, SYSRESET_WARM)); > > > state->sysreset_allowed[SYSRESET_WARM] =3D false; > > > > > > > > but Qemu and real board will cause a real reset and it will termi= nate > > > > > the qemu or stop the board (depends on how it is implemented). Th= us, > > > > > if a command or boot process will cause a reset, it will need a > > > > > special care (maybe respawn?). > > > > > > > > Here you need to worry about the surrounding automation logic which > > > > could be tbot of the U-Boot pytest hooks. I suggest you avoid this = and > > > > handle it some other way, without reset. > > > > The sandbox should run through exactly the same code path as all other > > boards to get a meaningful test results. Therefore don't put in any > > quirks on C level. Your Python test changes are all that is needed. > > +1, I have the same opinion here. > To exercise capsule-on-disk code, we need a "real" reset > because pytest/CI loop is basically a black-box test. I don't see why you need the reset at all to test the code. You should be able to run a command to make the update happen. How does the updata actually get triggered when you reset? [..] Regards, Simon