summaryrefslogtreecommitdiff
path: root/test/py/tests/test_usb.py
AgeCommit message (Collapse)Author
2025-03-15test/py: Drop u_boot_ prefix on test filesSimon Glass
We know this is U-Boot so the prefix serves no purpose other than to make things longer and harder to read. Drop it and rename the files. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
2025-03-15test/py: Shorten u_boot_consoleSimon Glass
This fixture name is quite long and results in lots of verbose code. We know this is U-Boot so the 'u_boot_' part is not necessary. But it is also a bit of a misnomer, since it provides access to all the information available to tests. It is not just the console. It would be too confusing to use con as it would be confused with config and it is probably too short. So shorten it to 'ubman'. Signed-off-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
2025-02-21test/py: Have test_usb.py raise an Exception with unsupported filesystemsTom 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. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-10test/py: usb: Fix format string for fstype commandAndrew Goodbody
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> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-17test/py: usb: Distinguish b/w ext2/ext4 partitionsLove Kumar
'usb part' command shows the partition maps and shows the partition type by displaying number such as 0c, 83 etc. Observed that ext2 and ext4 partitions shows the same number, i.e, 83, so, using the fstype command to distiniguish between ext2 and ext4 partitions. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-11-04usb: Fix test dependency on ext4write commandAndrew Goodbody
The tests test_usb_ext4load_ext4write, test_usb_ext2load and test_usb_load depend on the command ext4write being present not just the feature of being able to write to an ext4 file system. So update their dependencies to include the ext4write command itself. This will prevent spurious test failures when running the USB tests against USB storage with an ext2/ext4 partition but no ext4write command available. Fixes: 1c5b6edad381 ("test/py: usb: Add tests for USB device") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-04usb: Fix test failure with multiple partitionsAndrew Goodbody
When test_usb_load finds multiple partitions of the same type then it will cause a test failure. The call to write the test file will write a different test file to each partition but only return the name and size of the last one written. So the test then fails to load the test file from the first partition as it uses the name of a file on a different partition. Refactor the code so that only one test file is written at a time and is written to only the partition being tested at that time. This allows the correct file name to always be available to the code that runs the load command. This reduces the number of files written and also the number of calls to crc32 needed. Fixes: 1c5b6edad381 ("test/py: usb: Add tests for USB device") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: usb: Add tests for USB deviceLove Kumar
Add the test cases for usb commands to test its various functionality such as start, stop, reset, info, tree, storage, dev, part, ls, load, and save. It also adds different file systems cases such as fat32, ext2 and ext4. Signed-off-by: Love Kumar <love.kumar@amd.com>