From a279d9cf615bd60439085ba103125e6f2fa3b27c Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Thu, 28 Feb 2019 09:00:09 -0800 Subject: Tests: Remove all wildcard imports. They mask dependencies and confuse third party tools. Change-Id: I24ee16bfa0d746a8e8cb99891ba8b20523048b69 Signed-off-by: Paul Vinciguerra --- test/lisp.py | 5 +++-- test/test_abf.py | 12 ++++++------ test/test_acl_plugin_macip.py | 4 ++-- test/test_bier.py | 12 ++++++------ test/test_gbp.py | 30 ++++++++++++++---------------- test/test_gre.py | 14 ++++++-------- test/test_igmp.py | 12 ++++++------ test/test_lisp.py | 3 ++- test/test_map.py | 4 +--- test/test_memif.py | 4 +++- test/test_pppoe.py | 16 ++++++---------- test/test_udp.py | 2 +- test/vpp_ip_route.py | 4 ++-- test/vpp_ipsec.py | 2 +- test/vpp_l2.py | 2 +- test/vpp_neighbor.py | 2 +- test/vpp_srv6.py | 2 +- test/vpp_udp_encap.py | 2 +- 18 files changed, 63 insertions(+), 69 deletions(-) diff --git a/test/lisp.py b/test/lisp.py index 2dace8f2f74..90b8914b150 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 fb30fc3018c..cff56c4d309 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 4872bffc17d..f277076aaab 100644 --- a/test/test_acl_plugin_macip.py +++ b/test/test_acl_plugin_macip.py @@ -4,11 +4,11 @@ from __future__ import print_function """ 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 93f0e36b604..5a2c51c1708 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 fd8b79b26b6..28868c1a499 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.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 - -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 dd7b8bc6b8f..044b72993ae 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.inet import IP, UDP 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 c1452c9b83f..253007811be 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 f66fcf79bc0..6ca16811b8b 100644 --- a/test/test_lisp.py +++ b/test/test_lisp.py @@ -10,7 +10,8 @@ from scapy.layers.inet import IP, UDP, Ether 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 cd2533373f9..70d9fa08b28 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 6d462bae018..6da8bf541d3 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 scapy.layers.inet import IP, ICMP 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 b181f6bced7..b6a1eef4b80 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 e04d7beaf06..96375f056f7 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 ac1ada6e384..6e52481782f 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 0241fdf02b6..cf74b4c978d 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 182f2ce7419..67fb996848b 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 b38aae89e74..3099a25e692 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 7701cf35bc3..b84eea37bea 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 5e2df7646a6..7534912bef9 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 -- cgit 1.2.3-korg