diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:25 +0000 |
commit | 289582b3dcbeb23328325d224c7db7de66a3a55f (patch) | |
tree | 989c36d57aab945c36e34c952f438746ce18b3bd /tests/topotests/bgp_tcp_mss | |
parent | Releasing progress-linux version 10.0.1-0.1~progress7.99u1. (diff) | |
download | frr-289582b3dcbeb23328325d224c7db7de66a3a55f.tar.xz frr-289582b3dcbeb23328325d224c7db7de66a3a55f.zip |
Merging upstream version 10.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/topotests/bgp_tcp_mss')
-rw-r--r-- | tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py | 2 | ||||
-rw-r--r-- | tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py | 135 |
2 files changed, 65 insertions, 72 deletions
diff --git a/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py b/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py index e7948ea..4855d5c 100644 --- a/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py +++ b/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py @@ -36,8 +36,6 @@ from lib import topotest from lib.topogen import Topogen, TopoRouter, get_topogen from lib.topolog import logger -pytestmark = [pytest.mark.bgpd] - def build_topo(tgen): for routern in range(1, 3): diff --git a/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py b/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py index 6fe044f..aeb9bf5 100644 --- a/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py +++ b/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py @@ -46,7 +46,7 @@ from lib.bgp import ( verify_bgp_rib, verify_bgp_timers_and_functionality, verify_router_id, - verify_tcp_mss + verify_tcp_mss, ) from lib.common_config import ( kill_router_daemons, @@ -54,6 +54,7 @@ from lib.common_config import ( addKernelRoute, apply_raw_config, check_address_types, + check_router_status, create_prefix_lists, create_route_maps, create_static_routes, @@ -66,10 +67,9 @@ from lib.common_config import ( verify_fib_routes, verify_rib, write_test_footer, - write_test_header + write_test_header, ) -pytestmark = [pytest.mark.bgpd] # Global variables NETWORK1_1 = {"ipv4": "1.1.1.1/32", "ipv6": "1::1/128"} NETWORK1_2 = {"ipv4": "1.1.1.2/32", "ipv6": "1::2/128"} @@ -85,7 +85,8 @@ NETWORK5_2 = {"ipv4": "5.1.1.2/32", "ipv6": "5::2/128"} NEXT_HOP_IP = {"ipv4": "Null0", "ipv6": "Null0"} ## File name -TCPDUMP_FILE="test_tcp_packet_test.txt" +TCPDUMP_FILE = "test_tcp_packet_test.txt" + def setup_module(mod): """ @@ -93,7 +94,7 @@ def setup_module(mod): * `mod`: module name """ - global topo,TCPDUMP_FILE + global topo, TCPDUMP_FILE # Required linux kernel version for this suite to run. result = required_linux_kernel_version("4.15") @@ -128,6 +129,7 @@ def setup_module(mod): step("Running setup_module() done") + def teardown_module(): """Teardown the pytest environment""" @@ -138,9 +140,7 @@ def teardown_module(): # Stop toplogy and Remove tmp files tgen.stop_topology() - step( - "Testsuite end time: {}".format(time.asctime(time.localtime(time.time()))) - ) + step("Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))) step("=" * 40) @@ -150,6 +150,7 @@ def teardown_module(): # ##################################################### + def test_bgp_vrf_tcp_mss(request): tgen = get_topogen() tc_name = request.node.name @@ -280,34 +281,34 @@ def test_bgp_vrf_tcp_mss(request): step("Verify the static Routes in R2 on RED VRF") for addr_type in ADDR_TYPES: static_routes_input = { - "r3": { - "static_routes": [ - { - "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK5_1[addr_type]] + [NETWORK5_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - ] + "r3": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK5_1[addr_type]] + [NETWORK5_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + ] } } dut = "r2" @@ -317,34 +318,34 @@ def test_bgp_vrf_tcp_mss(request): step("Verify the static Routes in R1 on RED VRF") for addr_type in ADDR_TYPES: static_routes_input = { - "r3": { - "static_routes": [ - { - "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - { - "network": [NETWORK5_1[addr_type]] + [NETWORK5_2[addr_type]], - "next_hop": NEXT_HOP_IP[addr_type], - "vrf": "RED", - }, - ] + "r3": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + { + "network": [NETWORK5_1[addr_type]] + [NETWORK5_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED", + }, + ] } } dut = "r1" @@ -404,9 +405,6 @@ def test_bgp_vrf_tcp_mss(request): tcp_mss_result ) - - - step("Enabling tcp-mss 500 between R2 and R3 of VRF Default") TCP_MSS = 500 raw_config = { @@ -440,8 +438,6 @@ def test_bgp_vrf_tcp_mss(request): result = apply_raw_config(tgen, raw_config) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) - - step("Clear BGP at router R2 and R3") for addr_type in ADDR_TYPES: clear_bgp(tgen, topo, "r2", addr_type) @@ -550,7 +546,6 @@ def test_bgp_vrf_tcp_mss(request): tcp_mss_result is not True ), " TCP-MSS mismatch :Failed \n Error: {}".format(tcp_mss_result) - step("Removing tcp-mss 500 between R2 and R3 of VRF Default ") TCP_MSS = 500 raw_config = { |