diff mbox series

test/py: usb: Fix format string for fstype command

Message ID 20250205130427.2385292-1-andrew.goodbody@linaro.org
State New
Headers show
Series test/py: usb: Fix format string for fstype command | expand

Commit Message

Andrew Goodbody Feb. 5, 2025, 1:04 p.m. UTC
USB tests on ext partitions can fail with the following output

test/py/tests/test_usb.py:245: in test_usb_part
    'fstype usb %d:%d' % i, part_id
E   TypeError: not enough arguments for format string

So add brackets around the format string arguments to prevent the
error.

Fixes: a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
---

 test/py/tests/test_usb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut Feb. 5, 2025, 3:30 p.m. UTC | #1
On 2/5/25 2:04 PM, Andrew Goodbody wrote:
> USB tests on ext partitions can fail with the following output
> 
> test/py/tests/test_usb.py:245: in test_usb_part
>      'fstype usb %d:%d' % i, part_id
> E   TypeError: not enough arguments for format string
> 
> So add brackets around the format string arguments to prevent the
> error.
> 
> Fixes: a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>

Thanks !
Love Kumar Feb. 6, 2025, 4:58 a.m. UTC | #2
On 05/02/25 6:34 pm, Andrew Goodbody wrote:
> USB tests on ext partitions can fail with the following output
> 
> test/py/tests/test_usb.py:245: in test_usb_part
>      'fstype usb %d:%d' % i, part_id
> E   TypeError: not enough arguments for format string
> 
> So add brackets around the format string arguments to prevent the
> error.
> 
> Fixes: a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>

Reviewed-by: Love Kumar <love.kumar@amd.com>

Regards,
Love Kumar

> ---
> 
>   test/py/tests/test_usb.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/py/tests/test_usb.py b/test/py/tests/test_usb.py
> index e1f203b5cbc..566d73b7c64 100644
> --- a/test/py/tests/test_usb.py
> +++ b/test/py/tests/test_usb.py
> @@ -242,7 +242,7 @@ def test_usb_part(u_boot_console):
>                       elif part_type == '83':
>                           print('ext(2/4) detected')
>                           output = u_boot_console.run_command(
> -                            'fstype usb %d:%d' % i, part_id
> +                            'fstype usb %d:%d' % (i, part_id)
>                           )
>                           if 'ext2' in output:
>                               part_ext2.append(part_id)
diff mbox series

Patch

diff --git a/test/py/tests/test_usb.py b/test/py/tests/test_usb.py
index e1f203b5cbc..566d73b7c64 100644
--- a/test/py/tests/test_usb.py
+++ b/test/py/tests/test_usb.py
@@ -242,7 +242,7 @@  def test_usb_part(u_boot_console):
                     elif part_type == '83':
                         print('ext(2/4) detected')
                         output = u_boot_console.run_command(
-                            'fstype usb %d:%d' % i, part_id
+                            'fstype usb %d:%d' % (i, part_id)
                         )
                         if 'ext2' in output:
                             part_ext2.append(part_id)