assert result, "BGP VRF EVA check failed:\n{}".format(diff)
-def test_vrf_route_leak_donna():
- logger.info("Ensure that routes are leaked back and forth")
- 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"]
-
- # Test DONNA VRF.
- expect = {
- "10.0.0.0/24": [
- {
- "protocol": "connected",
- }
- ],
- "10.0.1.0/24": [
- {
- "protocol": "bgp",
- "selected": True,
- "nexthops": [
- {
- "fib": True,
- "interfaceName": "EVA",
- "vrf": "EVA",
- "active": True,
- },
- ],
- },
- ],
- "10.0.2.0/24": [{"protocol": "connected"}],
- "10.0.3.0/24": [
- {
- "protocol": "bgp",
- "selected": True,
- "nexthops": [
- {
- "fib": True,
- "interfaceName": "EVA",
- "vrf": "EVA",
- "active": True,
- },
- ],
- },
- ],
- "10.0.4.0/24": [
- {
- "protocol": "bgp",
- "selected": True,
- "nexthops": [
- {
- "fib": True,
- "interfaceName": "lo",
- "vrf": "default",
- "active": True,
- },
- ],
- },
- ],
- "172.16.101.0/24": [
- {
- "protocol": "bgp",
- "nexthops": [
- {
- "interfaceIndex": 0,
- "interfaceName": "unknown",
- "vrf": "Unknown",
- },
- ],
- },
- ],
- }
-
- 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_eva():
- logger.info("Ensure that routes are leaked back and forth")
- 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"]
-
- # Test EVA VRF.
- expect = {
- "10.0.0.0/24": [
- {
- "protocol": "bgp",
- "selected": True,
- "nexthops": [
- {
- "fib": True,
- "interfaceName": "DONNA",
- "vrf": "DONNA",
- "active": True,
- },
- ],
- },
- ],
- "10.0.1.0/24": [
- {
- "protocol": "connected",
- }
- ],
- "10.0.2.0/24": [
- {
- "protocol": "bgp",
- "selected": True,
- "nexthops": [
- {
- "fib": True,
- "interfaceName": "DONNA",
- "vrf": "DONNA",
- "active": True,
- },
- ],
- },
- ],
- "10.0.3.0/24": [
- {
- "protocol": "connected",
- }
- ],
- "172.16.101.0/24": [
- {
- "protocol": "bgp",
- "nexthops": [
- {
- "interfaceIndex": 0,
- "interfaceName": "unknown",
- "vrf": "Unknown",
- },
- ],
- },
- ],
- }
-
def test_vrf_route_leak_default():
logger.info("Ensure that routes are leaked back and forth")