aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_map.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_map.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_map.py')
-rw-r--r--test/test_map.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_map.py b/test/test_map.py
index 952a737c1ac..1655ceda361 100644
--- a/test/test_map.py
+++ b/test/test_map.py
@@ -5,6 +5,8 @@ import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath
+
+import scapy.compat
from scapy.layers.l2 import Ether, Raw
from scapy.layers.inet import IP, UDP, ICMP, TCP, fragment
from scapy.layers.inet6 import IPv6, ICMPv6TimeExceeded
@@ -187,7 +189,7 @@ class TestMAP(VppTestCase):
self.vapi.ppcli("map params pre-resolve del ip6-nh 4001::1")
def validate(self, rx, expected):
- self.assertEqual(rx, expected.__class__(str(expected)))
+ self.assertEqual(rx, expected.__class__(scapy.compat.raw(expected)))
def payload(self, len):
return 'x' * len
@@ -369,7 +371,7 @@ class TestMAP(VppTestCase):
p6_translated = (IPv6(src="1234:5678:90ab:cdef:ac:1001:200:0",
dst="2001:db8:1f0::c0a8:1:f") / payload)
p6_translated.hlim -= 1
- p6_translated['TCP'].options = [('MSS', 1300)]
+ p6_translated[TCP].options = [('MSS', 1300)]
rx = self.send_and_expect(self.pg0, p4*1, self.pg1)
for p in rx:
self.validate(p[1], p6_translated)
@@ -383,7 +385,7 @@ class TestMAP(VppTestCase):
dst=self.pg0.remote_ip4) / payload)
p4_translated.id = 0
p4_translated.ttl -= 1
- p4_translated['TCP'].options = [('MSS', 1300)]
+ p4_translated[TCP].options = [('MSS', 1300)]
rx = self.send_and_expect(self.pg1, p6*1, self.pg0)
for p in rx:
self.validate(p[1], p4_translated)