Skip to content

Commit 939df09

Browse files
driver/rawnetworkinterfacedriver: raise when tcpdump fails to start listening
If tcpdump exits cleanly without emitting "tcpdump: listening on" (possibly due to the message being changed), readline() is called on a closed stderr stream, resulting in confusing exceptions. Fix that by raising a proper exception in that case. Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent 63749cf commit 939df09

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

labgrid/driver/rawnetworkinterfacedriver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def start_record(self, filename, *, count=None, timeout=None):
237237
e.stderr = stderr
238238
raise
239239

240+
raise ExecutionError(f"tcpdump exited before emitting 'tcpdump: listening on': {stderr}")
241+
240242
if line.startswith(b"tcpdump: listening on"):
241243
break
242244

0 commit comments

Comments
 (0)