[COMMIT osv master] scripts: fix trace.py

4 views
Skip to first unread message

Commit Bot

unread,
May 28, 2021, 9:17:20 AM5/28/21
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

scripts: fix trace.py

Newer versions of tcpdump uses by trace.py emit slightly
longer text "reading from file -, link-type EN10MB (Ethernet)"
and make the tst-tracing fail. This patch make trace.py only
check that the line begins with that expected text.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/scripts/trace.py b/scripts/trace.py
--- a/scripts/trace.py
+++ b/scripts/trace.py
@@ -346,7 +346,7 @@ def format_packet_sample(sample):
pcap = dpkt.pcap.Writer(proc.stdin)
write_sample_to_pcap(sample, pcap)
pcap.close()
- assert(proc.stdout.readline().decode() == "reading from file -, link-type EN10MB (Ethernet)\n")
+ assert(proc.stdout.readline().decode().startswith("reading from file -, link-type EN10MB (Ethernet)"))
packet_line = proc.stdout.readline().rstrip()
proc.wait()
return packet_line
Reply all
Reply to author
Forward
0 new messages