From: Vincent Bernat Date: Sat, 19 Oct 2019 19:52:05 +0000 (+0200) Subject: test: use scapy when sending pcap files X-Git-Tag: 1.0.5~35^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ece1209a900fc5cbac53daf02032bf912d42d463;p=thirdparty%2Flldpd.git test: use scapy when sending pcap files --- diff --git a/tests/integration/test_pcap.py b/tests/integration/test_pcap.py index c75b0b2e..8e2a3cb6 100644 --- a/tests/integration/test_pcap.py +++ b/tests/integration/test_pcap.py @@ -1,72 +1,54 @@ -import pytest -import socket -import struct +import scapy.all def send_pcap(location, interface): - """Send a PCAP file to the given interface. It is assumed that all - pcap files are little-endian.""" - with open(location, 'rb') as f: - hdr = f.read(24) - magic, major, minor, _, _, _, network = struct.unpack("