[PATCH] test: py: network: await prompt after ctrl+c

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Feb 25 06:15:34 PST 2026


The expect buffer will contain the <INTERRUPT> string output by barebox
followed by a prompt, which run_check would gobble up.

Currently, this doesn't matter, but when we start to additionally match
against the plain prompt, this would lead us not to match the prompt
string with the marker in run_check.
To fix this, _await_prompt to get the <INTERRUPT><prompt> removed from
the expect buffer.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 test/py/test_network.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/py/test_network.py b/test/py/test_network.py
index e76aad1cc6f6..e22da0680204 100644
--- a/test/py/test_network.py
+++ b/test/py/test_network.py
@@ -67,6 +67,7 @@ def tftp_conversation(barebox, barebox_interface, guestaddr):
     finally:
         # terminate a timed-out tftp
         barebox.console.sendcontrol("c")
+        barebox._await_prompt()
         tftp_thread.join()
         barebox.run_check("ifdown eth0")
 
-- 
2.47.3




More information about the barebox mailing list