test_fs: Allow testing FS_GENERIC
authorMarek Vasut <marex@denx.de>
Mon, 17 Mar 2025 03:12:42 +0000 (04:12 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 3 Apr 2025 02:00:59 +0000 (20:00 -0600)
commit6592425c6d7e4e010f3de88bc8ced7163e4f12e2
tree1e6245f6a7657633ff60f37e7c6fa4c45318d72b
parentfa4c9826e222136b9257247bbbb64408437d1906
test_fs: Allow testing FS_GENERIC

The generic filesystem interface was so far untested. The interface
is similar to the FS specific interfaces with FS specific prefixes,
like ext4ls, fatmkdir, ... but it does not have any prefixes, i.e.
it provides plain ls, mkdir, ... commands.

Extend the test parameters to include 'fs_cmd_prefix' and optionally
'fs_cmd_write' parameters. The 'fs_cmd_prefix' allow specifying the
filesystem specific command prefix, like 'ext4' in 'ext4ls'. The
'fs_cmd_write' allows selecting between 'write'/'save' command name
for storing files into the filesystem, see last paragraph.

Introduce new 'fs_generic' fs_type which is used to parametrize existing
tests and run them without any prefixes if detected, thus testing the
generic filesystem interface. Use the fatfs as the backing store for the
generic FS tests.

The check_ubconfig needs to be slightly adjusted to avoid test for
CMD_FS_GENERIC_WRITE which does not exist separately from CMD_FS_GENERIC.

The CMD_FS_GENERIC does not provide generic 'write' command, instead
the generic equivalent command is called 'save' . Add simple ternary
oeprator to use 'save' command for CMD_FS_GENERIC tests and '..write'
commands for filesystem specific tests.

Enable generic filesystem tests for basic/extended/mkdir/unlink tests.

Signed-off-by: Marek Vasut <marex@denx.de>
test/py/tests/fs_helper.py
test/py/tests/test_fs/conftest.py
test/py/tests/test_fs/test_basic.py
test/py/tests/test_fs/test_ext.py
test/py/tests/test_fs/test_mkdir.py
test/py/tests/test_fs/test_unlink.py