* [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
* Re: [PATCH] fixup! test: Add pytest suite for NVMEM framework
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
1 sibling, 2 replies; 5+ messages in thread
From: Oleksij Rempel @ 2025-06-24 8:30 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Tue, Jun 24, 2025 at 10:17:12AM +0200, Ahmad Fatoum wrote:
> 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>
LGTM
May be better to keep it as separate patch, not as fixup? Since It provides
important information.
Best Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fixup! test: Add pytest suite for NVMEM framework
2025-06-24 8:30 ` Oleksij Rempel
@ 2025-06-24 8:59 ` Ahmad Fatoum
2025-06-24 10:29 ` Sascha Hauer
1 sibling, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2025-06-24 8:59 UTC (permalink / raw)
To: Oleksij Rempel; +Cc: barebox
Hi,
On 6/24/25 10:30, Oleksij Rempel wrote:
> On Tue, Jun 24, 2025 at 10:17:12AM +0200, Ahmad Fatoum wrote:
>> 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>
>
> LGTM
>
> May be better to keep it as separate patch, not as fixup? Since It provides
> important information.
Fine with me either way. If Sascha prefers a separate patch I would
suggest as commit message title:
test: nvmem: fix test failure with CONFIG_DEBUG_PROBES
Cheers,
Ahmad
>
> Best Regards,
> Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fixup! test: Add pytest suite for NVMEM framework
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 10:28 ` Sascha Hauer
1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2025-06-24 10:28 UTC (permalink / raw)
To: barebox, Ahmad Fatoum; +Cc: Oleksij Rempel
On Tue, 24 Jun 2025 10:17:12 +0200, Ahmad Fatoum wrote:
> 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
>
> [...]
Applied, thanks!
[1/1] fixup! test: Add pytest suite for NVMEM framework
https://git.pengutronix.de/cgit/barebox/commit/?id=b90dad565dbe (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fixup! test: Add pytest suite for NVMEM framework
2025-06-24 8:30 ` Oleksij Rempel
2025-06-24 8:59 ` Ahmad Fatoum
@ 2025-06-24 10:29 ` Sascha Hauer
1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2025-06-24 10:29 UTC (permalink / raw)
To: Oleksij Rempel; +Cc: Ahmad Fatoum, barebox
On Tue, Jun 24, 2025 at 10:30:14AM +0200, Oleksij Rempel wrote:
> On Tue, Jun 24, 2025 at 10:17:12AM +0200, Ahmad Fatoum wrote:
> > 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>
>
> LGTM
>
> May be better to keep it as separate patch, not as fixup? Since It provides
> important information.
I agree it provides important information, I just don't see how one
would find it when he needs it, so I decided to keep this as a fixup.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ 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