Tests: Remove all wildcard imports.
They mask dependencies and confuse third party tools.
Change-Id: I24ee16bfa0d746a8e8cb99891ba8b20523048b69
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
diff --git a/test/lisp.py b/test/lisp.py
index 2dace8f..90b8914 100644
--- a/test/lisp.py
+++ b/test/lisp.py
@@ -1,5 +1,6 @@
-from scapy.fields import *
-from vpp_object import *
+import socket
+
+from vpp_object import VppObject
class VppLispLocatorSet(VppObject):
diff --git a/test/test_abf.py b/test/test_abf.py
index fb30fc3..cff56c4 100644
--- a/test/test_abf.py
+++ b/test/test_abf.py
@@ -1,18 +1,18 @@
#!/usr/bin/env python
+from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
+import unittest
+
from framework import VppTestCase, VppTestRunner
-from vpp_udp_encap import *
from vpp_ip import DpoProto
-from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable
+from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsLabel
from scapy.packet import Raw
-from scapy.layers.l2 import Ether, ARP
+from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
-from scapy.contrib.mpls import MPLS
-from vpp_object import *
-from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
+from vpp_object import VppObject
def find_abf_policy(test, id):
diff --git a/test/test_acl_plugin_macip.py b/test/test_acl_plugin_macip.py
index 4872bff..f277076 100644
--- a/test/test_acl_plugin_macip.py
+++ b/test/test_acl_plugin_macip.py
@@ -4,11 +4,11 @@
"""
import binascii
import random
+from socket import inet_ntop, inet_pton, AF_INET, AF_INET6
+from struct import pack, unpack
import re
import unittest
-from socket import inet_ntop, inet_pton, AF_INET, AF_INET6
-from struct import *
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP
diff --git a/test/test_bier.py b/test/test_bier.py
index 93f0e36..5a2c51c 100644
--- a/test/test_bier.py
+++ b/test/test_bier.py
@@ -1,23 +1,23 @@
#!/usr/bin/env python
import unittest
-import socket
from framework import VppTestCase, VppTestRunner, running_extended_tests
from vpp_ip import DpoProto
-from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsRoute, \
+from vpp_ip_route import VppIpRoute, VppRoutePath, \
VppMplsTable, VppIpMRoute, VppMRoutePath, VppIpTable, \
MRouteEntryFlags, MRouteItfFlags, MPLS_LABEL_INVALID, \
VppMplsLabel
-from vpp_bier import *
-from vpp_udp_encap import *
+from vpp_bier import BIER_HDR_PAYLOAD, VppBierImp, VppBierDispEntry, \
+ VppBierDispTable, VppBierTable, VppBierTableID, VppBierRoute
+from vpp_udp_encap import VppUdpEncap
from scapy.packet import Raw
from scapy.layers.l2 import Ether
-from scapy.layers.inet import IP, UDP, ICMP
+from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
from scapy.contrib.mpls import MPLS
-from scapy.contrib.bier import *
+from scapy.contrib.bier import BIER, BIERLength, BIFT
class TestBFIB(VppTestCase):
diff --git a/test/test_gbp.py b/test/test_gbp.py
index fd8b79b..28868c1 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -1,21 +1,8 @@
#!/usr/bin/env python
+from socket import AF_INET, AF_INET6
import unittest
-from framework import VppTestCase, VppTestRunner
-from vpp_object import VppObject
-from vpp_neighbor import VppNeighbor
-from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, \
- VppIpInterfaceAddress, VppIpInterfaceBind, find_route
-from vpp_l2 import VppBridgeDomain, VppBridgeDomainPort, \
- VppBridgeDomainArpEntry, VppL2FibEntry, find_bridge_domain_port
-from vpp_vxlan_gbp_tunnel import *
-from vpp_sub_interface import VppDot1QSubint
-
-from vpp_ip import *
-from vpp_papi_provider import L2_PORT_TYPE
-from vpp_papi import VppEnum, MACAddress
-
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP, Dot1Q
from scapy.layers.inet import IP, UDP
@@ -24,10 +11,21 @@
from scapy.utils6 import in6_getnsma, in6_getnsmac
from scapy.layers.vxlan import VXLAN
from scapy.data import ETH_P_IP, ETH_P_IPV6
-
-from socket import AF_INET, AF_INET6
from scapy.utils import inet_pton, inet_ntop
+
+from framework import VppTestCase, VppTestRunner
+from vpp_object import VppObject
+from vpp_interface import VppInterface
+from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, \
+ VppIpInterfaceAddress, VppIpInterfaceBind, find_route
+from vpp_l2 import VppBridgeDomain, VppBridgeDomainPort, \
+ VppBridgeDomainArpEntry, VppL2FibEntry, find_bridge_domain_port
+from vpp_sub_interface import VppDot1QSubint
+from vpp_ip import VppIpAddress, VppIpPrefix
+from vpp_papi import VppEnum, MACAddress
from vpp_papi_provider import L2_VTR_OP
+from vpp_vxlan_gbp_tunnel import find_vxlan_gbp_tunnel, INDEX_INVALID, \
+ VppVxlanGbpTunnel
def find_gbp_endpoint(test, sw_if_index=None, ip=None, mac=None):
diff --git a/test/test_gre.py b/test/test_gre.py
index dd7b8bc..044b729 100644
--- a/test/test_gre.py
+++ b/test/test_gre.py
@@ -1,14 +1,6 @@
#!/usr/bin/env python
import unittest
-from logging import *
-
-from framework import VppTestCase, VppTestRunner
-from vpp_sub_interface import VppDot1QSubint
-from vpp_gre_interface import VppGreInterface, VppGre6Interface
-from vpp_ip import DpoProto
-from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable
-from vpp_papi_provider import L2_VTR_OP
from scapy.packet import Raw
from scapy.layers.l2 import Ether, Dot1Q, GRE
@@ -16,6 +8,12 @@
from scapy.layers.inet6 import IPv6
from scapy.volatile import RandMAC, RandIP
+from framework import VppTestCase, VppTestRunner
+from vpp_sub_interface import VppDot1QSubint
+from vpp_gre_interface import VppGreInterface, VppGre6Interface
+from vpp_ip import DpoProto
+from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable
+from vpp_papi_provider import L2_VTR_OP
from util import ppp, ppc
diff --git a/test/test_igmp.py b/test/test_igmp.py
index c1452c9..2530078 100644
--- a/test/test_igmp.py
+++ b/test/test_igmp.py
@@ -2,13 +2,13 @@
import unittest
-from framework import VppTestCase, VppTestRunner, running_extended_tests
-from vpp_igmp import *
-
from scapy.layers.l2 import Ether
-from scapy.layers.inet import IP
-from scapy.contrib.igmpv3 import *
-from scapy.contrib.igmp import *
+from scapy.layers.inet import IP, IPOption
+from scapy.contrib.igmpv3 import IGMPv3, IGMPv3gr, IGMPv3mq, IGMPv3mr
+
+from framework import VppTestCase, VppTestRunner, running_extended_tests
+from vpp_igmp import find_igmp_state, IGMP_FILTER, IgmpRecord, IGMP_MODE, \
+ IgmpSG, VppHostState, wait_for_igmp_event
from vpp_ip_route import find_mroute, VppIpTable
diff --git a/test/test_lisp.py b/test/test_lisp.py
index f66fcf7..6ca1681 100644
--- a/test/test_lisp.py
+++ b/test/test_lisp.py
@@ -10,7 +10,8 @@
from scapy.layers.inet6 import IPv6
from framework import VppTestCase, VppTestRunner
-from lisp import *
+from lisp import VppLocalMapping, VppLispAdjacency, VppLispLocator, \
+ VppLispLocatorSet, VppRemoteMapping
from util import ppp, ForeignAddressFactory
# From py_lispnetworking.lisp.py: # GNU General Public License v2.0
diff --git a/test/test_map.py b/test/test_map.py
index cd25333..70d9fa0 100644
--- a/test/test_map.py
+++ b/test/test_map.py
@@ -1,12 +1,10 @@
#!/usr/bin/env python
import unittest
-import socket
from framework import VppTestCase, VppTestRunner
-from vpp_ip import *
+from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath
-from ipaddress import IPv6Network, IPv4Network
from scapy.layers.l2 import Ether, Raw
from scapy.layers.inet import IP, UDP, ICMP, TCP, fragment
from scapy.layers.inet6 import IPv6, ICMPv6TimeExceeded
diff --git a/test/test_memif.py b/test/test_memif.py
index 6d462ba..6da8bf5 100644
--- a/test/test_memif.py
+++ b/test/test_memif.py
@@ -1,3 +1,4 @@
+import socket
import unittest
from scapy.layers.l2 import Ether
@@ -5,7 +6,8 @@
from framework import VppTestCase, VppTestRunner, running_extended_tests
from remote_test import RemoteClass, RemoteVppTestCase
-from vpp_memif import *
+from vpp_memif import MEMIF_MODE, MEMIF_ROLE, remove_all_memif_vpp_config, \
+ VppSocketFilename, VppMemif
class TestMemif(VppTestCase):
diff --git a/test/test_pppoe.py b/test/test_pppoe.py
index b181f6b..b6a1eef 100644
--- a/test/test_pppoe.py
+++ b/test/test_pppoe.py
@@ -1,21 +1,17 @@
#!/usr/bin/env python
+import socket
import unittest
-from logging import *
-
-from framework import VppTestCase, VppTestRunner
-from vpp_ip_route import VppIpRoute, VppRoutePath
-from vpp_pppoe_interface import VppPppoeInterface
-from vpp_papi_provider import L2_VTR_OP
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.ppp import PPPoE, PPPoED, PPP
-from scapy.layers.inet import IP, UDP
-from scapy.layers.inet6 import IPv6
-from scapy.volatile import RandMAC, RandIP
+from scapy.layers.inet import IP
+
+from framework import VppTestCase, VppTestRunner
+from vpp_ip_route import VppIpRoute, VppRoutePath
+from vpp_pppoe_interface import VppPppoeInterface
from util import ppp, ppc
-import socket
class TestPPPoE(VppTestCase):
diff --git a/test/test_udp.py b/test/test_udp.py
index e04d7be..96375f0 100644
--- a/test/test_udp.py
+++ b/test/test_udp.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import unittest
from framework import VppTestCase, VppTestRunner
-from vpp_udp_encap import *
+from vpp_udp_encap import find_udp_encap, VppUdpEncap
from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, VppMplsLabel
from scapy.packet import Raw
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index ac1ada6..6e52481 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -4,9 +4,9 @@
object abstractions for representing IP routes in VPP
"""
-from vpp_object import *
+from vpp_object import VppObject
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
-from vpp_ip import *
+from vpp_ip import DpoProto, VppIpPrefix
# from vnet/vnet/mpls/mpls_types.h
MPLS_IETF_MAX_LABEL = 0xfffff
diff --git a/test/vpp_ipsec.py b/test/vpp_ipsec.py
index 0241fdf..cf74b4c 100644
--- a/test/vpp_ipsec.py
+++ b/test/vpp_ipsec.py
@@ -1,4 +1,4 @@
-from vpp_object import *
+from vpp_object import VppObject
from ipaddress import ip_address
from vpp_papi import VppEnum
diff --git a/test/vpp_l2.py b/test/vpp_l2.py
index 182f2ce..67fb996 100644
--- a/test/vpp_l2.py
+++ b/test/vpp_l2.py
@@ -3,7 +3,7 @@
"""
-from vpp_object import *
+from vpp_object import VppObject
from vpp_ip import VppIpAddress
from vpp_lo_interface import VppLoInterface
from vpp_papi import MACAddress
diff --git a/test/vpp_neighbor.py b/test/vpp_neighbor.py
index b38aae8..3099a25 100644
--- a/test/vpp_neighbor.py
+++ b/test/vpp_neighbor.py
@@ -5,7 +5,7 @@
"""
from ipaddress import ip_address
-from vpp_object import *
+from vpp_object import VppObject
from vpp_papi import mac_pton, VppEnum
try:
text_type = unicode
diff --git a/test/vpp_srv6.py b/test/vpp_srv6.py
index 7701cf3..b84eea3 100644
--- a/test/vpp_srv6.py
+++ b/test/vpp_srv6.py
@@ -4,7 +4,7 @@
object abstractions for representing SRv6 localSIDs in VPP
"""
-from vpp_object import *
+from vpp_object import VppObject
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
diff --git a/test/vpp_udp_encap.py b/test/vpp_udp_encap.py
index 5e2df76..7534912 100644
--- a/test/vpp_udp_encap.py
+++ b/test/vpp_udp_encap.py
@@ -3,7 +3,7 @@
UDP encap objects
"""
-from vpp_object import *
+from vpp_object import VppObject
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6