diff options
Diffstat (limited to 'tests/topotests/ldp_topo1/test_ldp_topo1.py')
| -rw-r--r-- | tests/topotests/ldp_topo1/test_ldp_topo1.py | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/tests/topotests/ldp_topo1/test_ldp_topo1.py b/tests/topotests/ldp_topo1/test_ldp_topo1.py index c21d6bf28e..4a33edb9d1 100644 --- a/tests/topotests/ldp_topo1/test_ldp_topo1.py +++ b/tests/topotests/ldp_topo1/test_ldp_topo1.py @@ -64,6 +64,7 @@ import re import sys import pytest from time import sleep +from lib.topolog import logger sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from lib import topotest @@ -126,7 +127,7 @@ def setup_module(module): tgen.gears["r%s" % i].start() # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) + # tgen.mininet_cli() def teardown_module(module): @@ -153,9 +154,6 @@ def test_router_running(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_mpls_interfaces(): global fatal_error @@ -219,9 +217,6 @@ def test_mpls_interfaces(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_mpls_ldp_neighbor_establish(): global fatal_error @@ -231,6 +226,13 @@ def test_mpls_ldp_neighbor_establish(): if fatal_error != "": pytest.skip(fatal_error) + neighbors_operational = { + 1: 1, + 2: 3, + 3: 2, + 4: 2, + } + # Wait for MPLS LDP neighbors to establish. print("\n\n** Verify MPLS LDP neighbors to establish") print("******************************************\n") @@ -260,9 +262,14 @@ def test_mpls_ldp_neighbor_establish(): established = "" # Empty string shows NOT established if re.search(operational, lines[j]): found_operational += 1 + + logger.info("Found operational %d" % found_operational) if found_operational < 1: # Need at least one operational neighbor established = "" # Empty string shows NOT established + else: + if found_operational != neighbors_operational[i]: + established = "" if not established: print("Waiting for r%s" % i) sys.stdout.flush() @@ -356,9 +363,6 @@ def test_mpls_ldp_discovery(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_mpls_ldp_neighbor(): global fatal_error @@ -426,9 +430,6 @@ def test_mpls_ldp_neighbor(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_mpls_ldp_binding(): global fatal_error @@ -518,9 +519,6 @@ def test_mpls_ldp_binding(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_zebra_ipv4_routingTable(): global fatal_error @@ -595,9 +593,6 @@ def test_zebra_ipv4_routingTable(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_mpls_table(): global fatal_error @@ -674,9 +669,6 @@ def test_mpls_table(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_linux_mpls_routes(): global fatal_error @@ -758,9 +750,6 @@ def test_linux_mpls_routes(): fatal_error = net["r%s" % i].checkRouterRunning() assert fatal_error == "", fatal_error - # For debugging after starting FRR daemons, uncomment the next line - # CLI(net) - def test_shutdown_check_stderr(): global fatal_error |
