mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! test: Add pytest suite for NVMEM framework
@ 2025-06-24  8:17 Ahmad Fatoum
  2025-06-24  8:30 ` Oleksij Rempel
  2025-06-24 10:28 ` Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2025-06-24  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-24 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-24  8:17 [PATCH] fixup! test: Add pytest suite for NVMEM framework Ahmad Fatoum
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox