From: Donald Sharp Date: Fri, 18 Aug 2017 19:37:24 +0000 (-0400) Subject: Basic EIGRP topo test working X-Git-Tag: frr-7.1-dev~151^2~232 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2dad85f4329a2cf9ffd5e96d7f0224b38756f0dd;p=mirror%2Ffrr.git Basic EIGRP topo test working Signed-off-by: Donald Sharp --- diff --git a/tests/topotests/eigrp-topo1/r1/show_ip_eigrp.ref b/tests/topotests/eigrp-topo1/r1/show_ip_eigrp.ref index 561560f230..190a570df1 100644 --- a/tests/topotests/eigrp-topo1/r1/show_ip_eigrp.ref +++ b/tests/topotests/eigrp-topo1/r1/show_ip_eigrp.ref @@ -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 diff --git a/tests/topotests/eigrp-topo1/r1/show_ip_route.ref b/tests/topotests/eigrp-topo1/r1/show_ip_route.ref index 62d71f0ab6..2e81211667 100644 --- a/tests/topotests/eigrp-topo1/r1/show_ip_route.ref +++ b/tests/topotests/eigrp-topo1/r1/show_ip_route.ref @@ -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 diff --git a/tests/topotests/eigrp-topo1/r2/show_ip_route.ref b/tests/topotests/eigrp-topo1/r2/show_ip_route.ref index 4b34939aa5..c82247fb1e 100644 --- a/tests/topotests/eigrp-topo1/r2/show_ip_route.ref +++ b/tests/topotests/eigrp-topo1/r2/show_ip_route.ref @@ -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 diff --git a/tests/topotests/eigrp-topo1/r3/show_ip_route.ref b/tests/topotests/eigrp-topo1/r3/show_ip_route.ref index 835e1229c8..ce1fcf7136 100644 --- a/tests/topotests/eigrp-topo1/r3/show_ip_route.ref +++ b/tests/topotests/eigrp-topo1/r3/show_ip_route.ref @@ -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 diff --git a/tests/topotests/eigrp-topo1/test_eigrp_topo1.py b/tests/topotests/eigrp-topo1/test_eigrp_topo1.py index c73a40156d..02dcf23ffc 100755 --- a/tests/topotests/eigrp-topo1/test_eigrp_topo1.py +++ b/tests/topotests/eigrp-topo1/test_eigrp_topo1.py @@ -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)