public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 1/4] test: Include /sbin to the PATH when creating ext4 disk image
@ 2021-02-11 14:40 Andy Shevchenko
  2021-02-11 14:40 ` [PATCH v2 2/4] test: Allow simple glob pattern in the test name Andy Shevchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Andy Shevchenko @ 2021-02-11 14:40 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-05-17  6:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox