summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-02-11 16:40:09 +0200
committerTom Rini <trini@konsulko.com>2021-03-17 12:50:19 -0400
commit9262fe15599a388e365cca3091e4852be8f23f11 (patch)
treef0711e70e00a1eaacdcc135ace17a61ab469cbd1
parent0453411998ed4425c5c1543de53ff7474bd42eea (diff)
downloadu-boot-WIP/2021-03-17-assorted-fixes.tar.gz
test: Include /sbin to the PATH when creating ext4 disk imageWIP/2021-03-17-assorted-fixes
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> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--test/py/tests/test_env.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 940279651d..9bed2f48d7 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)