From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 4/4] test: Don't unmount not (yet) mounted system
Date: Tue, 30 Mar 2021 22:41:15 +0300 [thread overview]
Message-ID: <YGN+24qBZ0j90sYE@smile.fi.intel.com> (raw)
In-Reply-To: <CAPnjgZ2J273pC_dP7k77PLmm-TRU2aeaBwfbHO80Q58nr7d4EQ@mail.gmail.com>
On Thu, Feb 18, 2021 at 09:52:12PM -0700, Simon Glass wrote:
> On Thu, 18 Feb 2021 at 03:56, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Thu, Feb 18, 2021 at 6:46 AM Simon Glass <sjg@chromium.org> wrote:
> > > On Thu, 11 Feb 2021 at 07:40, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > When test suite tries to create a file for a new filesystem test case and fails,
> > > > the clean up of the exception tries to unmount the image, that has not yet been
> > > > mounted. When it happens, the fuse_mounted global variable is set to False and
> > > > inconveniently the test case tries to use sudo, so without this change the
> > > > admin of the machine gets an (annoying) email:
> > > >
> > > > Subject: *** SECURITY information for example.com ***
> > > >
> > > > example.com : Feb 5 19:43:47 : ... COMMAND=/bin/umount .../build-sandbox/persistent-data/mnt
> > > >
> > > > and second run of the test cases on uncleaned build folder will ask for sudo
> > > > which is not what expected.
> > > >
> > > > Besides that there is a double unmount calls during successfully run test case.
> > > >
> > > > All of these due to over engineered Python try-except clause and people didn't
> > > > get it properly at all. The rule of thumb is that don't use more keywords than
> > > > try-except in the exception handling code. Nevertheless, here we adjust code
> > > > to be less intrusive to the initial logic behind that complex and unclear
> > > > constructions in the test case, although it adds a lot of lines of the code,
> > > > i.e. splits one exception handler to three, so on each step we know what
> > > > cleanup shall perform.
> > > >
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > ---
> > > > v2: new patch
> > > > test/py/tests/test_fs/conftest.py | 78 ++++++++++++++++++++++---------
> > > > 1 file changed, 56 insertions(+), 22 deletions(-)
> > > >
> > >
> > > This looks OK to me, but there is a lot of duplication in the code,
> > > isn't there? Perhaps another forray?
> >
> > Can we apply this fix as is and think about optimisations later, please?
> > W/o this I'm really blocked from running tests against U-Boot.
>
> 'make qcheck' bypasses this.
>
> +Heinrich Schuchardt
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Thanks!
Tom, I don't see this being applied. Can we actually get it in?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-03-30 19:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 14:40 [PATCH v2 1/4] test: Include /sbin to the PATH when creating ext4 disk image Andy Shevchenko
2021-02-11 14:40 ` [PATCH v2 2/4] test: Allow simple glob pattern in the test name Andy Shevchenko
2021-02-18 4:45 ` Simon Glass
2021-04-29 16:03 ` Simon Glass
2021-02-11 14:40 ` [PATCH v2 3/4] test: Use positive conditional in test_matches() Andy Shevchenko
2021-02-18 4:45 ` Simon Glass
2021-04-29 16:03 ` Simon Glass
2021-02-11 14:40 ` [PATCH v2 4/4] test: Don't unmount not (yet) mounted system Andy Shevchenko
2021-02-18 4:45 ` Simon Glass
2021-02-18 10:55 ` Andy Shevchenko
2021-02-19 4:52 ` Simon Glass
2021-03-30 19:41 ` Andy Shevchenko [this message]
2021-03-30 19:53 ` Tom Rini
2021-03-30 21:50 ` Andy Shevchenko
2021-03-31 13:47 ` Tom Rini
2021-05-13 11:32 ` Heinrich Schuchardt
2021-05-17 6:36 ` Andy Shevchenko
2021-02-11 14:46 ` [PATCH v2 1/4] test: Include /sbin to the PATH when creating ext4 disk image Andy Shevchenko
2021-02-18 4:45 ` Simon Glass
2021-03-15 13:59 ` Andy Shevchenko
2021-03-18 16:56 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YGN+24qBZ0j90sYE@smile.fi.intel.com \
--to=andy.shevchenko@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox