From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: [PATCH 5/7] test_fs: Add test -e test
Date: Sun, 13 Apr 2025 10:55:03 +0200 [thread overview]
Message-ID: <20250413085740.5953-5-marex@denx.de> (raw)
In-Reply-To: <20250413085740.5953-1-marex@denx.de>
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 <marex@denx.de>
---
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
test/py/tests/test_fs/test_basic.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
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
--
2.47.2
next prev parent reply other threads:[~2025-04-13 8:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 8:54 [PATCH 1/7] fs: exfat: Flush node before put in read() callback Marek Vasut
2025-04-13 8:55 ` [PATCH 2/7] fs: exfat: Inhibit "impossible" print on write to bogus file Marek Vasut
2025-04-13 8:55 ` [PATCH 3/7] fs: exfat: Rework exfat_fs_readdir() to behave like exfat_fs_ls() Marek Vasut
2025-04-13 8:55 ` [PATCH 4/7] fs: exfat: Fix exfat_fs_exists() return value Marek Vasut
2025-04-13 8:55 ` Marek Vasut [this message]
2025-04-13 8:55 ` [PATCH 6/7] fs: exfat: Implement trivial 'rename' support Marek Vasut
2025-04-13 8:55 ` [PATCH 7/7] test_fs: Test 'mv' command on exfat and fs_generic Marek Vasut
2025-04-22 13:58 ` [PATCH 1/7] fs: exfat: Flush node before put in read() callback Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250413085740.5953-5-marex@denx.de \
--to=marex@denx.de \
--cc=ilias.apalodimas@linaro.org \
--cc=mkorpershoek@baylibre.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox