From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: "Claude Opus 4.6" <noreply@anthropic.com>,
Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 1/4] test: py: network: preserve saved_log_level across _await_prompt
Date: Mon, 2 Mar 2026 14:47:33 +0100 [thread overview]
Message-ID: <20260302134843.195007-2-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260302134843.195007-1-a.fatoum@barebox.org>
After sendcontrol("c") in tftp_conversation, the call to
_await_prompt() re-queries global.loglevel. At this point, loglevel
has already been silenced to 0 by the previous _run() command's
cleanup, so _await_prompt() saves 0 as the log level to use for
future commands.
This causes the barebox_interfaces fixture's ifup -a to run at
loglevel 0 on the next test, suppressing the dev_info "DHCP client
bound to address" message that the fixture parses to discover
interfaces. The test_barebox_network_real_tftp test then fails with
"Network testing is only possible with at least one DHCP interface".
Fix by saving and restoring saved_log_level across the _await_prompt()
call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
test/py/test_network.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/test/py/test_network.py b/test/py/test_network.py
index c8c5e9ec7606..922e425a2b9c 100644
--- a/test/py/test_network.py
+++ b/test/py/test_network.py
@@ -68,7 +68,12 @@ def tftp_conversation(barebox, barebox_interface, guestaddr):
finally:
# terminate a timed-out tftp
barebox.console.sendcontrol("c")
+ saved_log_level = barebox.saved_log_level
barebox._await_prompt()
+ # _await_prompt() re-queries global.loglevel, which has been
+ # silenced to 0 by _run(), and saves it. Restore the original
+ # level so subsequent run_check() calls still raise it.
+ barebox.saved_log_level = saved_log_level
tftp_thread.join()
barebox.run_check("ifdown eth0")
--
2.47.3
next prev parent reply other threads:[~2026-03-02 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 13:47 [PATCH 0/4] ci: fixes for PowerPC and networking test Ahmad Fatoum
2026-03-02 13:47 ` Ahmad Fatoum [this message]
2026-03-02 13:47 ` [PATCH 2/4] powerpc: fix initjmp storing function pointer at wrong offset Ahmad Fatoum
2026-03-02 13:47 ` [PATCH 3/4] powerpc: qemu-ppce500_defconfig: increase malloc area to default 4 MiB Ahmad Fatoum
2026-03-02 13:47 ` [PATCH 4/4] test: selftest: mmu: skip mirroring tests when not supported Ahmad Fatoum
2026-03-04 7:36 ` [PATCH 0/4] ci: fixes for PowerPC and networking test 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=20260302134843.195007-2-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/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