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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B041BC47089 for ; Thu, 27 May 2021 11:43:16 +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 DFB796113B for ; Thu, 27 May 2021 11:43:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFB796113B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DD2882EE0; Thu, 27 May 2021 13:43:01 +0200 (CEST) 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="s8PtZibi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E33F82EA1; Thu, 27 May 2021 13:42:35 +0200 (CEST) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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 4DEE681FB2 for ; Thu, 27 May 2021 13:42:31 +0200 (CEST) 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-xf2a.google.com with SMTP id u33so2384770qvf.9 for ; Thu, 27 May 2021 04:42:31 -0700 (PDT) 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:user-agent; bh=EBxJXY0oM8NDJf+jAs+MzScNpKzmLRXW7zYbdVyg2YY=; b=s8PtZibi30pHPr/aIjEKmNtN0YtxZYIoXVQog/ye6v/XGoFz3by/6t9E5IOYS8L1J6 pLyuwomFQQrNnsA4enRfo2shM/vEisJtpPzqEz/Sqp4HvzjjaObJw8udwRHhm0iYJXE7 aGjncJf6d62abqDKDQJe9pVR8YrP4dqPT49ow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EBxJXY0oM8NDJf+jAs+MzScNpKzmLRXW7zYbdVyg2YY=; b=M/fWjooy7XKYXbEdBuN0JTSAsUvHEQ3IoNQegNCkkseETn3SeAzHzPejgwowUQF2Mz rgh5wc9Em4AkyLb6Jz775UhA5Xba7ILSNo7ONMxMEqjhPsKJYQFl02nmOkFmiJw+VcbD Rnem5KEvfhFZyJMxVo1H8wRKGWFMrbO2VWm8HpKeabahfvWePT2ICC7hL3MgBHnrDazZ WjLx3TgyOkK9qiYI3wKqJvLuvuKqe/pzq3cWIUUKkvTPjkgftlDH9IfJeYJlp+RecFGi RvJqEAi8IJJrOZfQ7ceat/4Ed33DIeTBcrkLJNcE0XiKJhsYW7JsT+mUWR6SvVOQfTVf TMdw== X-Gm-Message-State: AOAM530t6ImyE2zFeAZUo0JBHzw6vBAFzE8KqHe5FWJ+eyrFhVXxwdiy ws3OOboePcq1s3aowg37bK3iMg== X-Google-Smtp-Source: ABdhPJxdLa+nMkYDc8MjpWqMryjTSIWlybZMAFLtH/i/upJn5vSYE8Lzqcmazq2rqtdhqsfkZJVuWQ== X-Received: by 2002:a0c:90c9:: with SMTP id p67mr3269683qvp.7.1622115750241; Thu, 27 May 2021 04:42:30 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2083-4b51-adf2-e538.res6.spectrum.com. [2603:6081:7b01:cbda:2083:4b51:adf2:e538]) by smtp.gmail.com with ESMTPSA id t25sm1107706qtp.84.2021.05.27.04.42.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 May 2021 04:42:29 -0700 (PDT) Date: Thu, 27 May 2021 07:42:27 -0400 From: Tom Rini To: Alper Nebi Yasak Cc: u-boot@lists.denx.de, Simon Glass , Stephen Warren , Andy Shevchenko , Heinrich Schuchardt Subject: Re: [PATCH] test: Fix filesystem tests always being skipped Message-ID: <20210527114227.GW17669@bill-the-cat> References: <20210520190947.21773-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HUwxElkwLzZG3s7w" Content-Disposition: inline In-Reply-To: <20210520190947.21773-1-alpernebiyasak@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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.102.4 at phobos.denx.de X-Virus-Status: Clean --HUwxElkwLzZG3s7w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 20, 2021 at 10:09:46PM +0300, Alper Nebi Yasak wrote: > Commit 1ba21bb06b08 ("test: Don't unmount not (yet) mounted system") > fixes an issue in the filesystem tests where the test setup may fail > to mount an image and still attempt to unmount it. However, the commit > unintentionally breaks the test setups in two ways. >=20 > The newly created unmounted filesystem images are being immediately > deleted due to some cleanup steps being misplaced into finally blocks, > which makes them always run instead of only on failures. The mount calls > always fail since the images never exist, causing the tests to be always > skipped. This patch moves these cleanup calls into the except blocks to > fix this and makes the tests run again. >=20 > There are also unmount calls misplaced into finally blocks, making them > run after the tests instead of before the tests. These unmount calls > make the filesystem image file consistent with the changes made to it as > part of the test setup, and this misplacement is making a number of > tests fail unexpectedly. >=20 > The unmount calls must be run before the tests use the image, meaning > before the yield call and not in the finally block. They must also be > run as a cleanup step when the filesystem setup fails, so they can't be > placed as the final call in the try blocks since they would be skipped > on such failures. For these reasons, this patch places the unmount calls > both in the except blocks and the else blocks of the final setup step. > This makes the unexpectedly failing tests to succeed again. >=20 > Furthermore, this isolates the mount calls to their own try-except > statement to avoid reintroducing the original issue of unmounting a > not-mounted image while fixing the unmount misplacement. >=20 > After these fixes, running "make tests" with guestmount available results > in two test failures not related to the mentioned commit. If the > guestmount executables are unavailable, the mounts fallback to using > sudo and result in no failures. >=20 > Fixes: 1ba21bb06b08 ("test: Don't unmount not (yet) mounted system") > Signed-off-by: Alper Nebi Yasak > Acked-by: Andy Shevchenko Applied to u-boot/master, thanks! --=20 Tom --HUwxElkwLzZG3s7w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmCvhaMACgkQFHw5/5Y0 tywDkAwAsEJAQbLLWP0CVs+hToZ/RhCyt34GXhaKeM5PkDBYbP2LLmUZlVVqLvrf Hyn9CHN4bABugC0ikl+m3nPn6Nru6GntnnLnwed//kgbDTbpTl7TAPqpIwdGLIb/ HqQ6ZylkTTWOVqHRaIeAtXr+EPQJtKkKfRlY8aud8/ASJWLdUpIqKvDZKzGLms4K nIEyeRYnxSHuBfd/i9OvpbzyziRY+wVxK9X4QN3ol4wiix0Q1DZInNwbYyqBGFEQ yDt+ujV3H//bPIM1aZqgGXQ2G6dpi+HPkhZzG5YnX5TQ7nPBKSGqweatK7BPn0O1 WTRuGNei1HZkq6wa3N7Q/HR95ISgPSYT4DCyT8j9fPOkuyT5I5/tZUZnFea0M0GW SWFewDiLCyGS2VDR6ewHYlo85THFAU7P9mYLn2G6TjkwEiMoHbLCFmpYvld/WbAP fTyuT9dWJR1q5vojKOxP5cZLgMjy62VezHWXzTo+LK6tgnPWHhEMNo0xVuCanUbq E5aVoDUu =5p3A -----END PGP SIGNATURE----- --HUwxElkwLzZG3s7w--