mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:37:29 +00:00
isis-topo1: check ISIS kernel route installation
Check if the ISIS learned routes are being installed in the underlying OS. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
e4d08d5be7
commit
2d013cdabc
14
tests/topotests/isis-topo1/r1/r1_route_linux.json
Normal file
14
tests/topotests/isis-topo1/r1/r1_route_linux.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"10.0.10.0/24": {
|
||||||
|
"dev": "r1-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.20.1"
|
||||||
|
},
|
||||||
|
"10.254.0.3": {
|
||||||
|
"dev": "r1-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.20.1"
|
||||||
|
}
|
||||||
|
}
|
14
tests/topotests/isis-topo1/r2/r2_route_linux.json
Normal file
14
tests/topotests/isis-topo1/r2/r2_route_linux.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"10.0.11.0/24": {
|
||||||
|
"dev": "r2-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.21.1"
|
||||||
|
},
|
||||||
|
"10.254.0.4": {
|
||||||
|
"dev": "r2-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.21.1"
|
||||||
|
}
|
||||||
|
}
|
32
tests/topotests/isis-topo1/r3/r3_route_linux.json
Normal file
32
tests/topotests/isis-topo1/r3/r3_route_linux.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"10.0.11.0/24": {
|
||||||
|
"dev": "r3-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.1"
|
||||||
|
},
|
||||||
|
"10.0.21.0/24": {
|
||||||
|
"dev": "r3-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.1"
|
||||||
|
},
|
||||||
|
"10.254.0.1": {
|
||||||
|
"dev": "r3-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.20.2"
|
||||||
|
},
|
||||||
|
"10.254.0.4": {
|
||||||
|
"dev": "r3-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.1"
|
||||||
|
},
|
||||||
|
"10.254.0.5": {
|
||||||
|
"dev": "r3-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.1"
|
||||||
|
}
|
||||||
|
}
|
32
tests/topotests/isis-topo1/r4/r4_route_linux.json
Normal file
32
tests/topotests/isis-topo1/r4/r4_route_linux.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"10.0.10.0/24": {
|
||||||
|
"dev": "r4-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.1"
|
||||||
|
},
|
||||||
|
"10.0.20.0/24": {
|
||||||
|
"dev": "r4-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.1"
|
||||||
|
},
|
||||||
|
"10.254.0.2": {
|
||||||
|
"dev": "r4-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.21.2"
|
||||||
|
},
|
||||||
|
"10.254.0.3": {
|
||||||
|
"dev": "r4-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.1"
|
||||||
|
},
|
||||||
|
"10.254.0.5": {
|
||||||
|
"dev": "r4-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.1"
|
||||||
|
}
|
||||||
|
}
|
26
tests/topotests/isis-topo1/r5/r5_route_linux.json
Normal file
26
tests/topotests/isis-topo1/r5/r5_route_linux.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"10.0.20.0/24": {
|
||||||
|
"dev": "r5-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.2"
|
||||||
|
},
|
||||||
|
"10.0.21.0/24": {
|
||||||
|
"dev": "r5-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.2"
|
||||||
|
},
|
||||||
|
"10.254.0.3": {
|
||||||
|
"dev": "r5-eth0",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.10.2"
|
||||||
|
},
|
||||||
|
"10.254.0.4": {
|
||||||
|
"dev": "r5-eth1",
|
||||||
|
"metric": "20",
|
||||||
|
"proto": "187",
|
||||||
|
"via": "10.0.11.2"
|
||||||
|
}
|
||||||
|
}
|
@ -151,6 +151,24 @@ def test_isis_route_installation():
|
|||||||
assert topotest.json_cmp(actual, expected) is None, assertmsg
|
assert topotest.json_cmp(actual, expected) is None, assertmsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_isis_linux_route_installation():
|
||||||
|
"Check whether all expected routes are present and installed in the OS"
|
||||||
|
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 in OS')
|
||||||
|
|
||||||
|
# Check for routes in `ip route`
|
||||||
|
for rname, router in tgen.routers().iteritems():
|
||||||
|
filename = '{0}/{1}/{1}_route_linux.json'.format(CWD, rname)
|
||||||
|
expected = json.loads(open(filename, 'r').read())
|
||||||
|
actual = topotest.ip4_route(router)
|
||||||
|
assertmsg = "Router '{}' OS routes mismatch".format(rname)
|
||||||
|
assert topotest.json_cmp(actual, expected) is None, assertmsg
|
||||||
|
|
||||||
|
|
||||||
def test_memory_leak():
|
def test_memory_leak():
|
||||||
"Run the memory leak test and report results."
|
"Run the memory leak test and report results."
|
||||||
tgen = get_topogen()
|
tgen = get_topogen()
|
||||||
|
Loading…
Reference in New Issue
Block a user