diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/topotests/bgp_route_map/test_route_map_topo1.py | 103 |
1 files changed, 53 insertions, 50 deletions
diff --git a/tests/topotests/bgp_route_map/test_route_map_topo1.py b/tests/topotests/bgp_route_map/test_route_map_topo1.py index 0158e24d31..74172501db 100644 --- a/tests/topotests/bgp_route_map/test_route_map_topo1.py +++ b/tests/topotests/bgp_route_map/test_route_map_topo1.py @@ -20,47 +20,6 @@ # OF THIS SOFTWARE. # -################################# -# TOPOLOGY -################################# -""" - - +-------+ - +------- | R2 | - | +-------+ - | | - +-------+ | - | R1 | | - +-------+ | - | | - | +-------+ +-------+ - +---------- | R3 |----------| R4 | - +-------+ +-------+ - -""" - -################################# -# TEST SUMMARY -################################# -""" -Following tests are covered to test route-map functionality: -TC_34: - Verify if route-maps is applied in both inbound and - outbound direction to same neighbor/interface. -TC_36: - Test permit/deny statements operation in route-maps with a - permutation and combination of permit/deny in prefix-lists -TC_35: - Test multiple sequence numbers in a single route-map for different - match/set clauses. -TC_37: - Test add/remove route-maps with multiple set - clauses and without any match statement.(Set only) -TC_38: - Test add/remove route-maps with multiple match - clauses and without any set statement.(Match only) -""" - import sys import json import time @@ -91,6 +50,7 @@ from lib.common_config import ( create_bgp_community_lists, interface_status, create_route_maps, + create_static_routes, create_prefix_lists, verify_route_maps, check_address_types, @@ -107,6 +67,46 @@ from lib.bgp import ( ) from lib.topojson import build_topo_from_json, build_config_from_json +################################# +# TOPOLOGY +################################# +""" + + +-------+ + +------- | R2 | + | +-------+ + | | + +-------+ | + | R1 | | + +-------+ | + | | + | +-------+ +-------+ + +---------- | R3 |----------| R4 | + +-------+ +-------+ + +""" + +################################# +# TEST SUMMARY +################################# +""" +Following tests are covered to test route-map functionality: +TC_34: + Verify if route-maps is applied in both inbound and + outbound direction to same neighbor/interface. +TC_36: + Test permit/deny statements operation in route-maps with a + permutation and combination of permit/deny in prefix-lists +TC_35: + Test multiple sequence numbers in a single route-map for different + match/set clauses. +TC_37: + Test add/remove route-maps with multiple set + clauses and without any match statement.(Set only) +TC_38: + Test add/remove route-maps with multiple match + clauses and without any set statement.(Match only) +""" # Global variables bgp_convergence = False @@ -475,8 +475,8 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request): result = verify_rib( tgen, adt, dut, input_dict_2, protocol=protocol, expected=False ) - assert result is not True, "Testcase {} : Failed \n" - "routes are not present in rib \n Error: {}".format(tc_name, result) + assert result is not True, ("Testcase {} : Failed \n" + "routes are not present in rib \n Error: {}".format(tc_name, result)) logger.info("Expected behaviour: {}".format(result)) # Verifying RIB routes @@ -495,8 +495,8 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request): result = verify_rib( tgen, adt, dut, input_dict, protocol=protocol, expected=False ) - assert result is not True, "Testcase {} : Failed \n " - "routes are not present in rib \n Error: {}".format(tc_name, result) + assert result is not True, ("Testcase {} : Failed \n " + "routes are not present in rib \n Error: {}".format(tc_name, result)) logger.info("Expected behaviour: {}".format(result)) write_test_footer(tc_name) @@ -687,14 +687,17 @@ def test_route_map_with_action_values_combination_of_prefix_action_p0( } # tgen.mininet_cli() - result = verify_rib( - tgen, adt, dut, input_dict_2, protocol=protocol, expected=False - ) if "deny" in [prefix_action, rmap_action]: - assert result is not True, "Testcase {} : Failed \n " - "Routes are still present \n Error: {}".format(tc_name, result) + result = verify_rib( + tgen, adt, dut, input_dict_2, protocol=protocol, expected=False + ) + assert result is not True, ("Testcase {} : Failed \n " + "Routes are still present \n Error: {}".format(tc_name, result)) logger.info("Expected behaviour: {}".format(result)) else: + result = verify_rib( + tgen, adt, dut, input_dict_2, protocol=protocol + ) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) |
