From 915bed88d83fa960c85e8f9ff8468438bc7c00d5 Mon Sep 17 00:00:00 2001 From: Ashish Pant Date: Thu, 12 Sep 2019 10:00:00 +0530 Subject: [PATCH] tests: Add topojson route-map for nexthop Signed-off-by: Ashish Pant Add route-map option for ipv6 nexthop Fix typo in bgp configuration --- tests/topotests/lib/bgp.py | 4 ++-- tests/topotests/lib/common_config.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py index bfc34c25e4..41d6a326cf 100644 --- a/tests/topotests/lib/bgp.py +++ b/tests/topotests/lib/bgp.py @@ -445,10 +445,10 @@ def __create_bgp_unicast_address_family(topo, input_dict, router, addr_type, bgp_data = input_dict[router]["bgp"]["address_family"] neigh_data = bgp_data[addr_type]["unicast"]["neighbor"] - for name, peer_dict in deepcopy(neigh_data).iteritems(): + for peer_name, peer_dict in deepcopy(neigh_data).iteritems(): for dest_link, peer in peer_dict["dest_link"].iteritems(): deactivate = None - nh_details = topo[name] + nh_details = topo[peer_name] # Loopback interface if "source_link" in peer and peer["source_link"] == "lo": for destRouterLink, data in sorted(nh_details["links"]. diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index e2f9ebda18..c413bf45c7 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -1240,13 +1240,15 @@ def create_route_maps(tgen, input_dict, build=False): # Weight if weight: - rmap_data.append("set weight {} \n".format( + rmap_data.append("set weight {}".format( weight)) if ipv6_data: - nexthop = ipv6_data.setdefault("nexthop",None) + nexthop = ipv6_data.setdefault("nexthop", None) if nexthop: - rmap_data.append("set ipv6 next-hop \ - {}".format(nexthop)) + rmap_data.append("set ipv6 next-hop {}".format( + nexthop + )) + # Adding MATCH and SET sequence to RMAP if defined if "match" in rmap_dict: match_data = rmap_dict["match"] -- 2.39.5