diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 1bce3c6bb2..cf8efdea16 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -2552,6 +2552,7 @@ def create_route_maps(tgen, input_dict, build=False): nexthop = set_data.setdefault("nexthop", None) origin = set_data.setdefault("origin", None) ext_comm_list = set_data.setdefault("extcommunity", {}) + metrictype = set_data.setdefault("metric-type", {}) # Local Preference if local_preference: @@ -2559,6 +2560,10 @@ def create_route_maps(tgen, input_dict, build=False): "set local-preference {}".format(local_preference) ) + # Metric-Type + if metrictype: + rmap_data.append("set metric-type {}\n".format(metrictype)) + # Metric if metric: rmap_data.append("set metric {} \n".format(metric)) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py index 64dfa0c69d..f9fa55e275 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py @@ -669,89 +669,6 @@ def test_ospf_type5_summary_tc48_p0(request): result is True ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) - step("Configure metric type as 1 in route map.") - - routemaps = { - "r0": { - "route_maps": { - "rmap_ipv4": [{"action": "permit", "set": {"metric-type": "type-1"}}] - } - } - } - result = create_route_maps(tgen, routemaps) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step( - "Verify that external routes(static / connected) are summarised" - " to configured summary address with metric type 2." - ) - input_dict = { - SUMMARY["ipv4"][0]: { - "Summary address": SUMMARY["ipv4"][0], - "Metric-type": "E2", - "Metric": 20, - "Tag": 0, - "External route count": 5, - } - } - dut = "r0" - result = verify_ospf_summary(tgen, topo, dut, input_dict) - assert ( - result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) - - step("Un configure metric type from route map.") - - routemaps = { - "r0": { - "route_maps": { - "rmap_ipv4": [ - { - "action": "permit", - "set": {"metric-type": "type-1"}, - "delete": True, - } - ] - } - } - } - result = create_route_maps(tgen, routemaps) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step( - "Verify that external routes(static / connected) are summarised" - " to configured summary address with metric type 2." - ) - input_dict = { - SUMMARY["ipv4"][0]: { - "Summary address": SUMMARY["ipv4"][0], - "Metric-type": "E2", - "Metric": 20, - "Tag": 0, - "External route count": 5, - } - } - dut = "r0" - result = verify_ospf_summary(tgen, topo, dut, input_dict) - assert ( - result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) - - step("Change rule from permit to deny in prefix list.") - pfx_list = { - "r0": { - "prefix_lists": { - "ipv4": { - "pf_list_1_ipv4": [ - {"seqid": 10, "network": "any", "action": "deny"} - ] - } - } - } - } - result = create_prefix_lists(tgen, pfx_list) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - write_test_footer(tc_name)