]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test/py: Have test_usb.py raise an Exception with unsupported filesystems
authorTom Rini <trini@konsulko.com>
Wed, 12 Feb 2025 22:23:54 +0000 (16:23 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 21 Feb 2025 14:24:05 +0000 (08:24 -0600)
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.

Signed-off-by: Tom Rini <trini@konsulko.com>
test/py/tests/test_usb.py

index 566d73b7c6473dc93a94ee6171ab86e132151b26..9bef883325f06ef5645bad58c4d0ffd6bc2a0480 100644 (file)
@@ -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(