From 1761c298afd53423377fad95ebce203e46c084de Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Apr 2025 10:55:03 +0200 Subject: test_fs: Add test -e test Add test for the 'test -e' command to check for existence of files. This exercises struct fstype_info .exists callback. Signed-off-by: Marek Vasut --- test/py/tests/test_fs/test_basic.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/py') diff --git a/test/py/tests/test_fs/test_basic.py b/test/py/tests/test_fs/test_basic.py index 64a3b50f52a..88b163ce305 100644 --- a/test/py/tests/test_fs/test_basic.py +++ b/test/py/tests/test_fs/test_basic.py @@ -35,6 +35,19 @@ class TestFsBasic(object): '%sls host 0:0 invalid_d' % fs_cmd_prefix) assert('' == output) + with ubman.log.section('Test Case 1c - test -e'): + # Test Case 1 - test -e + output = ubman.run_command_list([ + 'host bind 0 %s' % fs_img, + 'test -e host 0:0 1MB.file && echo PASS']) + assert('PASS' in ''.join(output)) + + with ubman.log.section('Test Case 1d - test -e (invalid file)'): + # In addition, test with a nonexistent file to see if we crash. + output = ubman.run_command( + 'test -e host 0:0 2MB.file || echo PASS') + assert('PASS' in ''.join(output)) + def test_fs2(self, ubman, fs_obj_basic): """ Test Case 2 - size command for a small file -- cgit v1.2.3 From 6696f144279f9ee588463ad645e1f0c9b555ba84 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Apr 2025 10:55:05 +0200 Subject: test_fs: Test 'mv' command on exfat and fs_generic Enable tests for the generic FS interface 'mv' command against both exfat and fs_generic. Signed-off-by: Marek Vasut --- test/py/tests/test_fs/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/py') diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py index c73fb4abbcb..0205048e73a 100644 --- a/test/py/tests/test_fs/conftest.py +++ b/test/py/tests/test_fs/conftest.py @@ -17,7 +17,7 @@ supported_fs_fat = ['fat12', 'fat16'] supported_fs_mkdir = ['fat12', 'fat16', 'fat32', 'exfat', 'fs_generic'] supported_fs_unlink = ['fat12', 'fat16', 'fat32', 'exfat', 'fs_generic'] supported_fs_symlink = ['ext4'] -supported_fs_rename = ['fat12', 'fat16', 'fat32'] +supported_fs_rename = ['fat12', 'fat16', 'fat32', 'exfat', 'fs_generic'] # # Filesystem test specific setup -- cgit v1.2.3