import unittest
from asfframework import VppAsfTestCase, VppTestRunner
+from config import config
class TestAdl(VppAsfTestCase):
"""Allow/Deny Plugin Unit Test Cases"""
# limitations under the License.
from asfframework import VppAsfTestCase
+from config import config
+
+import unittest
DEFAULT_VIP = "lb_vip_details(_0=978, context=12, vip=vl_api_lb_ip_addr_t(pfx=IPv6Network(u'::/0'), protocol=<vl_api_ip_proto_t.IP_API_PROTO_RESERVED: 255>, port=0), encap=<vl_api_lb_encap_type_t.LB_API_ENCAP_TYPE_GRE4: 0>, dscp=<vl_api_ip_dscp_t.IP_API_DSCP_CS0: 0>, srv_type=<vl_api_lb_srv_type_t.LB_API_SRV_TYPE_CLUSTERIP: 0>, target_port=0, flow_table_length=0)" # noqa
class TestLbEmptyApi(VppAsfTestCase):
"""TestLbEmptyApi"""
self.assertEqual(rv, [], "Expected: [] Received: %r." % rv)
class TestLbApi(VppAsfTestCase):
"""TestLbApi"""
self.vapi.cli("lb vip 2001::/16 del")
class TestLbAsApi(VppAsfTestCase):
"""TestLbAsApi"""
tag_run_solo,
)
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
+from config import config
@tag_fixme_vpp_workers
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class TestSession(VppAsfTestCase):
"""Session Test Case"""
from asfframework import VppAsfTestCase, VppTestRunner
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
+from config import config
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class TestTCP(VppAsfTestCase):
"""TCP Test Case"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLCutThruTestCase(VCLTestCase):
"""VCL Cut Thru Tests"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackEcho(VCLTestCase):
"""VCL Thru Host Stack Echo"""
self.logger.debug(self.vapi.cli("show app mq"))
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackTLS(VCLTestCase):
"""VCL Thru Host Stack TLS"""
self.logger.debug(self.vapi.cli("show app mq"))
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackEchoInterruptMode(VCLThruHostStackEcho):
"""VCL Thru Host Stack Echo interrupt mode"""
super(VCLThruHostStackTLS, cls).setUpClass()
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackDTLS(VCLTestCase):
"""VCL Thru Host Stack DTLS"""
self.logger.debug(self.vapi.cli("show app mq"))
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackQUIC(VCLTestCase):
"""VCL Thru Host Stack QUIC"""
self.logger.debug(self.vapi.cli("show app mq"))
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackBidirNsock(VCLTestCase):
"""VCL Thru Host Stack Bidir Nsock"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class LDPThruHostStackBidirNsock(VCLTestCase):
"""LDP Thru Host Stack Bidir Nsock"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class LDPThruHostStackNsock(VCLTestCase):
"""LDP Thru Host Stack Nsock"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLThruHostStackNsock(VCLTestCase):
"""VCL Thru Host Stack Nsock"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLIpv6CutThruTestCase(VCLTestCase):
"""VCL IPv6 Cut Thru Tests"""
)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class VCLIpv6ThruHostStackEcho(VCLTestCase):
"""VCL IPv6 Thru Host Stack Echo"""
from asfframework import VppAsfTestCase, VppTestRunner
from vpp_vhost_interface import VppVhostInterface
+from config import config
class TesVhostInterface(VppAsfTestCase):
"""Vhost User Test Case"""
from ipaddress import ip_address
from re import search
from os import popen
+from config import config
class IPsecIPv4Params:
self.assert_packet_checksums_valid(decrypted)
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class IpsecTcpTests(IpsecTcp):
def test_tcp_checksum(self):
"""verify checksum correctness for vpp generated packets"""
self._verify_tra_anti_replay_algorithm_no_esn()
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class IpsecTra4Tests(IpsecTra4):
"""UT test methods for Transport v4"""
self.assert_equal(dc[IPv6ExtHdrFragment].id, 2)
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class IpsecTra6Tests(IpsecTra6):
"""UT test methods for Transport v6"""
from scapy.layers.inet6 import ICMPv6ND_NS, ICMPv6ND_NA, IPv6
from framework import VppTestCase
+from config import config
+
+import unittest
""" TestArping is a subclass of VPPTestCase classes.
"""
[email protected]("arping" in config.excluded_plugins, "Exclude Arping plugin tests")
class TestArping(VppTestCase):
"""Arping Test Case"""
from asfframework import VppTestRunner
from vpp_bond_interface import VppBondInterface
from vpp_papi import MACAddress, VppEnum
+from config import config
class TestBondInterface(VppTestCase):
bond0.remove_vpp_config()
+ @unittest.skipIf(
+ "lacp" in config.excluded_plugins, "Exclude tests requiring LACP plugin"
+ )
def test_bond_add_member(self):
"""Bond add_member/detach member test"""
bond0.remove_vpp_config()
+ @unittest.skipIf(
+ "lacp" in config.excluded_plugins, "Exclude tests requiring LACP plugin"
+ )
def test_bond(self):
"""Bond add/delete interface test"""
self.logger.info("Bond add interfaces")
from re import compile
from time import sleep
from util import ppp
+from config import config
import platform
import sys
import unittest
]
class TestCDP(VppTestCase):
"""CDP Test Case"""
from asfframework import VppTestRunner
from vpp_ip import INVALID_INDEX
from itertools import product
+from config import config
from scapy.packet import Raw
from scapy.layers.l2 import Ether
# -------------------------------------------------------------------
class TestCNatTranslation(CnatCommonTestCase):
"""CNat Translation"""
self.cnat_fhc_translation()
class TestCNatSourceNAT(CnatCommonTestCase):
"""CNat Source NAT"""
self.vapi.cnat_session_purge()
class TestCNatDHCP(CnatCommonTestCase):
"""CNat Translation"""
from scapy.layers.inet import IPerror, UDPerror
from scapy.layers.l2 import Ether
from util import ppp
+from config import config
class TestDET44(VppTestCase):
"""Deterministic NAT Test Cases"""
from vpp_sub_interface import VppDot1QSubint
from vpp_qos import VppQosEgressMap, VppQosMark
from vpp_dhcp import VppDHCPClient, VppDHCPProxy
+from config import config
DHCP4_CLIENT_PORT = 68
@tag_run_solo
class TestDHCP(VppTestCase):
"""DHCP Test Case"""
from framework import VppTestCase
from asfframework import tag_fixme_vpp_workers, tag_run_solo
from vpp_papi import VppEnum
+from config import config
import util
import os
+import unittest
def ip6_normalize(ip6):
return inet_ntop(AF_INET6, inet_pton(AF_INET6, ip6))
class TestDHCPv6DataPlane(VppTestCase):
"""DHCPv6 Data Plane Test Case"""
@tag_run_solo
class TestDHCPv6IANAControlPlane(VppTestCase):
"""DHCPv6 IA NA Control Plane Test Case"""
@tag_fixme_vpp_workers
class TestDHCPv6PDControlPlane(VppTestCase):
"""DHCPv6 PD Control Plane Test Case"""
from framework import VppTestCase
from asfframework import VppTestRunner
from ipaddress import *
+from config import config
from scapy.layers.inet import IP, UDP
from scapy.layers.l2 import Ether
from scapy.layers.dns import DNS, DNSQR
class TestDns(VppTestCase):
"""Dns Test Cases"""
#!/usr/bin/env python3
import socket
+import unittest
from asfframework import tag_fixme_vpp_workers
from framework import VppTestCase
from syslog_rfc5424_parser import SyslogMessage, ParseError
from syslog_rfc5424_parser.constants import SyslogSeverity
from vpp_ip_route import VppIpRoute, VppRoutePath
+from config import config
@tag_fixme_vpp_workers
class TestDSlite(VppTestCase):
"""DS-Lite Test Cases"""
self.logger.info(self.vapi.cli("show dslite sessions"))
class TestDSliteCE(VppTestCase):
"""DS-Lite CE Test Cases"""
from scapy.layers.inet import IP, UDP
from socket import AF_INET
from ipaddress import IPv4Network
+from config import config
NUM_PKTS = 67
[email protected]("acl" in config.excluded_plugins, "Exclude tests requiring ACL plugin")
class TestDVR(VppTestCase):
"""Distributed Virtual Router"""
from socket import inet_ntop
from vpp_papi import VppEnum
from vpp_sub_interface import VppDot1ADSubint
+from config import config
TMPL_COMMON_FIELD_COUNT = 6
@tag_fixme_vpp_workers
@tag_fixme_ubuntu2204
@tag_fixme_debian11
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class Flowprobe(MethodHolder):
"""Template verification, timer tests"""
self.logger.info("FFP_TEST_FINISH_0002")
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class DatapathTx(MethodHolder, DatapathTestsHolder):
"""Collect info on Ethernet, IP4 and IP6 datapath (TX) (no timers)"""
ipfix.remove_vpp_config()
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class DatapathRx(MethodHolder, DatapathTestsHolder):
"""Collect info on Ethernet, IP4 and IP6 datapath (RX) (no timers)"""
@unittest.skipUnless(config.extended, "part of extended tests")
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class DisableIPFIX(MethodHolder):
"""Disable IPFIX"""
@unittest.skipUnless(config.extended, "part of extended tests")
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class ReenableIPFIX(MethodHolder):
"""Re-enable IPFIX"""
@unittest.skipUnless(config.extended, "part of extended tests")
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class DisableFP(MethodHolder):
"""Disable Flowprobe feature"""
@unittest.skipUnless(config.extended, "part of extended tests")
+ "flowprobe" in config.excluded_plugins, "Exclude Flowprobe plugin tests"
+)
class ReenableFP(MethodHolder):
"""Re-enable Flowprobe feature"""
from framework import VppTestCase
from asfframework import VppTestRunner
from template_bd import BridgeDomain
+from config import config
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet import IP, UDP, ICMP
from vpp_ip import INVALID_INDEX
[email protected]("geneve" in config.excluded_plugins, "Exclude GENEVE plugin tests")
class TestGeneve(BridgeDomain, VppTestCase):
"""GENEVE Test Case"""
self.logger.info(self.vapi.cli("show geneve tunnel"))
[email protected]("geneve" in config.excluded_plugins, "Exclude GENEVE plugin tests")
class TestGeneveL3(VppTestCase):
"""GENEVE L3 Test Case"""
from vpp_mpls_tunnel_interface import VppMPLSTunnelInterface
from util import ppp, ppc
from vpp_papi import VppEnum
+from config import config
@tag_fixme_vpp_workers
class TestGREInputNodes(VppTestCase):
"""GRE Input Nodes Test Case"""
self.assertEqual(err, err_count)
class TestGRE(VppTestCase):
"""GRE Test Case"""
from vpp_ipip_tun_interface import VppIpIpTunInterface
from vpp_vxlan_tunnel import VppVxlanTunnel
from vpp_gre_interface import VppGreInterface
+from config import config
from vpp_ipsec import VppIpsecSA, VppIpsecTunProtect
from template_ipsec import (
sw_if_index=self.pg1.sw_if_index, enable_disable=0
)
+ @unittest.skipIf(
+ "vxlan" in config.excluded_plugins, "Exclude tests requiring VXLAN plugin"
+ )
def test_gso_vxlan(self):
"""GSO VXLAN test"""
self.logger.info(self.vapi.cli("sh int addr"))
from framework import VppTestCase
from asfframework import VppTestRunner, tag_fixme_vpp_workers
from template_bd import BridgeDomain
+from config import config
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP
@tag_fixme_vpp_workers
class TestGtpuUDP(VppTestCase):
"""GTPU UDP ports Test Case"""
)
class TestGtpu(BridgeDomain, VppTestCase):
"""GTPU Test Case"""
wait_for_igmp_event,
)
from vpp_ip_route import find_mroute, VppIpTable
+from config import config
class IgmpMode:
@tag_fixme_vpp_workers
class TestIgmp(VppTestCase):
"""IGMP Test Case"""
from framework import VppTestCase
from asfframework import VppTestRunner
+from config import config
class TestLoopbackInterfaceCRUD(VppTestCase):
info = (i.local_ip4, request_src_if.remote_ip4, 0, i.sw_if_index)
self.assertIn(info, rcvd_icmp_pkts)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_crud(self):
# create
loopbacks = self.create_loopback_interfaces(20)
from vpp_neighbor import VppNeighbor
from vpp_lo_interface import VppLoInterface
from vpp_policer import VppPolicer, PolicerAction
+from config import config
NUM_PKTS = 67
)
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class TestICMPEcho(VppTestCase):
"""ICMP Echo Test Case"""
from ipaddress import IPv6Network, IPv6Address
from vpp_gre_interface import VppGreInterface
from vpp_teib import VppTeib
+from config import config
AF_INET6 = socket.AF_INET6
)
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class TestICMPv6Echo(VppTestCase):
"""ICMPv6 Echo Test Case"""
self.assertTrue(pfx.query_vpp_config())
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class TestIP6LinkLocal(VppTestCase):
"""IPv6 Link Local"""
p_echo_request_3.dst = self.pg1.local_mac
self.send_and_expect(self.pg1, [p_echo_request_3], self.pg1)
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_ip6_ll_p2p(self):
"""IPv6 Link Local P2P (GRE)"""
self.pg0.unconfig_ip4()
gre_if.remove_vpp_config()
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_ip6_ll_p2mp(self):
"""IPv6 Link Local P2MP (GRE)"""
)
from vpp_gre_interface import VppGreInterface
from vpp_papi import VppEnum
+from config import config
from scapy.packet import Raw
from scapy.layers.l2 import Ether, GRE
signals = self.vapi.mfib_signal_dump()
self.assertEqual(0, len(signals))
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_ip_mcast_vrf(self):
"""IP Multicast Replication in non-default table"""
self.send_and_expect(self.pg8, tx, self.pg8)
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_ip_mcast_gre(self):
"""IP Multicast Replication over GRE"""
self.assertEqual(rx[IP].dst, gre_if_3.t_dst)
self.assert_packet_checksums_valid(rx)
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_ip6_mcast_gre(self):
"""IP6 Multicast Replication over GRE"""
from vpp_ip_route import VppRoutePath
from framework import VppTestCase
+from config import config
+ "ip_session_redirect" in config.excluded_plugins,
+ "Exclude IP session redirect plugin tests",
+)
class TestIpSessionRedirect(VppTestCase):
"""IP session redirect Test Case"""
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_ip import DpoProto
from vpp_papi import VppEnum
+from config import config
class ConfigIpsecAH(TemplateIpsec):
def tearDown(self):
super(TestIpsecAhAll, self).tearDown()
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_integ_algs(self):
"""All Engines SHA[1_96, 256, 384, 512] w/ & w/o ESN"""
# foreach VPP crypto engine
import socket
+import unittest
from scapy.layers.ipsec import ESP
from scapy.layers.inet import IP, ICMP, UDP
from scapy.layers.inet6 import IPv6
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_ip import DpoProto
from vpp_papi import VppEnum
+from config import config
NUM_PKTS = 67
engines_supporting_chain_bufs = ["openssl", "async"]
}
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class RunTestIpsecEspAll(ConfigIpsecESP, IpsecTra4, IpsecTra6, IpsecTun4, IpsecTun6):
"""Ipsec ESP all Algos"""
from template_ipsec import IPSecIPv6Fwd
from test_ipsec_esp import TemplateIpsecEsp
from template_ipsec import SpdFastPathTemplate
+from config import config
def debug_signal_handler(signal, frame):
self.verify_policy_match(0, policy_1)
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class IPSec4SpdTestCaseProtect(SpdFastPathInboundProtect):
""" IPSec/IPv4 inbound: Policy mode test case with fast path \
(add protect)"""
self.verify_policy_match(0, policy_22)
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+)
class IPSec6SpdTestCaseProtect(SpdFastPathIPv6InboundProtect):
""" IPSec/IPv6 inbound: Policy mode test case with fast path \
(add protect)"""
from vpp_papi_provider import CliFailedCommandError
from vpp_acl import AclRule, VppAcl, VppAclInterface
from vpp_policer import PolicerAction, VppPolicer, Dir
+from config import config
def config_tun_params(p, encryption_type, tun_if, src=None, dst=None):
self.assertEqual(p.tun_if.get_tx_stats(), 127)
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreTebIfEsp(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE TEB ESP - TUN tests"""
super(TestIpsecGreTebIfEsp, self).tearDown()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreTebVlanIfEsp(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE TEB ESP - TUN tests"""
self.pg1_11.remove_vpp_config()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreTebIfEspTra(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE TEB ESP - Tra tests"""
super(TestIpsecGreTebIfEspTra, self).tearDown()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreTebUdpIfEspTra(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE TEB UDP ESP - Tra tests"""
super(TestIpsecGreTebUdpIfEspTra, self).tearDown()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreIfEsp(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE ESP - TUN tests"""
super(TestIpsecGreIfEsp, self).tearDown()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGreIfEspTra(TemplateIpsec, IpsecTun4Tests):
"""Ipsec GRE ESP - TRA tests"""
self.assertEqual(err, 1)
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecGre6IfEspTra(TemplateIpsec, IpsecTun6Tests):
"""Ipsec GRE ESP - TRA tests"""
super(TestIpsecGre6IfEspTra, self).tearDown()
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecMGreIfEspTra4(TemplateIpsec, IpsecTun4):
"""Ipsec mGRE ESP v4 TRA tests"""
self.verify_tun_44(p, count=N_PKTS)
+ "gre" in config.excluded_plugins, "Exclude tests depending on GRE plugin"
+)
class TestIpsecMGreIfEspTra6(TemplateIpsec, IpsecTun6):
"""Ipsec mGRE ESP v6 TRA tests"""
@tag_fixme_vpp_workers
+ "acl" in config.excluded_plugins, "Exclude tests depending on ACL plugin"
+)
class TestIpsec4TunProtectTun(TemplateIpsec, TemplateIpsec4TunProtect, IpsecTun4):
"""IPsec IPv4 Tunnel protect - tunnel mode"""
"""IPsec Interface IPv6 with TFC"""
+ "acl" in config.excluded_plugins, "Exclude tests depending on ACL plugin"
+)
class TestIpsecMIfEsp4(TemplateIpsec, IpsecTun4):
"""Ipsec P2MP ESP v4 tests"""
from asfframework import tag_fixme_vpp_workers
from framework import VppTestCase
+from config import config
+
+import unittest
@tag_fixme_vpp_workers
class TestL2tp(VppTestCase):
"""L2TP Test Case"""
from scapy.layers.inet import IP, UDP
from vpp_object import VppObject
+from config import config
NUM_PKTS = 67
return "l3xc-%d" % self.intf.sw_if_index
class TestL3xc(VppTestCase):
"""L3XC Test Case"""
from vpp_memif import VppSocketFilename, VppMemif
from vpp_bond_interface import VppBondInterface
from vpp_papi import VppEnum
+from config import config
bond_mac = "02:02:02:02:02:02"
lacp_dst_mac = "01:80:c2:00:00:02"
LACP_COLLECTION_AND_DISTRIBUTION_STATE = 63
class TestMarker(VppTestCase):
"""LACP Marker Protocol Test Case"""
bond1.remove_vpp_config()
class TestLACP(VppTestCase):
"""LACP Test Case"""
from util import ppp
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_ip import INVALID_INDEX
+from config import config
+import unittest
""" TestLB is a subclass of VPPTestCase classes.
"""
class TestLB(VppTestCase):
"""Load Balancer Test Case"""
IpsecTun4,
)
from test_ipsec_tun_if_esp import TemplateIpsecItf4
+from config import config
class VppLcpPair(VppObject):
return False
[email protected]("linux-cp" in config.excluded_plugins, "Exclude linux-cp plugin tests")
class TestLinuxCP(VppTestCase):
"""Linux Control Plane"""
tun6.unconfig_ip6()
[email protected]("linux-cp" in config.excluded_plugins, "Exclude linux-cp plugin tests")
class TestLinuxCPIpsec(TemplateIpsec, TemplateIpsecItf4, IpsecTun4):
"""IPsec Interface IPv4"""
LispRemoteLocator,
)
from util import ppp
+from config import config
# From py_lispnetworking.lisp.py: # GNU General Public License v2.0
self.test.pg0.assert_nothing_captured()
class TestLisp(VppTestCase):
"""Basic LISP test"""
self.test_driver.run(self.deid_ip4)
class TestLispUT(VppTestCase):
"""Lisp UT"""
self.assertNotIn("pg0", reply)
class TestLldpVapi(VppTestCase):
"""LLDP plugin test [VAPI]"""
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath
from util import fragment_rfc791, fragment_rfc8200
+from config import config
import scapy.compat
from scapy.layers.l2 import Ether
)
class TestMAP(VppTestCase):
"""MAP Test Case"""
from framework import VppTestCase
from asfframework import VppTestRunner
from vpp_ip_route import VppIpRoute, VppRoutePath
+from config import config
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP, ICMP, TCP, IPerror, UDPerror
from scapy.layers.inet6 import ICMPv6EchoRequest, ICMPv6EchoReply, IPerror6
class TestMAPBR(VppTestCase):
"""MAP-T Test Cases"""
from vpp_memif import remove_all_memif_vpp_config, VppSocketFilename, VppMemif
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi import VppEnum
+from config import config
@tag_run_solo
@tag_fixme_debian11
class TestMemif(VppTestCase):
"""Memif Test Case"""
)
from vpp_mpls_tunnel_interface import VppMPLSTunnelInterface
from vpp_papi import VppEnum
+from config import config
import scapy.compat
from scapy.packet import Raw
rx = self.send_and_expect(self.pg1, tx, self.pg1)
self.verify_capture_ip6(self.pg0, rx, tx)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_deag(self):
"""MPLS Deagg"""
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi import VppEnum
from util import StatsDiff
+from config import config
class TestNAT44ED(VppTestCase):
"""NAT44ED Test Case"""
@tag_fixme_ubuntu2204
class TestNAT44EDMW(TestNAT44ED):
"""NAT44ED MW Test Case"""
from framework import VppTestCase
from asfframework import VppTestRunner
from vpp_papi import VppEnum
+from config import config
def get_nat44_ed_in2out_worker_index(ip, vpp_worker_count):
return 1 + h % vpp_worker_count
class TestNAT44EDOutput(VppTestCase):
"""NAT44 ED output feature Test Case"""
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_neighbor import VppNeighbor
from vpp_papi import VppEnum
+from config import config
# NAT HA protocol event data
@tag_fixme_debian11
class TestNAT44EI(MethodHolder):
"""NAT44EI Test Cases"""
i.remove_vpp_config()
class TestNAT44Out2InDPO(MethodHolder):
"""NAT44EI Test Cases using out2in DPO"""
self.verify_capture_in(capture, self.pg0)
class TestNAT44EIMW(MethodHolder):
"""NAT44EI Test Cases (multiple workers)"""
from syslog_rfc5424_parser.constants import SyslogSeverity
from util import ppc, ppp
from vpp_papi import VppEnum
+from config import config
@tag_fixme_vpp_workers
@tag_fixme_ubuntu2204
class TestNAT64(VppTestCase):
"""NAT64 Test Cases"""
from scapy.layers.l2 import Ether, GRE
from util import ppp
from vpp_papi import VppEnum
+from config import config
class TestNAT66(VppTestCase):
"""NAT66 Test Cases"""
import ipaddress
from framework import VppTestCase
from asfframework import VppTestRunner
+from config import config
from scapy.layers.inet6 import IPv6, ICMPv6EchoRequest, ICMPv6DestUnreach
from scapy.layers.l2 import Ether
from scapy.packet import Raw
class TestNPT66(VppTestCase):
"""NPTv6 Test Case"""
from framework import VppTestCase
from asfframework import VppTestRunner
+from config import config
+ "dispatch-trace" in config.excluded_plugins, "Exclude dispatch trace plugin tests"
+)
class TestPcap(VppTestCase):
"""Pcap Unit Test Cases"""
from framework import VppTestCase
from vpp_ip_route import VppIpInterfaceAddress, VppIpRoute, VppRoutePath
from vpp_neighbor import VppNeighbor
+from config import config
+
+import unittest
""" TestPing is a subclass of VPPTestCase classes.
"""
class TestPing(VppTestCase):
"""Ping Test Case"""
from vpp_interface import VppInterface
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
from vpp_acl import AclRule, VppAcl, VppAclInterface
+from config import config
NUM_PKTS = 67
)
[email protected]("acl" in config.excluded_plugins, "Exclude tests requiring ACL plugin")
class TestPipe(VppTestCase):
"""Pipes"""
from framework import VppTestCase
from asfframework import VppTestRunner
from vpp_papi import VppEnum
+from config import config
class TestPNAT(VppTestCase):
"""PNAT Test Case"""
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_pppoe_interface import VppPppoeInterface
from util import ppp
+from config import config
class TestPPPoE(VppTestCase):
"""PPPoE Test Case"""
from vpp_gre_interface import VppGreInterface
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi import VppEnum
+from config import config
# 35 is enough to have >257 400-byte fragments
test_packet_count = 35
self.verify_capture(packets, dropped_packet_indexes)
self.src_if.assert_nothing_captured()
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_local_enable_disable(self):
"""local reassembly enabled/disable"""
self.vapi.ip_reassembly_enable_disable(
)
rx = self.send_and_expect(self.pg0, [pkt], self.pg0)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_one_fragment(self):
"""whole packet in one fragment processed independently"""
pkt = (
rx = self.send_and_expect(self.pg0, frags[1:], self.pg0, n_rx=1)
self.assertNotIn(IPv6ExtHdrFragment, rx)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_bunch_of_fragments(self):
"""valid fragments followed by rogue fragments and atomic fragment"""
pkt = (
rx = self.send_and_expect(self.pg0, [pkt], self.pg0)
self.assertNotIn(IPv6ExtHdrFragment, rx)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_local_enable_disable(self):
"""local reassembly enabled/disable"""
self.vapi.ip_reassembly_enable_disable(
index, seen, "Packet with packet_index %d not received" % index
)
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_reassembly(self):
"""basic reassembly"""
"Packet with packet_index %d not received" % index,
)
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_fif4(self):
"""Fragments in fragments (4o4)"""
self.gre4.remove_vpp_config()
self.logger.debug(self.vapi.ppcli("show interface"))
+ @unittest.skipIf(
+ "gre" in config.excluded_plugins, "Exclude tests requiring GRE plugin"
+ )
def test_fif6(self):
"""Fragments in fragments (6o6)"""
# TODO this should be ideally in setUpClass, but then we hit a bug
from vpp_vxlan_tunnel import VppVxlanTunnel
from collections import namedtuple
from vpp_papi import VppEnum
+from config import config
Tag = namedtuple("Tag", ["dot1", "vlan"])
DOT1Q = 0x8100
+ "vxlan" in config.excluded_plugins, "Exclude tests requiring VXLAN plugin"
+)
class TestSpan(VppTestCase):
"""SPAN Test Case"""
from scapy.layers.inet import IP, UDP
from util import ppp
+from config import config
[email protected]("srv6-ad" in config.excluded_plugins, "Exclude srv6-ad plugin tests")
class TestSRv6Ad(VppTestCase):
"""SRv6 Dynamic Proxy plugin Test Case"""
from scapy.layers.inet import IP, UDP
from util import ppp
+from config import config
+ "srv6-ad-flow" in config.excluded_plugins, "Exclude srv6-ad-flow plugin tests"
+)
class TestSRv6AdFlow(VppTestCase):
"""SRv6 Flow-based Dynamic Proxy plugin Test Case"""
from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet6 import IPv6, UDP, IPv6ExtHdrSegmentRouting
from scapy.layers.inet import IP, UDP
+from config import config
from util import ppp
[email protected]("srv6-as" in config.excluded_plugins, "Exclude srv6-as plugin tests")
class TestSRv6As(VppTestCase):
"""SRv6 Static Proxy plugin Test Case"""
from ipaddress import IPv4Address
from ipaddress import IPv6Address
from vpp_ip_route import VppIpRoute, VppRoutePath, FibPathProto, VppIpTable
+from config import config
from vpp_srv6_mobile import (
SRv6MobileNhtype,
from scapy.contrib.gtp import *
from scapy.all import *
+import unittest
+
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP4E(VppTestCase):
"""SRv6 End.M.GTP4.E (SRv6 -> GTP-U)"""
self.assertEqual(pkt[GTP_U_Header].teid, 0xBBBBBBBB)
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6TMGTP4D(VppTestCase):
"""SRv6 T.M.GTP4.D (GTP-U -> SRv6)"""
)
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP6E(VppTestCase):
"""SRv6 End.M.GTP6.E"""
self.assertEqual(pkt[GTP_U_Header].teid, 0xBBBBBBBB)
+ "srv6-mobile" in config.excluded_plugins, "Exclude srv6-mobile plugin tests"
+)
class TestSRv6EndMGTP6D(VppTestCase):
"""SRv6 End.M.GTP6.D"""
from scapy.layers.inet6 import IPv6
from vpp_papi import VppEnum
+from config import config
NUM_PKTS = 67
class TestSVS(VppTestCase):
"""SVS Test Case"""
from asfframework import VppTestRunner
from vpp_papi import VppEnum
from vpp_ipsec import VppIpsecSA, VppIpsecSpd, VppIpsecSpdItfBinding, VppIpsecSpdEntry
+from config import config
from scapy.contrib.geneve import GENEVE
from scapy.packet import Raw
self.assertEqual(len(pcap), 17)
+ "tracenode" in config.excluded_plugins, "Exclude tests requiring tracenode plugin"
+)
class TestTraceFilterInner(TemplateTraceFilter):
"""Packet Tracer Filter Inner Test"""
)
from vpp_neighbor import VppNeighbor
from vpp_papi import VppEnum
+from config import config
from scapy.packet import Raw
from scapy.layers.l2 import Ether
@tag_fixme_vpp_workers
+ "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
+)
class TestUDP(VppTestCase):
"""UDP Test Case"""
from scapy.layers.inet6 import IPv6
from vpp_papi import VppEnum
+from config import config
N_PKTS = 63
class TestURPF(VppTestCase):
"""Unicast Reverse Path Forwarding Test Case"""
i.unconfig_ip4()
i.admin_down()
+ @unittest.skipIf(
+ "ping" in config.excluded_plugins, "Exclude tests requiring Ping plugin"
+ )
def test_vlib_mw_refork_frame_leak(self):
"""Vlib worker thread refork leak test case"""
icmp_id = 0xB
return pkt
class TestVRRP4(VppTestCase):
"""IPv4 VRRP Test Case"""
self.assertEqual(rx[VRRPv3].addrlist, [vip])
class TestVRRP6(VppTestCase):
"""IPv6 VRRP Test Case"""
from vpp_vxlan_tunnel import VppVxlanTunnel
from vpp_ip import INVALID_INDEX
from vpp_neighbor import VppNeighbor
+from config import config
class TestVxlan(BridgeDomain, VppTestCase):
"""VXLAN Test Case"""
self.logger.info(self.vapi.cli("show vxlan tunnel"))
class TestVxlan2(VppTestCase):
"""VXLAN Test Case"""
rx = self.send_and_assert_no_replies(self.pg1, [p])
class TestVxlanL2Mode(VppTestCase):
"""VXLAN Test Case"""
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_vxlan_tunnel import VppVxlanTunnel
from vpp_ip import INVALID_INDEX
+from config import config
class TestVxlan6(BridgeDomain, VppTestCase):
"""VXLAN over IPv6 Test Case"""