]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Basic EIGRP topo test working
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 18 Aug 2017 19:37:24 +0000 (15:37 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
tests/topotests/eigrp-topo1/r1/show_ip_eigrp.ref
tests/topotests/eigrp-topo1/r1/show_ip_route.ref
tests/topotests/eigrp-topo1/r2/show_ip_route.ref
tests/topotests/eigrp-topo1/r3/show_ip_route.ref
tests/topotests/eigrp-topo1/test_eigrp_topo1.py

index 561560f23067939c9853c7f4d97b5779cb354702..190a570df162c85c4f57c631cc26bf590857ab79 100644 (file)
@@ -1,10 +1,10 @@
-Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
-Sub-codes:
-      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
-      (i) - interface
 
-     Network            Next Hop         Metric From            Tag Time
-R(n) 192.168.2.0/24     193.1.1.2             3 193.1.1.2         0 XX:XX
-R(n) 192.168.3.0/24     193.1.1.2             3 193.1.1.2         0 XX:XX
-C(i) 193.1.1.0/26       0.0.0.0               1 self              0
-R(n) 193.1.2.0/24       193.1.1.2             2 193.1.1.2         0 XX:XX
+EIGRP Topology Table for AS(1)/ID(193.1.1.1)
+
+Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply
+       r - reply Status, s - sia Status
+
+P  193.1.1.0/26, 1 successors, FD is 28160, serno: 0 
+       via Connected, r1-eth1
+P  193.1.2.0/24, 1 successors, FD is 30720, serno: 0 
+       via 193.1.1.2 (30720/28160), r1-eth1
index 62d71f0ab6356ba50fe9e2c73de82605df15bde5..2e81211667b9cc0b543976b6276e100de0973baa 100644 (file)
@@ -1,3 +1,9 @@
-R>* 192.168.2.0/24 [120/3] via 193.1.1.2, r1-eth1
-R>* 192.168.3.0/24 [120/3] via 193.1.1.2, r1-eth1
-R>* 193.1.2.0/24 [120/2] via 193.1.1.2, r1-eth1
+Codes: K - kernel route, C - connected, S - static, R - RIP,
+       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
+       T - Table, v - VNC, V - VNC-Direct, A - Babel,
+       > - selected route, * - FIB route
+
+C>* 192.168.1.0/24 is directly connected, r1-eth0
+E   193.1.1.0/26 [0/0] is directly connected, r1-eth1
+C>* 193.1.1.0/26 is directly connected, r1-eth1
+E>* 193.1.2.0/24 [0/0] via 193.1.1.2, r1-eth1
index 4b34939aa51f01ffaadcfc010bcdac5b81ed775a..c82247fb1e4c9902ef8bd2e6dc2e4ed616923c58 100644 (file)
@@ -1,2 +1,9 @@
-R>* 192.168.2.0/24 [120/2] via 193.1.2.2, r2-eth1
-R>* 192.168.3.0/24 [120/2] via 193.1.2.2, r2-eth1
+Codes: K - kernel route, C - connected, S - static, R - RIP,
+       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
+       T - Table, v - VNC, V - VNC-Direct, A - Babel,
+       > - selected route, * - FIB route
+
+E   193.1.1.0/26 [0/0] is directly connected, r2-eth0
+C>* 193.1.1.0/26 is directly connected, r2-eth0
+E   193.1.2.0/24 [0/0] is directly connected, r2-eth1
+C>* 193.1.2.0/24 is directly connected, r2-eth1
index 835e1229c866822980e055b4f6159f0879dbcdc0..ce1fcf71369c8e4a9e45d04af8deac191ec8060b 100644 (file)
@@ -1 +1,10 @@
-R>* 193.1.1.0/26 [120/2] via 193.1.2.1, r3-eth1
+Codes: K - kernel route, C - connected, S - static, R - RIP,
+       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
+       T - Table, v - VNC, V - VNC-Direct, A - Babel,
+       > - selected route, * - FIB route
+
+S>* 192.168.2.0/24 [1/0] via 192.168.3.10, r3-eth0
+C>* 192.168.3.0/24 is directly connected, r3-eth0
+E>* 193.1.1.0/26 [0/0] via 193.1.2.1, r3-eth1
+E   193.1.2.0/24 [0/0] is directly connected, r3-eth1
+C>* 193.1.2.0/24 is directly connected, r3-eth1
index c73a40156d35735db4d4619726e31cfcd5472ee4..02dcf23ffc84dfd663961a94ad7b4a71cda0c895 100755 (executable)
@@ -122,7 +122,7 @@ def setup_module(module):
         net['r%s' % i].startRouter()
 
     # For debugging after starting Quagga/FRR daemons, uncomment the next line
-    CLI(net)
+    CLI(net)
 
 
 def teardown_module(module):
@@ -170,61 +170,7 @@ def test_converge_protocols():
     print("******************************************\n")
 
     # Not really implemented yet - just sleep 60 secs for now
-    sleep(60)
-
-    # Make sure that all daemons are still running
-    for i in range(1, 4):
-        fatal_error = net['r%s' % i].checkRouterRunning()
-        assert fatal_error == "", fatal_error
-
-    # For debugging after starting FRR/Quagga daemons, uncomment the next line
-    # CLI(net)
-
-
-def test_eigrp_status():
-    global fatal_error
-    global net
-
-    # Skip if previous fatal error condition is raised
-    if (fatal_error != ""):
-        pytest.skip(fatal_error)
-
-    thisDir = os.path.dirname(os.path.realpath(__file__))
-
-    # Verify EIGRP Status
-    print("\n\n** Verifing EIGRP status")
-    print("******************************************\n")
-    failures = 0
-    for i in range(1, 4):
-        refTableFile = '%s/r%s/eigrp_status.ref' % (thisDir, i)
-        if os.path.isfile(refTableFile):
-            # Read expected result from file
-            expected = open(refTableFile).read().rstrip()
-            # Fix newlines (make them all the same)
-            expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
-
-            # Actual output from router
-            actual = net['r%s' % i].cmd('vtysh -c "show ip eigrp topo" 2> /dev/null').rstrip()
-            # Drop time in next due 
-            actual = re.sub(r"in [0-9]+ seconds", "in XX seconds", actual)
-            # Drop time in last update
-            actual = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", actual)
-            # Fix newlines (make them all the same)
-            actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)
-
-            # Generate Diff
-            diff = ''.join(difflib.context_diff(actual, expected, 
-                fromfile="actual IP EIGRP status", 
-                tofile="expected IP EIGRP status"))
-
-            # Empty string if it matches, otherwise diff contains unified diff
-            if diff:
-                sys.stderr.write('r%s failed IP EIGRP status check:\n%s\n' % (i, diff))
-                failures += 1
-            else:
-                print("r%s ok" % i)
-
-            assert failures == 0, "IP EIGRP status failed for router r%s:\n%s" % (i, diff)
+    sleep(5)
 
     # Make sure that all daemons are still running
     for i in range(1, 4):
@@ -258,7 +204,7 @@ def test_eigrp_routes():
             expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
 
             # Actual output from router
-            actual = net['r%s' % i].cmd('vtysh -c "show ip eigrp" 2> /dev/null').rstrip()
+            actual = net['r%s' % i].cmd('vtysh -c "show ip eigrp topo" 2> /dev/null').rstrip()
             # Drop Time
             actual = re.sub(r"[0-9][0-9]:[0-5][0-9]", "XX:XX", actual)
             # Fix newlines (make them all the same)
@@ -310,9 +256,7 @@ def test_zebra_ipv4_routingTable():
             expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
 
             # Actual output from router
-            actual = net['r%s' % i].cmd('vtysh -c "show ip route" 2> /dev/null | grep "^R"').rstrip()
-            # Drop timers on end of line (older Quagga Versions)
-            actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
+            actual = net['r%s' % i].cmd('vtysh -c "show ip route"').rstrip()
             # Fix newlines (make them all the same)
             actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)