All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@sigma-star.at>
To: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>
Cc: Richard Weinberger <richard@nod.at>,
	upstream+uboot@sigma-star.at,
	francis.laniel@amarulasolutions.com, glaroque@baylibre.com,
	mkorpershoek@baylibre.com, sjg@chromium.org,
	christian.taedcke@weidmueller.com
Subject: Re: [PATCH 1/3] test_fs: Allow running unprivileged
Date: Sun, 18 Aug 2024 11:11:41 +0200	[thread overview]
Message-ID: <1796341.KUTt5R2Mg1@somecomputer> (raw)
In-Reply-To: <20240815221418.GA3500277@bill-the-cat>

Am Freitag, 16. August 2024, 00:14:18 CEST schrieb Tom Rini:
> This brings two new pylint errors:
> test/py/tests/fs_helper.py:47:12: E0704: The raise statement is not inside an except clause (misplaced-bare-raise)

This raise was on purpose, I wanted the test to fail when an unsupported filesystem is used.
I have changed it to an assert 0.

> test/py/tests/fs_helper.py:78:4: E1120: No value for argument 'src_dir' in function call (no-value-for-parameter)

Fixed too.

But I'm still wrestling with the Azure pipeline.
After wasting^wspending a full afternoon, I think I know what is going on.

With my patches applied, it always failed like that:

___________________________ test_ut_dm_init_bootstd ____________________________
test/py/tests/test_ut.py:234: in setup_bootflow_image
    u_boot_utils.run_and_log(cons, 'mkimage -f auto -d %s %s' %
test/py/u_boot_utils.py:181: in run_and_log
    output = runner.run(cmd, ignore_errors=ignore_errors, stdin=stdin, env=env)
test/py/multiplexed_log.py:183: in run
    raise exception
test/py/multiplexed_log.py:141: in run
    p = subprocess.Popen(cmd, cwd=cwd,
/usr/lib/python3.10/subprocess.py:971: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
/usr/lib/python3.10/subprocess.py:1863: in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
E   FileNotFoundError: [Errno 2] No such file or directory: 'mkimage'

This makes little sense because I'm not touching mkimage nor PATH.

It turned out that without my changes, mount_image() always fails
inside the Azure pipeline.
So, in setup_bootflow_image() the whole try/catch block around
image creating, mounting it, etc.. fails and it always falls back
to the prepared image via copy_prepared_image().
The log print('Falled to create image, failing back to prepared copy: %s', str(exc))
is never shown because the test itself succeeds.

My patches change the tests to work without root privileges, so mount_image()
is no longer needed and no exception occurs.
As a consequence, mkimage is used the very first time on the Azure pipeline via:
u_boot_utils.run_and_log(cons, 'mkimage -f auto -d %s %s' % (inf, os.path.join(scratch_dir, vmlinux)))

To my best knowledge, u-boot-tools are not installed in the docker image,
nor does the test framework install mkimage.
So, the failure is expected.  Running test_ut.my manually always worked
within my test bed because I had mkimage installed.

So, can we please have mkimage inside the Docker image?

Thanks,
//richard

-- 
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y



  reply	other threads:[~2024-08-18  9:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02  9:33 [PATCH 1/3] test_fs: Allow running unprivileged Richard Weinberger
2024-08-02  9:33 ` [PATCH 2/3] test_fs: Rename mount dir to scratch Richard Weinberger
2024-08-06 15:32   ` Mattijs Korpershoek
2024-08-06 16:42     ` Richard Weinberger
2024-08-02  9:33 ` [PATCH 3/3] test_ut: Allow running unprivileged Richard Weinberger
2024-08-06 15:29 ` [PATCH 1/3] test_fs: " Mattijs Korpershoek
2024-08-15 22:14 ` Tom Rini
2024-08-18  9:11   ` Richard Weinberger [this message]
2024-08-18 15:25     ` Simon Glass
2024-08-18 15:37       ` Richard Weinberger
2024-08-18 15:47         ` Simon Glass
2024-08-18 20:06           ` Richard Weinberger
2024-08-19 17:11             ` Tom Rini
2024-09-17 17:24               ` 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=1796341.KUTt5R2Mg1@somecomputer \
    --to=richard@sigma-star.at \
    --cc=christian.taedcke@weidmueller.com \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=glaroque@baylibre.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=richard@nod.at \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=upstream+uboot@sigma-star.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.