]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Add `metric-type` to possible set operations
authorDonald Sharp <sharpd@nvidia.com>
Fri, 15 Oct 2021 15:42:06 +0000 (11:42 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 15 Oct 2021 15:42:06 +0000 (11:42 -0400)
Several tests used the route_map_create functionality
with `metric-type` but never bothered to add the
backend code to ensure it works correctly.
Add it in so it can be used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/lib/common_config.py

index 1bce3c6bb2bb44c191ae6a0d2a9d0d9fc6668a17..cf8efdea169e1aec57c6cf2d385a0f000eb2b814 100644 (file)
@@ -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))