[PATCH 7/9] test: fs: allow optional date field in ls output assertion

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Mon May 18 07:57:26 CEST 2026


fs_ls_generic() now prints a date between the file size and filename
when the filesystem sets FS_CAP_DATE (currently FAT and ext4).  The
two regex patterns in test_fs1 used ' *' (zero or more spaces) to
match between the size and filename; that no longer matches when a
date is present.

Change ' *' to ' .*' so the pattern matches both the old format
(size + spaces + name) and the new format (size + spaces + date + name).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 test/py/tests/test_fs/test_basic.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/py/tests/test_fs/test_basic.py b/test/py/tests/test_fs/test_basic.py
index 88b163ce305..5f2af9e21d3 100644
--- a/test/py/tests/test_fs/test_basic.py
+++ b/test/py/tests/test_fs/test_basic.py
@@ -26,8 +26,8 @@ class TestFsBasic(object):
             output = ubman.run_command_list([
                 'host bind 0 %s' % fs_img,
                 '%sls host 0:0' % fs_cmd_prefix])
-            assert(re.search('2621440000 *%s' % BIG_FILE, ''.join(output)))
-            assert(re.search('1048576 *%s' % SMALL_FILE, ''.join(output)))
+            assert(re.search('2621440000 .*%s' % BIG_FILE, ''.join(output)))
+            assert(re.search('1048576 .*%s' % SMALL_FILE, ''.join(output)))
 
         with ubman.log.section('Test Case 1b - ls (invalid dir)'):
             # In addition, test with a nonexistent directory to see if we crash.
-- 
2.53.0



More information about the U-Boot mailing list