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:
Rafael Zalamena 2017-12-14 14:16:10 -02:00 committed by Donald Sharp
parent e4d08d5be7
commit 2d013cdabc
6 changed files with 136 additions and 0 deletions

View 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"
}
}

View 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"
}
}

View 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"
}
}

View 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"
}
}

View 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"
}
}

View File

@ -151,6 +151,24 @@ def test_isis_route_installation():
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():
"Run the memory leak test and report results."
tgen = get_topogen()