summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsnaramre <snaramre@cisco.com>2019-12-13 23:39:35 +0000
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-14 22:14:12 +0000
commit5d4b8912d2fe186b4fb920a72b3a2f7b556f4e7d (patch)
tree4530f71a783679e3566ed501471cbad481c128d7 /src
parentaa72578637e2a346ee845545b2e26aad83e12192 (diff)
tests: changes for scapy 2.4.3 migration
Type: fix Change-Id: I7e041b666dabd90df23a920a1f1d99db4c10ddfe Signed-off-by: snaramre <snaramre@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/acl/test/test_acl_plugin_macip.py2
-rw-r--r--src/plugins/dhcp/test/test_dhcp.py3
-rw-r--r--src/plugins/dhcp/test/test_dhcp6.py3
-rw-r--r--src/plugins/gbp/test/test_gbp.py3
-rw-r--r--src/plugins/gtpu/test/test_gtpu.py3
-rw-r--r--src/plugins/igmp/test/test_igmp.py3
-rw-r--r--src/plugins/map/test/test_map.py3
-rw-r--r--src/plugins/srv6-ad/test/test_srv6_ad.py2
-rw-r--r--src/plugins/srv6-am/test/test_srv6.py2
-rwxr-xr-xsrc/plugins/srv6-as/test/test_srv6_as.py2
10 files changed, 10 insertions, 16 deletions
diff --git a/src/plugins/acl/test/test_acl_plugin_macip.py b/src/plugins/acl/test/test_acl_plugin_macip.py
index e1393696875..0f178a36b69 100644
--- a/src/plugins/acl/test/test_acl_plugin_macip.py
+++ b/src/plugins/acl/test/test_acl_plugin_macip.py
@@ -442,7 +442,7 @@ class MethodHolder(VppTestCase):
packet /= UDP(sport=src_port, dport=dst_port)/Raw(payload)
- packet[Raw].load += b" mac:%s" % scapy.compat.raw(src_mac)
+ packet[Raw].load += b" mac:%s" % src_mac.encode('utf-8')
size = self.pg_if_packet_sizes[p % len(self.pg_if_packet_sizes)]
if isinstance(src_if, VppSubInterface):
diff --git a/src/plugins/dhcp/test/test_dhcp.py b/src/plugins/dhcp/test/test_dhcp.py
index 14e20c419b0..07db35d0cd0 100644
--- a/src/plugins/dhcp/test/test_dhcp.py
+++ b/src/plugins/dhcp/test/test_dhcp.py
@@ -18,8 +18,7 @@ from scapy.layers.dhcp import DHCP, BOOTP, DHCPTypes
from scapy.layers.dhcp6 import DHCP6, DHCP6_Solicit, DHCP6_RelayForward, \
DHCP6_RelayReply, DHCP6_Advertise, DHCP6OptRelayMsg, DHCP6OptIfaceId, \
DHCP6OptStatusCode, DHCP6OptVSS, DHCP6OptClientLinkLayerAddr, DHCP6_Request
-from socket import AF_INET, AF_INET6
-from scapy.utils import inet_pton, inet_ntop
+from socket import AF_INET, AF_INET6, inet_pton, inet_ntop
from scapy.utils6 import in6_ptop
from vpp_papi import mac_pton, VppEnum
from vpp_sub_interface import VppDot1QSubint
diff --git a/src/plugins/dhcp/test/test_dhcp6.py b/src/plugins/dhcp/test/test_dhcp6.py
index 9beff5a60e5..7254496f48f 100644
--- a/src/plugins/dhcp/test/test_dhcp6.py
+++ b/src/plugins/dhcp/test/test_dhcp6.py
@@ -1,4 +1,4 @@
-from socket import AF_INET6
+from socket import AF_INET6, inet_ntop, inet_pton
from scapy.layers.dhcp6 import DHCP6_Advertise, DHCP6OptClientId, \
DHCP6OptStatusCode, DHCP6OptPref, DHCP6OptIA_PD, DHCP6OptIAPrefix, \
@@ -7,7 +7,6 @@ from scapy.layers.dhcp6 import DHCP6_Advertise, DHCP6OptClientId, \
DHCP6OptIAAddress
from scapy.layers.inet6 import IPv6, Ether, UDP
from scapy.utils6 import in6_mactoifaceid
-from scapy.utils import inet_ntop, inet_pton
from framework import VppTestCase
from vpp_papi import VppEnum
diff --git a/src/plugins/gbp/test/test_gbp.py b/src/plugins/gbp/test/test_gbp.py
index ab4e3a59abd..5038237106b 100644
--- a/src/plugins/gbp/test/test_gbp.py
+++ b/src/plugins/gbp/test/test_gbp.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from socket import AF_INET, AF_INET6
+from socket import AF_INET, AF_INET6, inet_pton, inet_ntop
import unittest
from ipaddress import ip_address, IPv4Network, IPv6Network
@@ -12,7 +12,6 @@ from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6NDOptSrcLLAddr, \
from scapy.utils6 import in6_getnsma, in6_getnsmac
from scapy.layers.vxlan import VXLAN
from scapy.data import ETH_P_IP, ETH_P_IPV6, ETH_P_ARP
-from scapy.utils import inet_pton, inet_ntop
from framework import VppTestCase, VppTestRunner
from vpp_object import VppObject
diff --git a/src/plugins/gtpu/test/test_gtpu.py b/src/plugins/gtpu/test/test_gtpu.py
index e6d9c9e0598..667d61c0143 100644
--- a/src/plugins/gtpu/test/test_gtpu.py
+++ b/src/plugins/gtpu/test/test_gtpu.py
@@ -6,7 +6,8 @@ import unittest
from framework import VppTestCase, VppTestRunner
from template_bd import BridgeDomain
-from scapy.layers.l2 import Ether, Raw
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
from scapy.contrib.gtp import GTP_U_Header
diff --git a/src/plugins/igmp/test/test_igmp.py b/src/plugins/igmp/test/test_igmp.py
index 3f9b99bb5b5..1974794f058 100644
--- a/src/plugins/igmp/test/test_igmp.py
+++ b/src/plugins/igmp/test/test_igmp.py
@@ -2,7 +2,8 @@
import unittest
-from scapy.layers.l2 import Ether, Raw
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
from scapy.layers.inet import IP, IPOption
from scapy.contrib.igmpv3 import IGMPv3, IGMPv3gr, IGMPv3mq, IGMPv3mr
diff --git a/src/plugins/map/test/test_map.py b/src/plugins/map/test/test_map.py
index 9da3d0c9074..592e49e499a 100644
--- a/src/plugins/map/test/test_map.py
+++ b/src/plugins/map/test/test_map.py
@@ -9,7 +9,8 @@ from vpp_ip_route import VppIpRoute, VppRoutePath
from util import fragment_rfc791, fragment_rfc8200
import scapy.compat
-from scapy.layers.l2 import Ether, Raw
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
from scapy.layers.inet import IP, UDP, ICMP, TCP, fragment
from scapy.layers.inet6 import IPv6, ICMPv6TimeExceeded
diff --git a/src/plugins/srv6-ad/test/test_srv6_ad.py b/src/plugins/srv6-ad/test/test_srv6_ad.py
index 545553ec738..55f3da0b262 100644
--- a/src/plugins/srv6-ad/test/test_srv6_ad.py
+++ b/src/plugins/srv6-ad/test/test_srv6_ad.py
@@ -16,8 +16,6 @@ from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet6 import IPv6, UDP, IPv6ExtHdrSegmentRouting
from scapy.layers.inet import IP, UDP
-from scapy.utils import inet_pton, inet_ntop
-
from util import ppp
diff --git a/src/plugins/srv6-am/test/test_srv6.py b/src/plugins/srv6-am/test/test_srv6.py
index 0f0358f118a..ac880f1d881 100644
--- a/src/plugins/srv6-am/test/test_srv6.py
+++ b/src/plugins/srv6-am/test/test_srv6.py
@@ -15,8 +15,6 @@ from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet6 import IPv6, UDP, IPv6ExtHdrSegmentRouting
from scapy.layers.inet import IP, UDP
-from scapy.utils import inet_pton, inet_ntop
-
from util import ppp
diff --git a/src/plugins/srv6-as/test/test_srv6_as.py b/src/plugins/srv6-as/test/test_srv6_as.py
index 26a4bf4f428..9c4f3e274c7 100755
--- a/src/plugins/srv6-as/test/test_srv6_as.py
+++ b/src/plugins/srv6-as/test/test_srv6_as.py
@@ -15,8 +15,6 @@ from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet6 import IPv6, UDP, IPv6ExtHdrSegmentRouting
from scapy.layers.inet import IP, UDP
-from scapy.utils import inet_pton, inet_ntop
-
from util import ppp