]> git.proxmox.com Git - mirror_frr.git/commitdiff
isis-topo1: check IPv6 linux route install
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 20 Dec 2017 12:16:39 +0000 (10:16 -0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/isis-topo1/r1/r1_route6_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r2/r2_route6_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r3/r3_route6_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r4/r4_route6_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/r5/r5_route6_linux.json [new file with mode: 0644]
tests/topotests/isis-topo1/test_isis_topo1.py

diff --git a/tests/topotests/isis-topo1/r1/r1_route6_linux.json b/tests/topotests/isis-topo1/r1/r1_route6_linux.json
new file mode 100644 (file)
index 0000000..139747c
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "2001:db8:2:1::/64": {
+    "dev": "r1-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::3": {
+    "dev": "r1-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r2/r2_route6_linux.json b/tests/topotests/isis-topo1/r2/r2_route6_linux.json
new file mode 100644 (file)
index 0000000..5068861
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "2001:db8:2:2::/64": {
+    "dev": "r2-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::4": {
+    "dev": "r2-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r3/r3_route6_linux.json b/tests/topotests/isis-topo1/r3/r3_route6_linux.json
new file mode 100644 (file)
index 0000000..78993ff
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "2001:db8:1:2::/64": {
+    "dev": "r3-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:2:2::/64": {
+    "dev": "r3-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::1": {
+    "dev": "r3-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::4": {
+    "dev": "r3-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::5": {
+    "dev": "r3-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r4/r4_route6_linux.json b/tests/topotests/isis-topo1/r4/r4_route6_linux.json
new file mode 100644 (file)
index 0000000..32ea366
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "2001:db8:1:1::/64": {
+    "dev": "r4-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:2:1::/64": {
+    "dev": "r4-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::2": {
+    "dev": "r4-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::3": {
+    "dev": "r4-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::5": {
+    "dev": "r4-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  }
+}
diff --git a/tests/topotests/isis-topo1/r5/r5_route6_linux.json b/tests/topotests/isis-topo1/r5/r5_route6_linux.json
new file mode 100644 (file)
index 0000000..ad8632e
--- /dev/null
@@ -0,0 +1,26 @@
+{
+  "2001:db8:2:1::/64": {
+    "dev": "r5-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:2:2::/64": {
+    "dev": "r5-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::3": {
+    "dev": "r5-eth0",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  },
+  "2001:db8:f::4": {
+    "dev": "r5-eth1",
+    "metric": "20",
+    "pref": "medium",
+    "proto": "187"
+  }
+}
index 544671da57587de35c4b870f30e690c9d733db6e..d24d0d768c1dcafc0795bf40dd410a874738f7da 100644 (file)
@@ -230,6 +230,31 @@ def test_isis_route6_installation():
         assert topotest.json_cmp(actual, expected) is None, assertmsg
 
 
+def test_isis_linux_route6_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 IPv6 routes in OS')
+
+    # Check for routes in `ip route`
+    for rname, router in tgen.routers().iteritems():
+        filename = '{0}/{1}/{1}_route6_linux.json'.format(CWD, rname)
+        expected = json.loads(open(filename, 'r').read())
+        actual = topotest.ip6_route(router)
+
+        # Older FRR versions install routes using different proto
+        if router.has_version('<', '3.1'):
+            for network, netoptions in expected.iteritems():
+                if 'proto' in netoptions and netoptions['proto'] == '187':
+                    netoptions['proto'] = 'zebra'
+
+        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()