tests: py2 cleanup - remove subclassing of object 85/30285/6
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Fri, 4 Dec 2020 19:57:51 +0000 (14:57 -0500)
committerOle Tr�an <otroan@employees.org>
Mon, 7 Dec 2020 08:17:10 +0000 (08:17 +0000)
Type: refactor

Change-Id: I9096e3b473110350e1e8e5936e3c4c164f8969a7
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
21 files changed:
src/plugins/ikev2/test/test_ikev2.py
src/plugins/nat/extras/nat_100ks.py
src/plugins/nat/extras/nat_10Ms.py
src/plugins/nat/extras/nat_10ks.py
src/plugins/nat/extras/nat_1Ms.py
src/plugins/nat/extras/nat_out2in_100ks.py
src/plugins/nat/extras/nat_out2in_10Ms.py
src/plugins/nat/extras/nat_out2in_10ks.py
src/plugins/nat/extras/nat_out2in_1Ms.py
src/plugins/nat/extras/nat_ses_open.py
src/plugins/nat/extras/nat_test_fast_path.py
src/plugins/nat/extras/nat_test_slow_path.py
src/plugins/nat/extras/nat_test_slow_path_with_latency.py
test/hook.py
test/ipfix.py
test/lisp.py
test/remote_test.py
test/template_ipsec.py
test/util.py
test/vpp_ip_route.py
test/vpp_object.py

index 0737990..3a1ab91 100644 (file)
@@ -12,6 +12,7 @@ from cryptography.hazmat.primitives.ciphers import (
     modes,
 )
 from ipaddress import IPv4Address, IPv6Address, ip_address
+import unittest
 from scapy.layers.ipsec import ESP
 from scapy.layers.inet import IP, UDP, Ether
 from scapy.layers.inet6 import IPv6
index f54a6e8..c85a459 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index 068ca5b..6ce62a0 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index 9bd7d8f..33c7196 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index acee676..73a91a7 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index c1d4219..55ab5d4 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12)
index fbd0643..48d3d19 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12)
index 661381e..e961504 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12)
index 54ca5d5..d2cb081 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def create_stream (self):
         base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12)
index 9f0f77e..d614d4e 100644 (file)
@@ -1,6 +1,6 @@
 from trex_stl_lib.api import *
 
