mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-25 06:42:26 +00:00
tests: check route leak after changing vrf state
Check that local route leaks are set to "inactive" when the VRF interface is shutdown and, conversely, that they are set to "active" when the VRF interface is unshut. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
b45c5cd959
commit
5709e89f6c
@ -214,7 +214,6 @@ def test_vrf_route_leak_eva():
|
||||
assert result, "BGP VRF EVA check failed:\n{}".format(diff)
|
||||
|
||||
|
||||
|
||||
def test_vrf_route_leak_default():
|
||||
logger.info("Ensure that routes are leaked back and forth")
|
||||
tgen = get_topogen()
|
||||
@ -281,6 +280,116 @@ def test_ping():
|
||||
check_ping("r1", "10.0.0.1", True, 10, 0.5, source_addr="10.0.4.1")
|
||||
|
||||
|
||||
def test_vrf_route_leak_donna_after_eva_down():
|
||||
logger.info("Ensure that route states change after EVA interface goes down")
|
||||
tgen = get_topogen()
|
||||
# Don't run this test if we have any failure.
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
|
||||
r1 = tgen.gears["r1"]
|
||||
r1.vtysh_cmd(
|
||||
"""
|
||||
configure
|
||||
interface EVA
|
||||
shutdown
|
||||
"""
|
||||
)
|
||||
|
||||
# Test DONNA VRF.
|
||||
expect = {
|
||||
"10.0.1.0/24": [
|
||||
{
|
||||
"protocol": "bgp",
|
||||
"selected": None,
|
||||
"nexthops": [
|
||||
{
|
||||
"fib": None,
|
||||
"interfaceName": "EVA",
|
||||
"vrf": "EVA",
|
||||
"active": None,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"10.0.3.0/24": [
|
||||
{
|
||||
"protocol": "bgp",
|
||||
"selected": None,
|
||||
"nexthops": [
|
||||
{
|
||||
"fib": None,
|
||||
"interfaceName": "EVA",
|
||||
"vrf": "EVA",
|
||||
"active": None,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
test_func = partial(
|
||||
topotest.router_json_cmp, r1, "show ip route vrf DONNA json", expect
|
||||
)
|
||||
result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
||||
assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
|
||||
|
||||
|
||||
def test_vrf_route_leak_donna_after_eva_up():
|
||||
logger.info("Ensure that route states change after EVA interface goes up")
|
||||
tgen = get_topogen()
|
||||
# Don't run this test if we have any failure.
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
|
||||
r1 = tgen.gears["r1"]
|
||||
r1.vtysh_cmd(
|
||||
"""
|
||||
configure
|
||||
interface EVA
|
||||
no shutdown
|
||||
"""
|
||||
)
|
||||
|
||||
# Test DONNA VRF.
|
||||
expect = {
|
||||
"10.0.1.0/24": [
|
||||
{
|
||||
"protocol": "bgp",
|
||||
"selected": True,
|
||||
"nexthops": [
|
||||
{
|
||||
"fib": True,
|
||||
"interfaceName": "EVA",
|
||||
"vrf": "EVA",
|
||||
"active": True,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"10.0.3.0/24": [
|
||||
{
|
||||
"protocol": "bgp",
|
||||
"selected": True,
|
||||
"nexthops": [
|
||||
{
|
||||
"fib": True,
|
||||
"interfaceName": "EVA",
|
||||
"vrf": "EVA",
|
||||
"active": True,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
test_func = partial(
|
||||
topotest.router_json_cmp, r1, "show ip route vrf DONNA json", expect
|
||||
)
|
||||
result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
||||
assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
|
||||
|
||||
|
||||
def test_memory_leak():
|
||||
"Run the memory leak test and report results."
|
||||
tgen = get_topogen()
|
||||
|
Loading…
Reference in New Issue
Block a user