Commit dbbcfc8f79 for frr
commit dbbcfc8f79157af5a6084efe08d3197bbb897d7c
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Fri Nov 6 10:46:32 2026 +0100
topotests: test the color extended community in isis_sr_te_topo1
isis_sr_te_topo1 only colors the BGP routes locally on rt1, with the
"set sr-te color" route-map command. The color received in a color
extended community is never tested: a route carrying it was not
steered in the SR policy of this color.
Add a step where rt1 does not color the routes anymore, and rt6
advertises 9.9.9.2/32 with the color extended community 00:1. The
test checks that the route installed on rt1 has no color before rt6
sends it, has the color 1 once received, and is steered in the SR
policy of color 1 when this policy has a candidate path.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/tests/topotests/isis_sr_te_topo1/test_isis_sr_te_topo1.py b/tests/topotests/isis_sr_te_topo1/test_isis_sr_te_topo1.py
index 31d1b1218d..bd77c58154 100755
--- a/tests/topotests/isis_sr_te_topo1/test_isis_sr_te_topo1.py
+++ b/tests/topotests/isis_sr_te_topo1/test_isis_sr_te_topo1.py
@@ -948,6 +948,69 @@ def test_srte_route_map_with_sr_policy_reinstall_prefix_sid_check_nextop_step5()
)
+#
+# Step 6
+#
+# Checking the color received in a color extended community
+#
+def test_srte_color_extended_community_step6():
+ setup_testcase(
+ "Test (step 6): color received in a color extended community steers the route"
+ )
+
+ tgen = get_topogen()
+ delete_candidate_path("rt1", "6.6.6.6", 100)
+
+ tgen.gears["rt1"].vtysh_cmd(
+ """
+ configure terminal
+ route-map SET_SR_POLICY permit 10
+ no set sr-te color
+ """
+ )
+ logger.info("Without any color, the route should have no color")
+ cmp_json_output_doesnt(
+ "rt1", "show ip route bgp json", "step5/show_ip_route_bgp_inactive_srte.ref"
+ )
+
+ tgen.gears["rt6"].vtysh_cmd(
+ """
+ configure terminal
+ route-map COLOR permit 10
+ set extcommunity color 00:1
+ exit
+ router bgp 1
+ address-family ipv4 unicast
+ neighbor 1.1.1.1 route-map COLOR out
+ """
+ )
+
+ logger.info("Without SR policy, the route should have the received color")
+ cmp_json_output(
+ "rt1", "show ip route bgp json", "step5/show_ip_route_bgp_inactive_srte.ref"
+ )
+
+ add_candidate_path("rt1", "6.6.6.6", 100, "default")
+ logger.info("With an SR policy of this color, the route should be steered")
+ cmp_json_output(
+ "rt1", "show ip route bgp json", "step5/show_ip_route_bgp_active_srte.ref"
+ )
+
+ delete_candidate_path("rt1", "6.6.6.6", 100)
+ tgen.gears["rt6"].vtysh_cmd(
+ """
+ configure terminal
+ router bgp 1
+ address-family ipv4 unicast
+ no neighbor 1.1.1.1 route-map COLOR out
+ exit-address-family
+ exit
+ no route-map COLOR
+ """
+ )
+ set_route_map_color("rt1", 1)
+
+
# Memory leak test template
def test_memory_leak():
"Run the memory leak test and report results."