tests: py2 cleanup - remove subclassing of object
Type: refactor Change-Id: I9096e3b473110350e1e8e5936e3c4c164f8969a7 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:

committed by
Ole Tr�an

parent
d6f221789d
commit
e061dad55e
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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"},
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
"""
|
||||
|
@ -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):
|
||||
|
10
test/lisp.py
10
test/lisp.py
@ -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
|
||||
|
@ -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.
|
||||
"""
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 = {}
|
||||
|
||||
|
Reference in New Issue
Block a user