test: pcap: Avoid creating dumpcap zombies

Story time:

In the days of yore, we generated PCAPs using tcpdump, which will
flush any buffered packets to its output file on reception of
SIGUSR2. Therefore we sent a USR2 before terminating the capture.

At some point, we switched over to use tshark to capture packets for
us, but the SIGUSR2 sayed in place.

It turns out, tshark will just die on USR2, abandoning the dumpcap
child it has created, which means the enclosing network namespace
can't be properly torn down.

Therefore:

Remove skip sending USR2 and just send TERM directly.
This commit is contained in:
Tobias Waldekranz
2024-11-04 14:42:31 +01:00
parent fbddedb51b
commit 17403afeb4
-1
View File
@@ -253,7 +253,6 @@ class Pcap:
# terminating the capture.
time.sleep(sleep)
self.proc.send_signal(signal.SIGUSR2)
self.proc.terminate()
try:
_, stderr = self.proc.communicate(5)