VPP-1508: Use scapy.compat to manage packet level library differences.
Change-Id: Icdf6abc9e53d33b26fd1d531c7dda6be0bb9cb55 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:

committed by
Ole Trøan

parent
0f6602cb24
commit
a7427ec6f8
@ -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)
|
||||
|
Reference in New Issue
Block a user