summaryrefslogtreecommitdiffstats
path: root/test/test_ipsec_nat.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-10 10:04:23 -0700
committerOle Trøan <otroan@employees.org>2019-03-11 08:11:16 +0000
commita7427ec6f86cbeba7594f98e41fecab291d66b73 (patch)
treea1fe195ee4ccdecd420cd908c0752a33ebf3aa19 /test/test_ipsec_nat.py
parent0f6602cb246894ea98253e16aae198094bf78694 (diff)
VPP-1508: Use scapy.compat to manage packet level library differences.
Change-Id: Icdf6abc9e53d33b26fd1d531c7dda6be0bb9cb55 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_ipsec_nat.py')
-rw-r--r--test/test_ipsec_nat.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_ipsec_nat.py b/test/test_ipsec_nat.py
index cdb9cb438f2..e364f5ffe96 100644
--- a/test/test_ipsec_nat.py
+++ b/test/test_ipsec_nat.py
@@ -2,9 +2,11 @@
import socket
+import scapy.compat
from scapy.layers.l2 import Ether
from scapy.layers.inet import ICMP, IP, TCP, UDP
from scapy.layers.ipsec import SecurityAssociation, ESP
+
from util import ppp, ppc
from template_ipsec import TemplateIpsec
from vpp_ipsec import VppIpsecSA, VppIpsecSpd, VppIpsecSpdEntry,\
@@ -126,9 +128,9 @@ class IPSecNATTestCase(TemplateIpsec):
def verify_capture_encrypted(self, capture, sa):
for packet in capture:
try:
- copy = packet.__class__(str(packet))
+ copy = packet.__class__(scapy.compat.raw(packet))
del copy[UDP].len
- copy = packet.__class__(str(copy))
+ copy = packet.__class__(scapy.compat.raw(copy))
self.assert_equal(packet[UDP].len, copy[UDP].len,
"UDP header length")
self.assert_packet_checksums_valid(packet)