From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! test: Add pytest suite for NVMEM framework
Date: Tue, 24 Jun 2025 10:17:12 +0200 [thread overview]
Message-ID: <20250624081712.4054548-1-a.fatoum@pengutronix.de> (raw)
If CONFIG_DEBUG_PROBES is enabled, barebox will print an info log
whenever a device is probed. This breaks one test case in the newly
introduced nvmem tests, because running the nvmem command results in two
lines instead of one:
probe-> rmem1
rmem1
A better solution might be disabling stderr, but for now, let's just
have the test check all lines that appeared after running the command.
This fixes CI breakage in next.
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
test/py/test_nvmem.py | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/test/py/test_nvmem.py b/test/py/test_nvmem.py
index 0eec93d65c4c..6070877a6868 100644
--- a/test/py/test_nvmem.py
+++ b/test/py/test_nvmem.py
@@ -257,13 +257,7 @@ def test_nvmem_create_dynamic_device_with_var(barebox, barebox_config):
stdout_compound_raw = barebox.run_check(compound_cmd)
- actual_dev_name_in_var = stdout_compound_raw[0].strip() if stdout_compound_raw else "'' (compound cmd gave no stdout lines)"
-
- assert actual_dev_name_in_var == expected_dev_name_in_var, (
- f"Environment variable {var_to_set_in_barebox} (from compound cmd) was "
- f"'{actual_dev_name_in_var}', expected "
- f"'{expected_dev_name_in_var}'"
- )
+ assert expected_dev_name_in_var in stdout_compound_raw
# Verify the device is listed by `nvmem`
stdout_list_a, _, returncode = barebox.run('nvmem')
@@ -271,7 +265,7 @@ def test_nvmem_create_dynamic_device_with_var(barebox, barebox_config):
# The 'nvmem' list might show "rmemX0" while the var stores "rmemX".
# The pattern checks for this.
- list_pattern_check = actual_dev_name_in_var
+ list_pattern_check = expected_dev_name_in_var
pattern = re.compile(f"^{re.escape(list_pattern_check)}0?$")
assert any(pattern.match(line.strip()) for line in stdout_list_a), (
f"Device corresponding to '{list_pattern_check}' (pattern: '{pattern.pattern}') "
--
2.39.5
next reply other threads:[~2025-06-24 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 8:17 Ahmad Fatoum [this message]
2025-06-24 8:30 ` Oleksij Rempel
2025-06-24 8:59 ` Ahmad Fatoum
2025-06-24 10:29 ` Sascha Hauer
2025-06-24 10:28 ` Sascha Hauer
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=20250624081712.4054548-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=o.rempel@pengutronix.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