diff mbox series

[1/1] test: test_fs error message

Message ID 20200420184840.106711-1-xypron.glpk@gmx.de
State Accepted
Commit d497821ebf302754ff4cd7265e5945c996e8fc34
Headers show
Series [1/1] test: test_fs error message | expand

Commit Message

Heinrich Schuchardt April 20, 2020, 6:48 p.m. UTC
For non-root users mkfs.vfat is not in the search path at least on Debian.
Hence when running 'make tests' a message indicates that file system tests
have been skipped:

SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
filesystem: fat16

This message is not really helpful as the executed program is not
indicated. Provide a more complete message like

SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
filesystem: fat16.
Command 'mkfs.vfat -F 16 build-sandbox/persistent-data/3GB.fat16.img'
returned non-zero exit status 127.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 test/py/tests/test_fs/conftest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--
2.26.1

Comments

Stephen Warren April 20, 2020, 7:34 p.m. UTC | #1
On 4/20/20 12:48 PM, Heinrich Schuchardt wrote:
> For non-root users mkfs.vfat is not in the search path at least on Debian.
> Hence when running 'make tests' a message indicates that file system tests
> have been skipped:
> 
> SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
> filesystem: fat16
> 
> This message is not really helpful as the executed program is not
> indicated. Provide a more complete message like
> 
> SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
> filesystem: fat16.
> Command 'mkfs.vfat -F 16 build-sandbox/persistent-data/3GB.fat16.img'
> returned non-zero exit status 127.

> diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py

> +        pytest.skip('Setup failed for filesystem: ' + fs_type + \
> +            '. {}'.format(err))

Wouldn't it be much simpler to avoid the format call:

... + fs_type + '. ' + err)

But either way the change seems conceptually fine.
Tom Rini April 28, 2020, 1:53 p.m. UTC | #2
On Mon, Apr 20, 2020 at 08:48:40PM +0200, Heinrich Schuchardt wrote:

> For non-root users mkfs.vfat is not in the search path at least on Debian.
> Hence when running 'make tests' a message indicates that file system tests
> have been skipped:
> 
> SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
> filesystem: fat16
> 
> This message is not really helpful as the executed program is not
> indicated. Provide a more complete message like
> 
> SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for
> filesystem: fat16.
> Command 'mkfs.vfat -F 16 build-sandbox/persistent-data/3GB.fat16.img'
> returned non-zero exit status 127.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
index b03fe75f5c..0d9a30bb07 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -335,8 +335,9 @@  def fs_obj_basic(request, u_boot_config):
         md5val.append(out.split()[0])

         umount_fs(mount_dir)
-    except CalledProcessError:
-        pytest.skip('Setup failed for filesystem: ' + fs_type)
+    except CalledProcessError as err:
+        pytest.skip('Setup failed for filesystem: ' + fs_type + \
+            '. {}'.format(err))
         return
     else:
         yield [fs_ubtype, fs_img, md5val]