mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 20:15:08 +00:00
topotests: isis-lfa add a switchover test after BFD down
Add a switchover test that consists in: - Setting up ISIS BFD between rt1 and rt2 - The no link-detect setting on rt1 eth-rt2 is still present so that zebra does not take account linkdown events on this interface. - Shutting down rt1 eth-rt2 from the switch side - Wait for BFD to comes down Check that the switchover between primary and backup happens before the SPF re-computation. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
9cdc099bb5
commit
c8d2816ee5
6
tests/topotests/isis_lfa_topo1/rt1/bfdd.conf
Normal file
6
tests/topotests/isis_lfa_topo1/rt1/bfdd.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
hostname rt1
|
||||||
|
!
|
||||||
|
bfd
|
||||||
|
peer 2001:db8:1000::2 multihop local-address 2001:db8:1000::1
|
||||||
|
!
|
||||||
|
!
|
6
tests/topotests/isis_lfa_topo1/rt2/bfdd.conf
Normal file
6
tests/topotests/isis_lfa_topo1/rt2/bfdd.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
hostname rt2
|
||||||
|
!
|
||||||
|
bfd
|
||||||
|
peer 2001:db8:1000::1 multihop local-address 2001:db8:1000::2
|
||||||
|
!
|
||||||
|
!
|
@ -175,6 +175,9 @@ def setup_module(mod):
|
|||||||
router.load_config(
|
router.load_config(
|
||||||
TopoRouter.RD_ISIS, os.path.join(CWD, "{}/isisd.conf".format(rname))
|
TopoRouter.RD_ISIS, os.path.join(CWD, "{}/isisd.conf".format(rname))
|
||||||
)
|
)
|
||||||
|
router.load_config(
|
||||||
|
TopoRouter.RD_BFD, os.path.join(CWD, "/dev/null".format(rname))
|
||||||
|
)
|
||||||
|
|
||||||
tgen.start_router()
|
tgen.start_router()
|
||||||
|
|
||||||
@ -902,6 +905,109 @@ def test_rib_ipv6_step22():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 23
|
||||||
|
#
|
||||||
|
# Action(s):
|
||||||
|
# - Setting spf-delay-ietf init-delay of 15s
|
||||||
|
#
|
||||||
|
# Expected changes:
|
||||||
|
# - No routing table change
|
||||||
|
# - At the end of test, SPF reacts to a failure in 15s
|
||||||
|
#
|
||||||
|
def test_rib_ipv6_step23():
|
||||||
|
logger.info("Test (step 23): verify IPv6 RIB")
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Skip if previous fatal error condition is raised
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
logger.info("Setup BFD on rt1 and rt2")
|
||||||
|
for rname in ["rt1", "rt2"]:
|
||||||
|
conf_file = os.path.join(CWD, "{}/bfdd.conf".format(rname))
|
||||||
|
tgen.net[rname].cmd("vtysh -f {}".format(conf_file))
|
||||||
|
|
||||||
|
rname = "rt1"
|
||||||
|
expect = '[{"multihop":true,"peer":"2001:db8:1000::2","local":"2001:db8:1000::1","status":"up"}]'
|
||||||
|
router_compare_json_output(rname, "show bfd peers json", expect)
|
||||||
|
|
||||||
|
logger.info("Set ISIS BFD")
|
||||||
|
tgen.net["rt1"].cmd('vtysh -c "conf t" -c "int eth-rt2" -c "isis bfd"')
|
||||||
|
tgen.net["rt2"].cmd('vtysh -c "conf t" -c "int eth-rt1" -c "isis bfd"')
|
||||||
|
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show ipv6 route isis json",
|
||||||
|
outputs[rname][14]["show_ipv6_route.ref"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 24
|
||||||
|
#
|
||||||
|
# Action(s):
|
||||||
|
# - shut the eth-rt2 interface on rt1
|
||||||
|
#
|
||||||
|
# Expected changes:
|
||||||
|
# - Route switchover of routes via eth-rt2
|
||||||
|
#
|
||||||
|
def test_rib_ipv6_step24():
|
||||||
|
logger.info("Test (step 24): verify IPv6 RIB")
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Skip if previous fatal error condition is raised
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
logger.info("Shut the interface to rt2 from the switch side and check fast-reroute")
|
||||||
|
tgen.net.cmd_raises("ip link set %s down" % tgen.net["s1"].intfs[0])
|
||||||
|
|
||||||
|
rname = "rt1"
|
||||||
|
expect = '[{"multihop":true,"peer":"2001:db8:1000::2","local":"2001:db8:1000::1","status":"down"}]'
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show bfd peers json",
|
||||||
|
expect,
|
||||||
|
count=20,
|
||||||
|
wait=0.05,
|
||||||
|
)
|
||||||
|
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show ipv6 route isis json",
|
||||||
|
outputs[rname][15]["show_ipv6_route.ref"],
|
||||||
|
count=2,
|
||||||
|
wait=0.05,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 25
|
||||||
|
#
|
||||||
|
# Action(s): wait for the convergence and SPF computation on rt1
|
||||||
|
#
|
||||||
|
# Expected changes:
|
||||||
|
# - convergence of IPv6 RIB
|
||||||
|
#
|
||||||
|
def test_rib_ipv6_step25():
|
||||||
|
logger.info("Test (step 25): verify IPv6 RIB")
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Skip if previous fatal error condition is raised
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
logger.info("Check SPF convergence")
|
||||||
|
|
||||||
|
for rname in ["rt1"]:
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show ipv6 route isis json",
|
||||||
|
outputs[rname][16]["show_ipv6_route.ref"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Memory leak test template
|
# Memory leak test template
|
||||||
def test_memory_leak():
|
def test_memory_leak():
|
||||||
"Run the memory leak test and report results."
|
"Run the memory leak test and report results."
|
||||||
|
Loading…
Reference in New Issue
Block a user