-class STLS1(object):
+class STLS1:
 
     def __init__ (self):
         self.ip_range = {'local': {'start': "10.0.0.3", 'end': "10.1.255.255"},
index 97f8525..e869d40 100644 (file)
@@ -1,7 +1,7 @@
 from trex_stl_lib.api import *
 
 
-class STLS1(object):
+class STLS1:
 
     def create_stream(self):
         # base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index 6da2fe6..a6351b9 100644 (file)
@@ -1,7 +1,7 @@
 from trex_stl_lib.api import *
 
 
-class STLS1(object):
+class STLS1:
 
     def create_stream(self):
         # base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index 066e491..6c76634 100644 (file)
@@ -1,7 +1,7 @@
 from trex_stl_lib.api import *
 
 
-class STLS1(object):
+class STLS1:
 
     def create_stream(self, port_id):
         # base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
index 97b05d0..7f2b8e0 100644 (file)
@@ -10,7 +10,7 @@ from log import RED, single_line_delim, double_line_delim
 from util import check_core_path, get_core_path
 
 
-class Hook(object):
+class Hook:
     """
     Generic hooks before/after API/CLI calls
     """
index 5b32a85..bac6dfd 100644 (file)
@@ -501,7 +501,7 @@ bind_layers(IPFIX, Set)
 bind_layers(UDP, IPFIX, dport=4739)
 
 
-class IPFIXDecoder(object):
+class IPFIXDecoder:
     """ IPFIX data set decoder """
 
     def __init__(self):
index a2e711f..bd5e1ab 100644 (file)
@@ -102,19 +102,19 @@ class VppLispLocator(VppObject):
         return 'lisp-locator-%s-%d' % (self._ls_name, self._sw_if_index)
 
 
-class LispEIDType(object):
+class LispEIDType:
     PREFIX = 0
     MAC = 1
     NSH = 2
 
 
-class LispKeyIdType(object):
+class LispKeyIdType:
     NONE = 0
     SHA1 = 1
     SHA256 = 2
 
 
-class LispEID(object):
+class LispEID:
     """ Lisp endpoint identifier """
     def __init__(self, eid):
         self.eid = eid
@@ -155,7 +155,7 @@ class LispEID(object):
             return Exception('Unimplemented')
 
 
-class LispKey(object):
+class LispKey:
     """ Lisp Key """
     def __init__(self, key_type, key):
         self._key_type = key_type
@@ -244,7 +244,7 @@ class VppLocalMapping(VppLispMapping):
         return 'lisp-eid-local-mapping-%s[%d]' % (self._eid.address, self._vni)
 
 
-class LispRemoteLocator(object):
+class LispRemoteLocator:
     def __init__(self, addr, priority=1, weight=1):
         self.addr = addr
         self.priority = priority
index c9686f5..134d90f 100644 (file)
@@ -12,7 +12,7 @@ import sys
 from enum import IntEnum, IntFlag
 
 
-class SerializableClassCopy(object):
+class SerializableClassCopy:
     """
     Empty class used as a basis for a serializable copy of another class.
     """
@@ -22,7 +22,7 @@ class SerializableClassCopy(object):
         return '<SerializableClassCopy dict=%s>' % self.__dict__
 
 
-class RemoteClassAttr(object):
+class RemoteClassAttr:
     """
     Wrapper around attribute of a remotely executed class.
     """
index 7bd0b9e..129f220 100644 (file)
@@ -15,7 +15,7 @@ from util import ppp, reassemble4, fragment_rfc791, fragment_rfc8200
 from vpp_papi import VppEnum
 
 
-class IPsecIPv4Params(object):
+class IPsecIPv4Params:
 
     addr_type = socket.AF_INET
     addr_any = "0.0.0.0"
@@ -54,7 +54,7 @@ class IPsecIPv4Params(object):
         self.dscp = 0
 
 
-class IPsecIPv6Params(object):
+class IPsecIPv6Params:
 
     addr_type = socket.AF_INET6
     addr_any = "0::0"
index b691deb..e21fdb8 100644 (file)
@@ -112,7 +112,7 @@ def check_core_path(logger, core_path):
             "   current core pattern is: %s" % corefmt)
 
 
-class NumericConstant(object):
+class NumericConstant:
 
     desc_dict = {}
 
@@ -131,7 +131,7 @@ class NumericConstant(object):
         return ""
 
 
-class Host(object):
+class Host:
     """ Generic test host "connected" to VPPs interface. """
 
     @property
index c64ad5f..a50693c 100644 (file)
@@ -348,7 +348,7 @@ class VppIpInterfaceBind(VppObject):
         return "interface-bind-%s-%s" % (self.intf, self.table)
 
 
-class VppMplsLabel(object):
+class VppMplsLabel:
     def __init__(self, value, mode=MplsLspMode.PIPE, ttl=64, exp=0):
         self.value = value
         self.mode = mode
@@ -380,7 +380,7 @@ class VppMplsLabel(object):
         return not (self == other)
 
 
-class VppFibPathNextHop(object):
+class VppFibPathNextHop:
     def __init__(self, addr,
                  via_label=MPLS_LABEL_INVALID,
                  next_hop_id=INVALID_INDEX):
@@ -411,7 +411,7 @@ class VppFibPathNextHop(object):
                 self.obj_id == other.obj_id)
 
 
-class VppRoutePath(object):
+class VppRoutePath:
 
     def __init__(
             self,
@@ -691,7 +691,7 @@ class VppIpMRoute(VppObject):
         return c[0][self.stats_index]
 
 
-class VppMFibSignal(object):
+class VppMFibSignal:
     def __init__(self, test, route, interface, packet):
         self.route = route
         self.interface = interface
index 2a993ff..8dd2afa 100644 (file)
@@ -48,7 +48,7 @@ class VppObject(metaclass=abc.ABCMeta):
         return not self.__eq__(other)
 
 
-class VppObjectRegistry(object):
+class VppObjectRegistry:
     """ Class which handles automatic configuration cleanup. """
     _shared_state = {}