public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/4] test: Include /sbin to the PATH when creating ext4 disk image
Date: Thu, 11 Feb 2021 16:40:09 +0200	[thread overview]
Message-ID: <20210211144012.55676-1-andriy.shevchenko@linux.intel.com> (raw)

On some distributions the mkfs.ext4 is under /sbin and /sbin is not set
for mere users. Include /sbin to the PATH when creating ext4 disk image,
so that users won't get a scary traceback from Python.

Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: used '/sbin' as is (Simon)
 test/py/tests/test_env.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 940279651da0..9bed2f48d77e 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -414,6 +414,8 @@ def mk_env_ext4(state_test_env):
     if os.path.exists(persistent):
         c.log.action('Disk image file ' + persistent + ' already exists')
     else:
+        # Some distributions do not add /sbin to the default PATH, where mkfs.ext4 lives
+        os.environ["PATH"] += os.pathsep + '/sbin'
         try:
             u_boot_utils.run_and_log(c, 'dd if=/dev/zero of=%s bs=1M count=16' % persistent)
             u_boot_utils.run_and_log(c, 'mkfs.ext4 %s' % persistent)
-- 
2.30.0

             reply	other threads:[~2021-02-11 14:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 14:40 Andy Shevchenko [this message]
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
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=20210211144012.55676-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.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