super(RemoteVppTestCase, cls).setUpClass()
os.environ = orig_env
+ @classmethod
+ def tearDownClass(cls):
+ super(RemoteVppTestCase, cls).tearDownClass()
+
@unittest.skip("Empty test")
def emptyTest(self):
""" Do nothing """
""" empty method to be overloaded when necessary """
pass
+ @classmethod
+ def setUpClass(cls):
+ super(TemplateIpsec, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TemplateIpsec, cls).tearDownClass()
+
+ def setUp(self):
+ super(TemplateIpsec, self).setUp()
+
def setup_params(self):
self.ipv4_params = IPsecIPv4Params()
self.ipv6_params = IPsecIPv6Params()
class TestAbf(VppTestCase):
""" ABF Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestAbf, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestAbf, cls).tearDownClass()
+
def setUp(self):
super(TestAbf, self).setUp()
super(TestACLplugin, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACLplugin, cls).tearDownClass()
+
def setUp(self):
super(TestACLplugin, self).setUp()
self.reset_packet_infos()
cls.pg0.remote_hosts = cls.loop0.remote_hosts[:half]
cls.pg1.remote_hosts = cls.loop0.remote_hosts[half:]
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACLpluginL2L3, cls).tearDownClass()
+
def tearDown(self):
"""Run standard test teardown and log ``show l2patch``,
``show l2fib verbose``,``show bridge-domain <bd_id> detail``,
super(MethodHolder, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(MethodHolder, cls).tearDownClass()
+
def setUp(self):
super(MethodHolder, self).setUp()
self.reset_packet_infos()
class TestMACIP_IP4(MethodHolder):
"""MACIP with IP4 traffic"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestMACIP_IP4, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMACIP_IP4, cls).tearDownClass()
+
def test_acl_bridged_ip4_exactMAC_exactIP(self):
""" IP4 MACIP exactMAC|exactIP ACL bridged traffic
"""
class TestMACIP_IP6(MethodHolder):
"""MACIP with IP6 traffic"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestMACIP_IP6, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMACIP_IP6, cls).tearDownClass()
+
def test_acl_bridged_ip6_exactMAC_exactIP(self):
""" IP6 MACIP exactMAC|exactIP ACL bridged traffic
"""
class TestMACIP(MethodHolder):
"""MACIP Tests"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestMACIP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMACIP, cls).tearDownClass()
+
def test_acl_1_2(self):
""" MACIP ACL with 2 entries
"""
class TestACL_dot1q_bridged(MethodHolder):
"""ACL on dot1q bridged subinterfaces Tests"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestACL_dot1q_bridged, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACL_dot1q_bridged, cls).tearDownClass()
+
def test_acl_bridged_ip4_subif_dot1q(self):
""" IP4 ACL SubIf Dot1Q bridged traffic"""
self.run_traffic(self.EXACT_MAC, self.EXACT_IP, self.BRIDGED,
class TestACL_dot1ad_bridged(MethodHolder):
"""ACL on dot1ad bridged subinterfaces Tests"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestACL_dot1ad_bridged, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACL_dot1ad_bridged, cls).tearDownClass()
+
def test_acl_bridged_ip4_subif_dot1ad(self):
""" IP4 ACL SubIf Dot1AD bridged traffic"""
self.run_traffic(self.EXACT_MAC, self.EXACT_IP, self.BRIDGED,
class TestACL_dot1q_routed(MethodHolder):
"""ACL on dot1q routed subinterfaces Tests"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestACL_dot1q_routed, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACL_dot1q_routed, cls).tearDownClass()
+
def test_acl_routed_ip4_subif_dot1q(self):
""" IP4 ACL SubIf Dot1Q routed traffic"""
self.run_traffic(self.EXACT_MAC, self.EXACT_IP, self.ROUTED,
class TestACL_dot1ad_routed(MethodHolder):
"""ACL on dot1ad routed subinterfaces Tests"""
+ @classmethod
+ def setUpClass(cls):
+ super(TestACL_dot1ad_routed, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestACL_dot1ad_routed, cls).tearDownClass()
+
def test_acl_routed_ip6_subif_dot1ad(self):
""" IP6 ACL SubIf Dot1AD routed traffic"""
self.run_traffic(self.EXACT_MAC, self.EXACT_IP, self.ROUTED,
def setUpClass(cls):
super(TestBihash, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestBihash, cls).tearDownClass()
+
def setUp(self):
super(TestBihash, self).setUp()
for i in cls.pg_interfaces:
i.admin_up()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestBondInterface, cls).tearDownClass()
+
def setUp(self):
super(TestBondInterface, self).setUp()
super(TestClassifier, cls).setUpClass()
cls.acl_active_table = ''
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifier, cls).tearDownClass()
+
def setUp(self):
"""
Perform test setup before test case.
class TestClassifierIP(TestClassifier):
""" Classifier IP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP, cls).tearDownClass()
+
def test_iacl_src_ip(self):
""" Source IP iACL test
class TestClassifierUDP(TestClassifier):
""" Classifier UDP proto Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierUDP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierUDP, cls).tearDownClass()
+
def test_iacl_proto_udp(self):
""" UDP protocol iACL test
class TestClassifierTCP(TestClassifier):
""" Classifier TCP proto Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierTCP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierTCP, cls).tearDownClass()
+
def test_iacl_proto_tcp(self):
""" TCP protocol iACL test
class TestClassifierIPOut(TestClassifier):
""" Classifier output IP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIPOut, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIPOut, cls).tearDownClass()
+
def test_acl_ip_out(self):
""" Output IP ACL test
class TestClassifierMAC(TestClassifier):
""" Classifier MAC Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierMAC, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierMAC, cls).tearDownClass()
+
def test_acl_mac(self):
""" MAC ACL test
class TestClassifierPBR(TestClassifier):
""" Classifier PBR Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierPBR, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierPBR, cls).tearDownClass()
+
def test_acl_pbr(self):
""" IP PBR test
super(TestClassifier, cls).setUpClass()
cls.acl_active_table = ''
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifier, cls).tearDownClass()
+
def setUp(self):
"""
Perform test setup before test case.
class TestClassifierIP6(TestClassifier):
""" Classifier IP6 Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP6, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP6, cls).tearDownClass()
+
def test_iacl_src_ip(self):
""" Source IP6 iACL test
class TestClassifierIP6UDP(TestClassifier):
""" Classifier IP6 UDP proto Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP6UDP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP6UDP, cls).tearDownClass()
+
def test_iacl_proto_udp(self):
""" IP6 UDP protocol iACL test
class TestClassifierIP6TCP(TestClassifier):
""" Classifier IP6 TCP proto Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP6TCP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP6TCP, cls).tearDownClass()
+
def test_iacl_proto_tcp(self):
""" IP6 TCP protocol iACL test
class TestClassifierIP6Out(TestClassifier):
""" Classifier output IP6 Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP6Out, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP6Out, cls).tearDownClass()
+
def test_acl_ip_out(self):
""" Output IP6 ACL test
class TestClassifierIP6MAC(TestClassifier):
""" Classifier IP6 MAC Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestClassifierIP6MAC, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifierIP6MAC, cls).tearDownClass()
+
def test_acl_mac(self):
""" IP6 MAC iACL test
super(TestClassifyAcl, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestClassifyAcl, cls).tearDownClass()
+
def setUp(self):
super(TestClassifyAcl, self).setUp()
class TestDHCP(VppTestCase):
""" DHCP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestDHCP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDHCP, cls).tearDownClass()
+
def setUp(self):
super(TestDHCP, self).setUp()
def setUpClass(cls):
super(TestDHCPv6DataPlane, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDHCPv6DataPlane, cls).tearDownClass()
+
def setUp(self):
super(TestDHCPv6DataPlane, self).setUp()
def setUpClass(cls):
super(TestDHCPv6IANAControlPlane, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDHCPv6IANAControlPlane, cls).tearDownClass()
+
def setUp(self):
super(TestDHCPv6IANAControlPlane, self).setUp()
def setUpClass(cls):
super(TestDHCPv6PDControlPlane, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDHCPv6PDControlPlane, cls).tearDownClass()
+
def setUp(self):
super(TestDHCPv6PDControlPlane, self).setUp()
class TestDVR(VppTestCase):
""" Distributed Virtual Router """
+ @classmethod
+ def setUpClass(cls):
+ super(TestDVR, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDVR, cls).tearDownClass()
+
def setUp(self):
super(TestDVR, self).setUp()
class TestFIB(VppTestCase):
""" FIB Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestFIB, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestFIB, cls).tearDownClass()
+
def test_fib(self):
""" FIB Unit Tests """
error = self.vapi.cli("test fib")
class TestGBP(VppTestCase):
""" GBP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestGBP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestGBP, cls).tearDownClass()
+
def setUp(self):
super(TestGBP, self).setUp()
self.pg2.remote_hosts[0].ip4,
99))
- # epg is not learnt, because the EPG is unknwon
+ # epg is not learnt, because the EPG is unknown
self.assertEqual(len(self.vapi.gbp_endpoint_dump()), 1)
#
def setUpClass(cls):
super(TestGRE, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestGRE, cls).tearDownClass()
+
def setUp(self):
super(TestGRE, self).setUp()
super(TestGtpu, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestGtpu, cls).tearDownClass()
+
# Method to define VPP actions before tear down of the test case.
# Overrides tearDown method in VppTestCase class.
# @param self The object pointer.
class TestIgmp(VppTestCase):
""" IGMP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIgmp, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIgmp, cls).tearDownClass()
+
def setUp(self):
super(TestIgmp, self).setUp()
cls.tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestLoopbackInterfaceCRUD, cls).tearDownClass()
+
@staticmethod
def create_icmp_stream(src_if, dst_ifs):
"""
class TestIPv4(VppTestCase):
""" IPv4 Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPv4, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv4, cls).tearDownClass()
+
def setUp(self):
"""
Perform test setup before test case.
class TestICMPEcho(VppTestCase):
""" ICMP Echo Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestICMPEcho, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestICMPEcho, cls).tearDownClass()
+
def setUp(self):
super(TestICMPEcho, self).setUp()
super(TestIPv4FibCrud, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv4FibCrud, cls).tearDownClass()
+
def setUp(self):
super(TestIPv4FibCrud, self).setUp()
self.reset_packet_infos()
class TestIPNull(VppTestCase):
""" IPv4 routes via NULL """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPNull, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPNull, cls).tearDownClass()
+
def setUp(self):
super(TestIPNull, self).setUp()
class TestIPDisabled(VppTestCase):
""" IPv4 disabled """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPDisabled, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPDisabled, cls).tearDownClass()
+
def setUp(self):
super(TestIPDisabled, self).setUp()
class TestIPSubNets(VppTestCase):
""" IPv4 Subnets """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPSubNets, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPSubNets, cls).tearDownClass()
+
def setUp(self):
super(TestIPSubNets, self).setUp()
class TestIPLoadBalance(VppTestCase):
""" IPv4 Load-Balancing """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPLoadBalance, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPLoadBalance, cls).tearDownClass()
+
def setUp(self):
super(TestIPLoadBalance, self).setUp()
class TestIPVlan0(VppTestCase):
""" IPv4 VLAN-0 """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPVlan0, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPVlan0, cls).tearDownClass()
+
def setUp(self):
super(TestIPVlan0, self).setUp()
class TestIPPunt(VppTestCase):
""" IPv4 Punt Police/Redirect """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPPunt, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPPunt, cls).tearDownClass()
+
def setUp(self):
super(TestIPPunt, self).setUp()
class TestIPDeag(VppTestCase):
""" IPv4 Deaggregate Routes """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPDeag, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPDeag, cls).tearDownClass()
+
def setUp(self):
super(TestIPDeag, self).setUp()
class TestIPInput(VppTestCase):
""" IPv4 Input Exceptions """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPInput, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPInput, cls).tearDownClass()
+
def setUp(self):
super(TestIPInput, self).setUp()
class TestIPDirectedBroadcast(VppTestCase):
""" IPv4 Directed Broadcast """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPDirectedBroadcast, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPDirectedBroadcast, cls).tearDownClass()
+
def setUp(self):
super(TestIPDirectedBroadcast, self).setUp()
class TestIPLPM(VppTestCase):
""" IPv4 longest Prefix Match """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPLPM, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPLPM, cls).tearDownClass()
+
def setUp(self):
super(TestIPLPM, self).setUp()
i.config_ip4()
i.resolve_arp()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv4Frag, cls).tearDownClass()
+
def test_frag_large_packets(self):
""" Fragmentation of large packets """
cls.pg0.remote_hosts = cls.bvi0.remote_hosts[:half]
cls.pg1.remote_hosts = cls.bvi0.remote_hosts[half:]
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIpIrb, cls).tearDownClass()
+
def tearDown(self):
"""Run standard test teardown and log ``show l2patch``,
``show l2fib verbose``,``show bridge-domain <bd_id> detail``,
super(TestIp4VrfMultiInst, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIp4VrfMultiInst, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
def setUpClass(cls):
super(TestIPv6, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv6, cls).tearDownClass()
+
def setUp(self):
"""
Perform test setup before test case.
class TestICMPv6Echo(VppTestCase):
""" ICMPv6 Echo Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestICMPv6Echo, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestICMPv6Echo, cls).tearDownClass()
+
def setUp(self):
super(TestICMPv6Echo, self).setUp()
def setUpClass(cls):
super(TestIPv6RD, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv6RD, cls).tearDownClass()
+
def setUp(self):
super(TestIPv6RD, self).setUp()
def setUpClass(cls):
super(TestIPv6RDControlPlane, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv6RDControlPlane, cls).tearDownClass()
+
def setUp(self):
super(TestIPv6RDControlPlane, self).setUp()
class IPv6NDProxyTest(TestIPv6ND):
""" IPv6 ND ProxyTest Case """
+ @classmethod
+ def setUpClass(cls):
+ super(IPv6NDProxyTest, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(IPv6NDProxyTest, cls).tearDownClass()
+
def setUp(self):
super(IPv6NDProxyTest, self).setUp()
class TestIPNull(VppTestCase):
""" IPv6 routes via NULL """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPNull, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPNull, cls).tearDownClass()
+
def setUp(self):
super(TestIPNull, self).setUp()
class TestIPDisabled(VppTestCase):
""" IPv6 disabled """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPDisabled, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPDisabled, cls).tearDownClass()
+
def setUp(self):
super(TestIPDisabled, self).setUp()
class TestIP6LoadBalance(VppTestCase):
""" IPv6 Load-Balancing """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIP6LoadBalance, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIP6LoadBalance, cls).tearDownClass()
+
def setUp(self):
super(TestIP6LoadBalance, self).setUp()
class TestIP6Punt(VppTestCase):
""" IPv6 Punt Police/Redirect """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIP6Punt, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIP6Punt, cls).tearDownClass()
+
def setUp(self):
super(TestIP6Punt, self).setUp()
class TestIPDeag(VppTestCase):
""" IPv6 Deaggregate Routes """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPDeag, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPDeag, cls).tearDownClass()
+
def setUp(self):
super(TestIPDeag, self).setUp()
class TestIP6Input(VppTestCase):
""" IPv6 Input Exception Test Cases """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIP6Input, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIP6Input, cls).tearDownClass()
+
def setUp(self):
super(TestIP6Input, self).setUp()
super(TestIP6VrfMultiInst, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIP6VrfMultiInst, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
class TestMFIB(VppTestCase):
""" MFIB Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMFIB, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMFIB, cls).tearDownClass()
+
def setUp(self):
super(TestMFIB, self).setUp()
class TestIPMcast(VppTestCase):
""" IP Multicast Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestIPMcast, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPMcast, cls).tearDownClass()
+
def setUp(self):
super(TestIPMcast, self).setUp()
cls.create_pg_interfaces(range(2))
cls.interfaces = list(cls.pg_interfaces)
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPIP, cls).tearDownClass()
+
def setUp(self):
super(TestIPIP, self).setUp()
for i in self.interfaces:
cls.create_pg_interfaces(range(2))
cls.interfaces = list(cls.pg_interfaces)
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPIP6, cls).tearDownClass()
+
def setUp(self):
super(TestIPIP6, self).setUp()
for i in self.interfaces:
--- --- ---
"""
+ @classmethod
+ def setUpClass(cls):
+ super(TemplateIpsecAh, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TemplateIpsecAh, cls).tearDownClass()
+
def setUp(self):
super(TemplateIpsecAh, self).setUp()
class IpsecApiTestCase(VppTestCase):
""" IPSec API tests """
+ @classmethod
+ def setUpClass(cls):
+ super(IpsecApiTestCase, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(IpsecApiTestCase, cls).tearDownClass()
+
def setUp(self):
super(IpsecApiTestCase, self).setUp()
self.create_pg_interfaces([0])
--- --- ---
"""
+ @classmethod
+ def setUpClass(cls):
+ super(TemplateIpsecEsp, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TemplateIpsecEsp, cls).tearDownClass()
+
def setUp(self):
super(TemplateIpsecEsp, self).setUp()
self.encryption_type = ESP
"""
UDP encapped ESP
"""
+
+ @classmethod
+ def setUpClass(cls):
+ super(TemplateIpsecEspUdp, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TemplateIpsecEspUdp, cls).tearDownClass()
+
def setUp(self):
super(TemplateIpsecEspUdp, self).setUp()
self.encryption_type = ESP
icmp_id_in = 6305
icmp_id_out = 6305
+ @classmethod
+ def setUpClass(cls):
+ super(IPSecNATTestCase, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(IPSecNATTestCase, cls).tearDownClass()
+
def setUp(self):
super(IPSecNATTestCase, self).setUp()
self.tun_if = self.pg0
encryption_type = ESP
+ @classmethod
+ def setUpClass(cls):
+ super(TemplateIpsec4TunIfEsp, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TemplateIpsec4TunIfEsp, cls).tearDownClass()
+
def setUp(self):
super(TemplateIpsec4TunIfEsp, self).setUp()
super(TestL2fib, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2fib, cls).tearDownClass()
+
def setUp(self):
super(TestL2fib, self).setUp()
self.reset_packet_infos()
class TestL2Flood(VppTestCase):
""" L2-flood """
+ @classmethod
+ def setUpClass(cls):
+ super(TestL2Flood, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2Flood, cls).tearDownClass()
+
def setUp(self):
super(TestL2Flood, self).setUp()
super(TestL2bd, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2bd, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
super(TestL2bdArpTerm, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2bdArpTerm, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
super(TestL2bdMultiInst, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2bdMultiInst, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
super(TestL2xc, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2xc, cls).tearDownClass()
+
def setUp(self):
super(TestL2xc, self).setUp()
self.reset_packet_infos()
super(TestL2xcMultiInst, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestL2xcMultiInst, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
super(TestLB, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestLB, cls).tearDownClass()
+
def tearDown(self):
super(TestLB, self).tearDown()
if not self.vpp_dead:
i.config_ip4() # configure IPv4 address on the interface
i.resolve_arp() # resolve ARP, so that we know VPP MAC
+ @classmethod
+ def tearDownClass(cls):
+ super(TestLisp, cls).tearDownClass()
+
def setUp(self):
super(TestLisp, self).setUp()
self.vapi.lisp_enable_disable(is_enabled=1)
class TestMAP(VppTestCase):
""" MAP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMAP, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMAP, cls).tearDownClass()
+
def setUp(self):
super(TestMAP, self).setUp()
class TestMPLS(VppTestCase):
""" MPLS Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMPLS, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMPLS, cls).tearDownClass()
+
def setUp(self):
super(TestMPLS, self).setUp()
class TestMPLSDisabled(VppTestCase):
""" MPLS disabled """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMPLSDisabled, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMPLSDisabled, cls).tearDownClass()
+
def setUp(self):
super(TestMPLSDisabled, self).setUp()
class TestMPLSPIC(VppTestCase):
""" MPLS PIC edge convergence """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMPLSPIC, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMPLSPIC, cls).tearDownClass()
+
def setUp(self):
super(TestMPLSPIC, self).setUp()
class TestMPLSL2(VppTestCase):
""" MPLS-L2 """
+ @classmethod
+ def setUpClass(cls):
+ super(TestMPLSL2, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMPLSL2, cls).tearDownClass()
+
def setUp(self):
super(TestMPLSL2, self).setUp()
cls.create_pg_interfaces(range(2))
cls.interfaces = list(cls.pg_interfaces)
+ @classmethod
+ def tearDownClass(cls):
+ super(TestMTU, cls).tearDownClass()
+
def setUp(self):
super(TestMTU, self).setUp()
for i in self.interfaces:
super(TestNAT44, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestNAT44, cls).tearDownClass()
+
def test_dynamic(self):
""" NAT44 dynamic translation test """
self.nat44_add_address(self.nat_addr)
super(TestNAT44EndpointDependent, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestNAT44EndpointDependent, cls).tearDownClass()
+
def test_frag_in_order(self):
""" NAT44 translate fragments arriving in order """
self.nat44_add_address(self.nat_addr)
super(TestNAT44Out2InDPO, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestNAT44Out2InDPO, cls).tearDownClass()
+
def configure_xlat(self):
self.dst_ip6_pfx = '1:2:3::'
self.dst_ip6_pfx_n = socket.inet_pton(socket.AF_INET6,
super(TestDeterministicNAT, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDeterministicNAT, cls).tearDownClass()
+
def create_stream_in(self, in_if, out_if, ttl=64):
"""
Create packet stream for inside network
super(TestNAT64, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestNAT64, cls).tearDownClass()
+
def test_nat64_inside_interface_handles_neighbor_advertisement(self):
""" NAT64 inside interface handles Neighbor Advertisement """
super(TestDSlite, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDSlite, cls).tearDownClass()
+
def verify_syslog_apmadd(self, data, isaddr, isport, xsaddr, xsport,
sv6enc, proto):
message = data.decode('utf-8')
super(TestDSliteCE, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestDSliteCE, cls).tearDownClass()
+
def test_dslite_ce(self):
""" Test DS-Lite CE """
super(TestNAT66, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestNAT66, cls).tearDownClass()
+
def test_static(self):
""" 1:1 NAT66 test """
self.vapi.nat66_add_del_interface(self.pg0.sw_if_index)
class ARPTestCase(VppTestCase):
""" ARP Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(ARPTestCase, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(ARPTestCase, cls).tearDownClass()
+
def setUp(self):
super(ARPTestCase, self).setUp()
class NeighborStatsTestCase(VppTestCase):
""" ARP/ND Counters """
+ @classmethod
+ def setUpClass(cls):
+ super(NeighborStatsTestCase, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(NeighborStatsTestCase, cls).tearDownClass()
+
def setUp(self):
super(NeighborStatsTestCase, self).setUp()
for i in cls.pg_interfaces:
i.admin_up()
+ @classmethod
+ def tearDownClass(cls):
+ super(P2PEthernetAPI, cls).tearDownClass()
+
def create_p2p_ethernet(self, parent_if, sub_id, remote_mac):
p2p = VppP2PSubint(self, parent_if, sub_id, mac_pton(remote_mac))
self.p2p_sub_ifs.append(p2p)
cls.pg1.configure_ipv6_neighbors()
cls.pg1.disable_ipv6_ra()
+ @classmethod
+ def tearDownClass(cls):
+ super(P2PEthernetIPV6, cls).tearDownClass()
+
def setUp(self):
super(P2PEthernetIPV6, self).setUp()
for p in self.packets:
cls.pg1.generate_remote_hosts(5)
cls.pg1.configure_ipv4_neighbors()
+ @classmethod
+ def tearDownClass(cls):
+ super(P2PEthernetIPV4, cls).tearDownClass()
+
def setUp(self):
super(P2PEthernetIPV4, self).setUp()
for p in self.packets:
super(TestPing, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestPing, cls).tearDownClass()
+
def tearDown(self):
super(TestPing, self).tearDown()
if not self.vpp_dead:
class TestPipe(VppTestCase):
""" Pipes """
+ @classmethod
+ def setUpClass(cls):
+ super(TestPipe, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestPipe, cls).tearDownClass()
+
def setUp(self):
super(TestPipe, self).setUp()
cls.dst_ip = "100.1.1.100"
cls.dst_ipn = socket.inet_pton(socket.AF_INET, cls.dst_ip)
+ @classmethod
+ def tearDownClass(cls):
+ super(TestPPPoE, cls).tearDownClass()
+
def setUp(self):
super(TestPPPoE, self).setUp()
class TestQOS(VppTestCase):
""" QOS Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestQOS, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestQOS, cls).tearDownClass()
+
def setUp(self):
super(TestQOS, self).setUp()
cls.create_stream(cls.packet_sizes)
cls.create_fragments()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv4Reassembly, cls).tearDownClass()
+
def setUp(self):
""" Test setup - force timeout on existing reassemblies """
super(TestIPv4Reassembly, self).setUp()
cls.create_stream(cls.packet_sizes)
cls.create_fragments()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv6Reassembly, cls).tearDownClass()
+
def setUp(self):
""" Test setup - force timeout on existing reassemblies """
super(TestIPv6Reassembly, self).setUp()
cls.create_stream()
cls.create_fragments()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIPv4ReassemblyLocalNode, cls).tearDownClass()
+
def setUp(self):
""" Test setup - force timeout on existing reassemblies """
super(TestIPv4ReassemblyLocalNode, self).setUp()
cls.packet_sizes = [64, 512, 1518, 9018]
cls.padding = " abcdefghijklmn"
+ @classmethod
+ def tearDownClass(cls):
+ super(TestFIFReassembly, cls).tearDownClass()
+
def setUp(self):
""" Test setup - force timeout on existing reassemblies """
super(TestFIFReassembly, self).setUp()
def setUpClass(cls):
super(TestSCTP, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSCTP, cls).tearDownClass()
+
def setUp(self):
super(TestSCTP, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
def setUpClass(cls):
super(TestSession, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSession, cls).tearDownClass()
+
def setUp(self):
super(TestSession, self).setUp()
class TestSessionUnitTests(VppTestCase):
""" Session Unit Tests Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestSessionUnitTests, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSessionUnitTests, cls).tearDownClass()
+
def setUp(self):
super(TestSessionUnitTests, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
cls.create_pg_interfaces(range(4))
cls.interfaces = list(cls.pg_interfaces)
+ @classmethod
+ def tearDownClass(cls):
+ super(Test6RD, cls).tearDownClass()
+
def setUp(self):
super(Test6RD, self).setUp()
t4 = VppIpTable(self, 10)
class TestSRMPLS(VppTestCase):
""" SR-MPLS Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestSRMPLS, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSRMPLS, cls).tearDownClass()
+
def setUp(self):
super(TestSRMPLS, self).setUp()
""" SRv6 Test Case """
@classmethod
- def setUpClass(self):
- super(TestSRv6, self).setUpClass()
+ def setUpClass(cls):
+ super(TestSRv6, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSRv6, cls).tearDownClass()
def setUp(self):
""" Perform test setup before each test case.
def setUpClass(self):
super(TestSRv6, self).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSRv6, cls).tearDownClass()
+
def setUp(self):
""" Perform test setup before each test case.
"""
def setUpClass(self):
super(TestSRv6, self).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSRv6, cls).tearDownClass()
+
def setUp(self):
""" Perform test setup before each test case.
"""
def setUpClass(cls):
super(TestString, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestString, cls).tearDownClass()
+
def setUp(self):
super(TestString, self).setUp()
class TestSVS(VppTestCase):
""" SVS Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestSVS, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSVS, cls).tearDownClass()
+
def setUp(self):
super(TestSVS, self).setUp()
super(TestSyslog, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSyslog, cls).tearDownClass()
+
def syslog_generate(self, facility, severity, appname, msgid, sd=None,
msg=None):
"""
def setUpClass(cls):
super(TestTCP, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestTCP, cls).tearDownClass()
+
def setUp(self):
super(TestTCP, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
class TestTCPUnitTests(VppTestCase):
"TCP Unit Tests"
+ @classmethod
+ def setUpClass(cls):
+ super(TestTCPUnitTests, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestTCPUnitTests, cls).tearDownClass()
+
def setUp(self):
super(TestTCPUnitTests, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
class TestUdpEncap(VppTestCase):
""" UDP Encap Test Case """
+ @classmethod
+ def setUpClass(cls):
+ super(TestUdpEncap, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestUdpEncap, cls).tearDownClass()
+
def setUp(self):
super(TestUdpEncap, self).setUp()
def setUpClass(cls):
super(TestUDP, cls).setUpClass()
+ @classmethod
+ def tearDownClass(cls):
+ super(TestUDP, cls).tearDownClass()
+
def setUp(self):
super(TestUDP, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
"""Vhost User Test Case
"""
+ @classmethod
+ def setUpClass(cls):
+ super(TesVhostInterface, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TesVhostInterface, cls).tearDownClass()
def tearDown(self):
super(TesVhostInterface, self).tearDown()
super(TestVtr, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestVtr, cls).tearDownClass()
+
def setUp(self):
"""
Clear trace and packet infos before running each test.
super(TestVxlan, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestVxlan, cls).tearDownClass()
+
def test_encap_big_packet(self):
""" Encapsulation test send big frame from pg1
Verify receipt of encapsulated frames on pg0
super(TestVxlanGbp, cls).tearDownClass()
raise
+ @classmethod
+ def tearDownClass(cls):
+ super(TestVxlanGbp, cls).tearDownClass()
+
def assert_eq_pkts(self, pkt1, pkt2):
""" Verify the Ether, IP, UDP, payload are equal in both
packets