Commit e1eba4db61 for frr
commit e1eba4db619b0f9c63e1f1ffd3e5fe05db11e0d6
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Fri Dec 4 17:35:30 2026 +0100
Revert "tests: add zebra_srte_lsp_free topotest"
This reverts commit 3ce7c0f318fa61fa21dee7edb0078f8937901997.
diff --git a/tests/topotests/zebra_srte_lsp_free/r1/frr.conf b/tests/topotests/zebra_srte_lsp_free/r1/frr.conf
deleted file mode 100644
index d4e08186a0..0000000000
--- a/tests/topotests/zebra_srte_lsp_free/r1/frr.conf
+++ /dev/null
@@ -1,57 +0,0 @@
-hostname r1
-!
-interface lo
- ip address 1.1.1.1/32
- ip ospf area 0.0.0.0
- ip ospf passive
-!
-interface eth-r2-1
- ip address 10.0.1.1/24
- ip ospf network point-to-point
- ip ospf hello-interval 1
- ip ospf dead-interval 4
- ip ospf cost 10
- ip ospf area 0.0.0.0
- mpls enable
-!
-interface eth-r2-2
- ip address 10.0.2.1/24
- ip ospf network point-to-point
- ip ospf hello-interval 1
- ip ospf dead-interval 4
- ip ospf cost 100
- ip ospf area 0.0.0.0
- mpls enable
-!
-router ospf
- ospf router-id 1.1.1.1
- router-info area
- segment-routing on
- segment-routing global-block 16000 23999
- segment-routing node-msd 8
- segment-routing prefix 1.1.1.1/32 index 10
-!
-router bgp 65000
- bgp router-id 1.1.1.1
- no bgp ebgp-requires-policy
- neighbor 2.2.2.2 remote-as 65000
- neighbor 2.2.2.2 update-source lo
- neighbor 2.2.2.2 timers 3 10
- !
- address-family ipv4 unicast
- neighbor 2.2.2.2 route-map SET_SR_POLICY in
- exit-address-family
-!
-route-map SET_SR_POLICY permit 10
- set sr-te color 100
-!
-segment-routing
- traffic-eng
- segment-list TO_R2
- index 10 mpls label 16020
- !
- policy color 100 endpoint 2.2.2.2
- candidate-path preference 100 name CP explicit segment-list TO_R2
- !
- !
-!
diff --git a/tests/topotests/zebra_srte_lsp_free/r2/frr.conf b/tests/topotests/zebra_srte_lsp_free/r2/frr.conf
deleted file mode 100644
index 288bef007d..0000000000
--- a/tests/topotests/zebra_srte_lsp_free/r2/frr.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-hostname r2
-!
-interface lo
- ip address 2.2.2.2/32
- ip ospf area 0.0.0.0
- ip ospf passive
-!
-interface eth-r1-1
- ip address 10.0.1.2/24
- ip ospf network point-to-point
- ip ospf hello-interval 1
- ip ospf dead-interval 4
- ip ospf cost 10
- ip ospf area 0.0.0.0
- mpls enable
-!
-interface eth-r1-2
- ip address 10.0.2.2/24
- ip ospf network point-to-point
- ip ospf hello-interval 1
- ip ospf dead-interval 4
- ip ospf cost 100
- ip ospf area 0.0.0.0
- mpls enable
-!
-ip route 9.9.9.0/24 blackhole
-!
-router ospf
- ospf router-id 2.2.2.2
- router-info area
- segment-routing on
- segment-routing global-block 16000 23999
- segment-routing node-msd 8
- segment-routing prefix 2.2.2.2/32 index 20
-!
-router bgp 65000
- bgp router-id 2.2.2.2
- neighbor 1.1.1.1 remote-as 65000
- neighbor 1.1.1.1 update-source lo
- neighbor 1.1.1.1 timers 3 10
- !
- address-family ipv4 unicast
- redistribute static
- neighbor 1.1.1.1 next-hop-self
- exit-address-family
-!
diff --git a/tests/topotests/zebra_srte_lsp_free/test_zebra_srte_lsp_free.py b/tests/topotests/zebra_srte_lsp_free/test_zebra_srte_lsp_free.py
deleted file mode 100644
index 1994bdfbf2..0000000000
--- a/tests/topotests/zebra_srte_lsp_free/test_zebra_srte_lsp_free.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env python
-# SPDX-License-Identifier: ISC
-
-#
-# test_zebra_srte_lsp_free.py
-#
-# Copyright (c) 2026 by Eduardo Terto
-#
-
-"""
-test_zebra_srte_lsp_free.py:
-
-An SR policy in zebra keeps a pointer to the LSP of the first label of its
-segment list. That LSP is freed as soon as its NHLFEs are removed, while the
-policy was only revalidated when the dataplane result of the LSP deletion was
-processed. The policy then stayed up with a pointer to the freed LSP.
-
-The dataplane results are plugged to hold that window open: r2 changes its
-node SID index (label 16020 -> 16030), r1 frees the LSP 16020, and the policy
-must go down without waiting for the dataplane result.
-
- +---------+ eth-r2-1 10.0.1.0/24 eth-r1-1 +---------+
- | r1 +-------------------------------------+ r2 |
- | 1.1.1.1 | | 2.2.2.2 |
- | +-------------------------------------+ |
- +---------+ eth-r2-2 10.0.2.0/24 eth-r1-2 +---------+
-
-r2 advertises 9.9.9.0/24 over iBGP (next-hop 2.2.2.2); r1 colors it with
-SR-TE color 100, steered into policy (100, 2.2.2.2) with segment list [16020].
-"""
-
-import os
-import sys
-import pytest
-from functools import partial
-
-CWD = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(os.path.join(CWD, "../"))
-
-# pylint: disable=C0413
-from lib import topotest
-from lib.topogen import Topogen, get_topogen
-from lib.common_config import step
-
-pytestmark = [pytest.mark.bgpd, pytest.mark.ospfd, pytest.mark.pathd]
-
-COLORED_PREFIX = "9.9.9.0/24"
-
-
-def build_topo(tgen):
- "Build function"
-
- for router in ["r1", "r2"]:
- tgen.add_router(router)
-
- switch = tgen.add_switch("s1")
- switch.add_link(tgen.gears["r1"], nodeif="eth-r2-1")
- switch.add_link(tgen.gears["r2"], nodeif="eth-r1-1")
-
- switch = tgen.add_switch("s2")
- switch.add_link(tgen.gears["r1"], nodeif="eth-r2-2")
- switch.add_link(tgen.gears["r2"], nodeif="eth-r1-2")
-
-
-def setup_module(mod):
- "Sets up the pytest environment"
-
- tgen = Topogen(build_topo, mod.__name__)
- tgen.start_topology()
-
- tgen.gears["r1"].load_frr_config(
- os.path.join(CWD, "r1/frr.conf"),
- [("zebra", ""), ("ospfd", ""), ("bgpd", ""), ("pathd", "")],
- )
- tgen.gears["r2"].load_frr_config(
- os.path.join(CWD, "r2/frr.conf"),
- [("zebra", ""), ("ospfd", ""), ("bgpd", ""), ("staticd", "")],
- )
-
- tgen.start_router()
-
-
-def teardown_module(mod):
- "Teardown the pytest environment"
- tgen = get_topogen()
- tgen.stop_topology()
-
-
-def _policy_is_active(router):
- # "show sr-te policy" has no JSON output: Endpoint Color Name BSID Status
- output = router.vtysh_cmd("show sr-te policy", isjson=False)
- for line in output.splitlines():
- fields = line.split()
- if len(fields) >= 3 and fields[0] == "2.2.2.2" and fields[1] == "100":
- return fields[-1] == "Active"
- return False
-
-
-def _colored_route_installed(router):
- output = router.vtysh_cmd(
- "show ip route {} json".format(COLORED_PREFIX), isjson=True
- )
- for route in output.get(COLORED_PREFIX, []):
- if route.get("installed"):
- return True
- return False
-
-
-def _lsp_is_present(router, label):
- output = router.vtysh_cmd("show mpls table json", isjson=True)
- return str(label) in output
-
-
-def _wait_lsp(router, label, present):
- test_func = partial(_lsp_is_present, router, label)
- _, result = topotest.run_and_expect(test_func, present, count=60, wait=0.5)
- return result == present
-
-
-def _set_r2_sid_index(router, index):
- router.vtysh_cmd(
- """
-configure terminal
-router ospf
- segment-routing prefix 2.2.2.2/32 index {}
-""".format(
- index
- )
- )
-
-
-def _wait_policy(router, active):
- test_func = partial(_policy_is_active, router)
- _, result = topotest.run_and_expect(test_func, active, count=60, wait=0.5)
- return result == active
-
-
-def test_colored_route_uses_policy():
- "The colored BGP route is installed through the active SR policy."
- tgen = get_topogen()
- if tgen.routers_have_failure():
- pytest.skip(tgen.errors)
-
- r1 = tgen.gears["r1"]
- assert _wait_policy(r1, True), "r1: SR policy (100, 2.2.2.2) is not active"
-
- test_func = partial(_colored_route_installed, r1)
- _, result = topotest.run_and_expect(test_func, True, count=60, wait=0.5)
- assert result, "r1: {} is not installed".format(COLORED_PREFIX)
-
-
-def test_policy_down_when_lsp_freed():
- "The SR policy goes down when its LSP is freed, before the dplane result."
- tgen = get_topogen()
- if tgen.routers_have_failure():
- pytest.skip(tgen.errors)
-
- r1 = tgen.gears["r1"]
- r2 = tgen.gears["r2"]
-
- assert _wait_lsp(r1, 16020, True), "r1: LSP 16020 is not installed"
-
- step("Plug the dplane results on r1")
- r1.vtysh_cmd("zebra test dplane disable results")
-
- step("r2 changes its node SID index: r1 frees the LSP 16020")
- _set_r2_sid_index(r2, 30)
- lsp_freed = _wait_lsp(r1, 16020, False)
-
- step("The SR policy must go down while the dplane results are plugged")
- policy_down = lsp_freed and _wait_policy(r1, False)
-
- step("Unplug the dplane results on r1")
- r1.vtysh_cmd("no zebra test dplane disable results")
-
- assert lsp_freed, "r1: LSP 16020 was not freed"
- assert policy_down, "r1: SR policy (100, 2.2.2.2) is still active"
- assert not tgen.routers_have_failure(), tgen.errors
-
- step("r2 restores its node SID index: the SR policy comes back")
- _set_r2_sid_index(r2, 20)
- assert _wait_policy(r1, True), "r1: SR policy (100, 2.2.2.2) is not active"
-
-
-def test_memory_leak():
- "Run the memory leak test and report results."
- tgen = get_topogen()
- if not tgen.is_memleak_enabled():
- pytest.skip("Memory leak test/report is disabled")
-
- tgen.report_memory_leaks()
-
-
-if __name__ == "__main__":
- args = ["-s"] + sys.argv[1:]
- sys.exit(pytest.main(args))