mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 11:18:59 +00:00
isis-topo1: test ISIS route installation
Check the 'show ip route json' output for installed ISIS routes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
67f1e9ed09
commit
e4d08d5be7
86
tests/topotests/isis-topo1/r1/r1_route.json
Normal file
86
tests/topotests/isis-topo1/r1/r1_route.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"10.0.10.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r1-eth0",
|
||||
"ip": "10.0.20.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.10.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.20.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r1-eth0",
|
||||
"ip": "10.0.20.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.20.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r1-eth0"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.20.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.1/32": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 1,
|
||||
"interfaceName": "lo"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.1/32",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.3/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r1-eth0",
|
||||
"ip": "10.0.20.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.3/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
]
|
||||
}
|
86
tests/topotests/isis-topo1/r2/r2_route.json
Normal file
86
tests/topotests/isis-topo1/r2/r2_route.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"10.0.11.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r2-eth0",
|
||||
"ip": "10.0.21.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.11.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.21.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r2-eth0",
|
||||
"ip": "10.0.21.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r2-eth0"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.2/32": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 1,
|
||||
"interfaceName": "lo"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.2/32",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.4/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r2-eth0",
|
||||
"ip": "10.0.21.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.4/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
]
|
||||
}
|
173
tests/topotests/isis-topo1/r3/r3_route.json
Normal file
173
tests/topotests/isis-topo1/r3/r3_route.json
Normal file
@ -0,0 +1,173 @@
|
||||
{
|
||||
"10.0.10.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1",
|
||||
"ip": "10.0.10.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.10.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.10.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.11.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1",
|
||||
"ip": "10.0.10.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.11.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.20.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r3-eth0",
|
||||
"ip": "10.0.20.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.20.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r3-eth0"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.20.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.21.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 20,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1",
|
||||
"ip": "10.0.10.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.1/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r3-eth0",
|
||||
"ip": "10.0.20.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.1/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.3/32": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 1,
|
||||
"interfaceName": "lo"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.3/32",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.4/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 20,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1",
|
||||
"ip": "10.0.10.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.4/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.5/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r3-eth1",
|
||||
"ip": "10.0.10.1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.5/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
]
|
||||
}
|
83
tests/topotests/isis-topo1/r4/r4_route.json
Normal file
83
tests/topotests/isis-topo1/r4/r4_route.json
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"10.0.11.0/24": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r4-eth1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.11.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.21.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r4-eth0",
|
||||
"ip": "10.0.21.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r4-eth0"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.2/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r4-eth0",
|
||||
"ip": "10.0.21.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.2/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.4/32": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 1,
|
||||
"interfaceName": "lo"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.4/32",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
]
|
||||
}
|
154
tests/topotests/isis-topo1/r5/r5_route.json
Normal file
154
tests/topotests/isis-topo1/r5/r5_route.json
Normal file
@ -0,0 +1,154 @@
|
||||
{
|
||||
"10.0.10.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r5-eth0",
|
||||
"ip": "10.0.10.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.10.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r5-eth0"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.10.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.11.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"afi": "ipv4",
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r5-eth1",
|
||||
"ip": "10.0.11.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.11.0/24",
|
||||
"protocol": "isis"
|
||||
},
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r5-eth1"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.11.0/24",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.20.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r5-eth0",
|
||||
"ip": "10.0.10.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.20.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.0.21.0/24": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r5-eth1",
|
||||
"ip": "10.0.11.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.0.21.0/24",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.3/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 2,
|
||||
"interfaceName": "r5-eth0",
|
||||
"ip": "10.0.10.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.3/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.4/32": [
|
||||
{
|
||||
"distance": 115,
|
||||
"metric": 10,
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"afi": "ipv4",
|
||||
"fib": true,
|
||||
"interfaceIndex": 3,
|
||||
"interfaceName": "r5-eth1",
|
||||
"ip": "10.0.11.2"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.4/32",
|
||||
"protocol": "isis",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"10.254.0.5/32": [
|
||||
{
|
||||
"nexthops": [
|
||||
{
|
||||
"active": true,
|
||||
"directlyConnected": true,
|
||||
"fib": true,
|
||||
"interfaceIndex": 1,
|
||||
"interfaceName": "lo"
|
||||
}
|
||||
],
|
||||
"prefix": "10.254.0.5/32",
|
||||
"protocol": "connected",
|
||||
"selected": true
|
||||
}
|
||||
]
|
||||
}
|
@ -133,6 +133,24 @@ def test_isis_convergence():
|
||||
assert topotest.json_cmp(actual, expected) is None, assertmsg
|
||||
|
||||
|
||||
def test_isis_route_installation():
|
||||
"Check whether all expected routes are present"
|
||||
tgen = get_topogen()
|
||||
# Don't run this test if we have any failure.
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
|
||||
logger.info('Checking routers for installed ISIS routes')
|
||||
|
||||
# Check for routes in 'show ip route json'
|
||||
for rname, router in tgen.routers().iteritems():
|
||||
filename = '{0}/{1}/{1}_route.json'.format(CWD, rname)
|
||||
expected = json.loads(open(filename, 'r').read())
|
||||
actual = router.vtysh_cmd('show ip route json', isjson=True)
|
||||
assertmsg = "Router '{}' routes mismatch".format(rname)
|
||||
assert topotest.json_cmp(actual, expected) is None, assertmsg
|
||||
|
||||
|
||||
def test_memory_leak():
|
||||
"Run the memory leak test and report results."
|
||||
tgen = get_topogen()
|
||||
|
Loading…
Reference in New Issue
Block a user