Skip to contentSkip to conversation

test/py: Have test_usb.py raise an Exception with unsupported filesystems

PATCH In review Tom Rini 1 participant 2 messages Feb 12, 2025 – Feb 21, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 test/py: Have test_usb.py raise an Exception with unsupported filesystems

With a newer pylint we get a warning about how offset could be used before assigned. This is because when the underlying filesystem wasn't one that is supported we would have runtime test failures. Address this by raise'ing an Exception if fs is not supported.

---
Cc: Love Kumar <[email protected]>
Cc: Andrew Goodbody <[email protected]>

---
 test/py/tests/test_usb.py | 2 ++
 1 file changed, 2 insertions(+)
test/py/tests/test_usb.py +2 -0
index 566d73b7c647..9bef883325f0 100644
@@ -580,6 +580,8 @@ def test_usb_load(u_boot_console):
                     elif fs in ['ext4', 'ext2']:
                         file, size, expected_crc32 = \
                             usb_ext4load_ext4write(u_boot_console, fs, x, part)
+                    else:
+                        raise Exception('Unsupported filesystem type %s' % fs)
 
                     offset = random.randrange(128, 1024, 128)
                     output = u_boot_console.run_command(
Signature · 1 line
2.43.0
author
#1 lore raw
Quoted 6 lines · Tom Rini

With a newer pylint we get a warning about how offset could be used before assigned. This is because when the underlying filesystem wasn't one that is supported we would have runtime test failures. Address this by raise'ing an Exception if fs is not supported.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom