Skip to contentSkip to conversation

test: test_fs error message

PATCH New Heinrich Schuchardt 3 participants 3 messages Apr 20, 2020 – Apr 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: test_fs error message

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.

---
 test/py/tests/test_fs/conftest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
test/py/tests/test_fs/conftest.py +3 -2
index b03fe75f5c..0d9a30bb07 100644
@@ -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]

--
2.26.1

#1 lore raw

PATCH 1/1 test: test_fs error message

Quoted 16 lines · Heinrich Schuchardt

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.

test/py/tests/test_fs/conftest.py def fs_obj_basic(request, u_boot_config): · line 340

Quoted 3 lines
test/py/tests/test_fs/conftest.py +2 -0
 
+        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.

#2 lore raw

PATCH 1/1 test: test_fs error message

In reply to Heinrich Schuchardt
Quoted 10 lines · Heinrich Schuchardt

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

Quoted 6 lines

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200428/81d88c7d/attachment.sig>