]> git.puffer.fish Git - mirror/frr.git/commitdiff
isis-topo1: check ipv6 zebra route installation
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 20 Dec 2017 12:05:04 +0000 (10:05 -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.json [new file with mode: 0644]
tests/topotests/isis-topo1/r2/r2_route6.json [new file with mode: 0644]
tests/topotests/isis-topo1/r3/r3_route6.json [new file with mode: 0644]
tests/topotests/isis-topo1/r4/r4_route6.json [new file with mode: 0644]
tests/topotests/isis-topo1/r5/r5_route6.json [new file with mode: 0644]
tests/topotests/isis-topo1/test_isis_topo1.py

diff --git a/tests/topotests/isis-topo1/r1/r1_route6.json b/tests/topotests/isis-topo1/r1/r1_route6.json
new file mode 100644 (file)
index 0000000..1060150
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "2001:db8:1:1::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r1-eth0"
+        }
+      ],
+      "prefix": "2001:db8:1:1::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:1::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r1-eth0"
+        }
+      ],
+      "prefix": "2001:db8:2:1::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::1/128": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 1,
+          "interfaceName": "lo"
+        }
+      ],
+      "prefix": "2001:db8:f::1/128",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::3/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r1-eth0"
+        }
+      ],
+      "prefix": "2001:db8:f::3/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ]
+}
diff --git a/tests/topotests/isis-topo1/r2/r2_route6.json b/tests/topotests/isis-topo1/r2/r2_route6.json
new file mode 100644 (file)
index 0000000..49477a7
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "2001:db8:1:2::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r2-eth0"
+        }
+      ],
+      "prefix": "2001:db8:1:2::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:2::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r2-eth0"
+        }
+      ],
+      "prefix": "2001:db8:2:2::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::2/128": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 1,
+          "interfaceName": "lo"
+        }
+      ],
+      "prefix": "2001:db8:f::2/128",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::4/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r2-eth0"
+        }
+      ],
+      "prefix": "2001:db8:f::4/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ]
+}
diff --git a/tests/topotests/isis-topo1/r3/r3_route6.json b/tests/topotests/isis-topo1/r3/r3_route6.json
new file mode 100644 (file)
index 0000000..3b9605b
--- /dev/null
@@ -0,0 +1,154 @@
+{
+  "2001:db8:1:1::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "interfaceIndex": 2,
+          "interfaceName": "r3-eth0"
+        }
+      ],
+      "prefix": "2001:db8:1:1::/64",
+      "protocol": "isis"
+    },
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r3-eth1"
+        }
+      ],
+      "prefix": "2001:db8:1:1::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:1:2::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r3-eth1"
+        }
+      ],
+      "prefix": "2001:db8:1:2::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:1::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r3-eth0"
+        }
+      ],
+      "prefix": "2001:db8:2:1::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:2::/64": [
+    {
+      "distance": 115,
+      "metric": 20,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r3-eth1"
+        }
+      ],
+      "prefix": "2001:db8:2:2::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::1/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r3-eth0"
+        }
+      ],
+      "prefix": "2001:db8:f::1/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::3/128": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 1,
+          "interfaceName": "lo"
+        }
+      ],
+      "prefix": "2001:db8:f::3/128",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::4/128": [
+    {
+      "distance": 115,
+      "metric": 20,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r3-eth1"
+        }
+      ],
+      "prefix": "2001:db8:f::4/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::5/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r3-eth1"
+        }
+      ],
+      "prefix": "2001:db8:f::5/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ]
+}
diff --git a/tests/topotests/isis-topo1/r4/r4_route6.json b/tests/topotests/isis-topo1/r4/r4_route6.json
new file mode 100644 (file)
index 0000000..8107b50
--- /dev/null
@@ -0,0 +1,153 @@
+{
+  "2001:db8:1:1::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:1:1::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:1:2::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:1:2::/64",
+      "protocol": "isis"
+    },
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r4-eth0"
+        }
+      ],
+      "prefix": "2001:db8:1:2::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:1::/64": [
+    {
+      "distance": 115,
+      "metric": 20,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:2:1::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:2::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:2:2::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::2/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r4-eth0"
+        }
+      ],
+      "prefix": "2001:db8:f::2/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::3/128": [
+    {
+      "distance": 115,
+      "metric": 20,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:f::3/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::4/128": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 1,
+          "interfaceName": "lo"
+        }
+      ],
+      "prefix": "2001:db8:f::4/128",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::5/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r4-eth1"
+        }
+      ],
+      "prefix": "2001:db8:f::5/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ]}
diff --git a/tests/topotests/isis-topo1/r5/r5_route6.json b/tests/topotests/isis-topo1/r5/r5_route6.json
new file mode 100644 (file)
index 0000000..860104f
--- /dev/null
@@ -0,0 +1,122 @@
+{
+  "2001:db8:1:1::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r5-eth0"
+        }
+      ],
+      "prefix": "2001:db8:1:1::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:1:2::/64": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r5-eth1"
+        }
+      ],
+      "prefix": "2001:db8:1:2::/64",
+      "protocol": "connected",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:1::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r5-eth0"
+        }
+      ],
+      "prefix": "2001:db8:2:1::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:2:2::/64": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r5-eth1"
+        }
+      ],
+      "prefix": "2001:db8:2:2::/64",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::3/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 2,
+          "interfaceName": "r5-eth0"
+        }
+      ],
+      "prefix": "2001:db8:f::3/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::4/128": [
+    {
+      "distance": 115,
+      "metric": 10,
+      "nexthops": [
+        {
+          "active": true,
+          "afi": "ipv6",
+          "fib": true,
+          "interfaceIndex": 3,
+          "interfaceName": "r5-eth1"
+        }
+      ],
+      "prefix": "2001:db8:f::4/128",
+      "protocol": "isis",
+      "selected": true
+    }
+  ],
+  "2001:db8:f::5/128": [
+    {
+      "nexthops": [
+        {
+          "active": true,
+          "directlyConnected": true,
+          "fib": true,
+          "interfaceIndex": 1,
+          "interfaceName": "lo"
+        }
+      ],
+      "prefix": "2001:db8:f::5/128",
+      "protocol": "connected",
+      "selected": true
+    }
+  ]
+}
index f3685ab2a67ce00c47d3205e885b07d0f58bbd6e..c855644e3998b62d5ec2554d3131dabaedb8e176 100644 (file)
@@ -204,6 +204,39 @@ def test_isis_linux_route_installation():
         assert topotest.json_cmp(actual, expected) is None, assertmsg
 
 
+def test_isis_route6_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 IPv6 routes')
+
+    # Check for routes in 'show ip route json'
+    for rname, router in tgen.routers().iteritems():
+        filename = '{0}/{1}/{1}_route6.json'.format(CWD, rname)
+        expected = json.loads(open(filename, 'r').read())
+        actual = router.vtysh_cmd('show ipv6 route json', isjson=True)
+
+        # Older FRR versions don't list interfaces in some ISIS routes
+        if router.has_version('<', '3.1'):
+            for network, routes in expected.iteritems():
+                for route in routes:
+                    # Older versions display different metrics for IPv6 routes
+                    route.pop('metric', None)
+
+                    if route['protocol'] != 'isis':
+                        continue
+
+                    for nexthop in route['nexthops']:
+                        nexthop.pop('interfaceIndex', None)
+                        nexthop.pop('interfaceName', None)
+
+        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()