mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 17:48:35 +00:00
topotests: isis-lfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface. 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
fcb8ca9a88
commit
f4d0de1072
@ -0,0 +1,50 @@
|
|||||||
|
--- a/rt1/step14/show_ipv6_route.ref
|
||||||
|
+++ b/rt1/step15/show_ipv6_route.ref
|
||||||
|
@@ -6,22 +6,12 @@
|
||||||
|
"selected":true,
|
||||||
|
"destSelected":true,
|
||||||
|
"distance":115,
|
||||||
|
- "metric":20,
|
||||||
|
+ "metric":25,
|
||||||
|
"installed":true,
|
||||||
|
"nexthops":[
|
||||||
|
{
|
||||||
|
"fib":true,
|
||||||
|
"afi":"ipv6",
|
||||||
|
- "interfaceName":"eth-rt2",
|
||||||
|
- "active":true,
|
||||||
|
- "backupIndex":[
|
||||||
|
- 0
|
||||||
|
- ]
|
||||||
|
- }
|
||||||
|
- ],
|
||||||
|
- "backupNexthops":[
|
||||||
|
- {
|
||||||
|
- "afi":"ipv6",
|
||||||
|
"interfaceName":"eth-rt3",
|
||||||
|
"active":true
|
||||||
|
}
|
||||||
|
@@ -151,22 +141,12 @@
|
||||||
|
"selected":true,
|
||||||
|
"destSelected":true,
|
||||||
|
"distance":115,
|
||||||
|
- "metric":25,
|
||||||
|
+ "metric":30,
|
||||||
|
"installed":true,
|
||||||
|
"nexthops":[
|
||||||
|
{
|
||||||
|
"fib":true,
|
||||||
|
"afi":"ipv6",
|
||||||
|
- "interfaceName":"eth-rt2",
|
||||||
|
- "active":true,
|
||||||
|
- "backupIndex":[
|
||||||
|
- 0
|
||||||
|
- ]
|
||||||
|
- }
|
||||||
|
- ],
|
||||||
|
- "backupNexthops":[
|
||||||
|
- {
|
||||||
|
- "afi":"ipv6",
|
||||||
|
"interfaceName":"eth-rt6",
|
||||||
|
"active":true
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
--- a/rt1/step15/show_ipv6_route.ref
|
||||||
|
+++ b/rt1/step16/show_ipv6_route.ref
|
||||||
|
@@ -32,16 +32,6 @@
|
||||||
|
"fib":true,
|
||||||
|
"afi":"ipv6",
|
||||||
|
"interfaceName":"eth-rt3",
|
||||||
|
- "active":true,
|
||||||
|
- "backupIndex":[
|
||||||
|
- 0
|
||||||
|
- ]
|
||||||
|
- }
|
||||||
|
- ],
|
||||||
|
- "backupNexthops":[
|
||||||
|
- {
|
||||||
|
- "afi":"ipv6",
|
||||||
|
- "interfaceName":"eth-rt2",
|
||||||
|
"active":true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
@@ -90,16 +80,6 @@
|
||||||
|
"fib":true,
|
||||||
|
"afi":"ipv6",
|
||||||
|
"interfaceName":"eth-rt5",
|
||||||
|
- "active":true,
|
||||||
|
- "backupIndex":[
|
||||||
|
- 0
|
||||||
|
- ]
|
||||||
|
- }
|
||||||
|
- ],
|
||||||
|
- "backupNexthops":[
|
||||||
|
- {
|
||||||
|
- "afi":"ipv6",
|
||||||
|
- "interfaceName":"eth-rt2",
|
||||||
|
"active":true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
@@ -119,16 +99,6 @@
|
||||||
|
"fib":true,
|
||||||
|
"afi":"ipv6",
|
||||||
|
"interfaceName":"eth-rt6",
|
||||||
|
- "active":true,
|
||||||
|
- "backupIndex":[
|
||||||
|
- 0
|
||||||
|
- ]
|
||||||
|
- }
|
||||||
|
- ],
|
||||||
|
- "backupNexthops":[
|
||||||
|
- {
|
||||||
|
- "afi":"ipv6",
|
||||||
|
- "interfaceName":"eth-rt2",
|
||||||
|
"active":true
|
||||||
|
}
|
||||||
|
]
|
@ -128,7 +128,7 @@ def build_topo(tgen):
|
|||||||
files = ["show_ipv6_route.ref", "show_yang_interface_isis_adjacencies.ref"]
|
files = ["show_ipv6_route.ref", "show_yang_interface_isis_adjacencies.ref"]
|
||||||
for rname in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6", "rt7"]:
|
for rname in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6", "rt7"]:
|
||||||
outputs[rname] = {}
|
outputs[rname] = {}
|
||||||
for step in range(1, 13 + 1):
|
for step in range(1, 16 + 1):
|
||||||
outputs[rname][step] = {}
|
outputs[rname][step] = {}
|
||||||
for file in files:
|
for file in files:
|
||||||
if step == 1:
|
if step == 1:
|
||||||
@ -186,7 +186,7 @@ def teardown_module(mod):
|
|||||||
tgen.stop_topology()
|
tgen.stop_topology()
|
||||||
|
|
||||||
|
|
||||||
def router_compare_json_output(rname, command, reference):
|
def router_compare_json_output(rname, command, reference, wait=0.5, count=120):
|
||||||
"Compare router JSON output"
|
"Compare router JSON output"
|
||||||
|
|
||||||
logger.info('Comparing router "%s" "%s" output', rname, command)
|
logger.info('Comparing router "%s" "%s" output', rname, command)
|
||||||
@ -196,7 +196,7 @@ def router_compare_json_output(rname, command, reference):
|
|||||||
|
|
||||||
# Run test function until we get an result. Wait at most 60 seconds.
|
# Run test function until we get an result. Wait at most 60 seconds.
|
||||||
test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected)
|
test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected)
|
||||||
_, diff = topotest.run_and_expect(test_func, None, count=120, wait=0.5)
|
_, diff = topotest.run_and_expect(test_func, None, count=count, wait=wait)
|
||||||
assertmsg = '"{}" JSON output mismatches the expected result'.format(rname)
|
assertmsg = '"{}" JSON output mismatches the expected result'.format(rname)
|
||||||
assert diff is None, assertmsg
|
assert diff is None, assertmsg
|
||||||
|
|
||||||
@ -616,6 +616,93 @@ def test_rib_ipv6_step13():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 14
|
||||||
|
#
|
||||||
|
# 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_step14():
|
||||||
|
logger.info("Test (step 14): 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("Setting spf-delay-ietf init-delay of 15s")
|
||||||
|
tgen.net["rt1"].cmd(
|
||||||
|
'vtysh -c "conf t" -c "router isis 1" -c "spf-delay-ietf init-delay 15000 short-delay 0 long-delay 0 holddown 0 time-to-learn 0"'
|
||||||
|
)
|
||||||
|
|
||||||
|
for rname in ["rt1"]:
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show ipv6 route isis json",
|
||||||
|
outputs[rname][14]["show_ipv6_route.ref"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 15
|
||||||
|
#
|
||||||
|
# Action(s):
|
||||||
|
# - shut the eth-rt2 interface on rt1
|
||||||
|
#
|
||||||
|
# Expected changes:
|
||||||
|
# - Route switchover of routes via eth-rt2
|
||||||
|
#
|
||||||
|
def test_rib_ipv6_step15():
|
||||||
|
logger.info("Test (step 15): 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])
|
||||||
|
|
||||||
|
for rname in ["rt1"]:
|
||||||
|
router_compare_json_output(
|
||||||
|
rname,
|
||||||
|
"show ipv6 route isis json",
|
||||||
|
outputs[rname][15]["show_ipv6_route.ref"],
|
||||||
|
count=2,
|
||||||
|
wait=0.05,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Step 16
|
||||||
|
#
|
||||||
|
# Action(s): wait for the convergence and SPF computation on rt1
|
||||||
|
#
|
||||||
|
# Expected changes:
|
||||||
|
# - convergence of IPv6 RIB
|
||||||
|
#
|
||||||
|
def test_rib_ipv6_step16():
|
||||||
|
logger.info("Test (step 16): 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