]> git.proxmox.com Git - mirror_frr.git/commitdiff
isis-topo1: check ISIS kernel route installation
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 14 Dec 2017 16:16:10 +0000 (14:16 -0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Check if the ISIS learned routes are being installed in the underlying
OS.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/isis-topo1/r1/r1_route_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r2/r2_route_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r3/r3_route_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r4/r4_route_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r5/r5_route_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/test_isis_topo1.py

diff --git a/tests/topotests/isis-topo1/r1/r1_route_linux.json b/tests/topotests/isis-topo1/r1/r1_route_linux.json
new file mode 100644 (file)
index 0000000..6420dec
--- /dev/null
@@ -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"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r2/r2_route_linux.json b/tests/topotests/isis-topo1/r2/r2_route_linux.json
new file mode 100644 (file)
index 0000000..dd3035a
--- /dev/null
@@ -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"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r3/r3_route_linux.json b/tests/topotests/isis-topo1/r3/r3_route_linux.json
new file mode 100644 (file)
index 0000000..04a2418
--- /dev/null
@@ -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"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r4/r4_route_linux.json b/tests/topotests/isis-topo1/r4/r4_route_linux.json
new file mode 100644 (file)
index 0000000..5d6553f
--- /dev/null
@@ -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"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r5/r5_route_linux.json b/tests/topotests/isis-topo1/r5/r5_route_linux.json
new file mode 100644 (file)
index 0000000..b809896
--- /dev/null
@@ -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"
+  }
+}
index 1b03a8b26fd2928c0d5de1d5a65517b93215ed00..1faff2c01c769335116ba5dd585d071873f94130 100644 (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()