From 743c4765a4e83b316c05cbbb42b8f59a3d0e673f Mon Sep 17 00:00:00 2001 From: David Ames Date: Wed, 16 Oct 2019 14:57:53 -0700 Subject: [PATCH 1/2] Allow more time for BGP route test Add more retries to the bgp route test and print out the routing table. --- zaza/openstack/charm_tests/dragent/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/dragent/test.py b/zaza/openstack/charm_tests/dragent/test.py index de4e230..b8c9fd5 100644 --- a/zaza/openstack/charm_tests/dragent/test.py +++ b/zaza/openstack/charm_tests/dragent/test.py @@ -61,14 +61,14 @@ def test_bgp_routes(peer_application_name="quagga", keystone_session=None): # This test may run immediately after configuration. It may take time for # routes to propogate via BGP. Do a binary backoff. @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), - reraise=True, stop=tenacity.stop_after_attempt(8)) + reraise=True, stop=tenacity.stop_after_attempt(10)) def _assert_cidr_in_peer_routing_table(peer_unit, cidr): logging.debug("Checking for {} on BGP peer {}" .format(cidr, peer_unit)) # Run show ip route bgp on BGP peer routes = juju_utils.remote_run( peer_unit, remote_cmd='vtysh -c "show ip route bgp"') - logging.debug(routes) + logging.info(routes) assert cidr in routes, ( "CIDR, {}, not found in BGP peer's routing table" .format(cidr)) From 29a4c7cf4437da606de3398218224d847e511837 Mon Sep 17 00:00:00 2001 From: David Ames Date: Wed, 16 Oct 2019 15:46:33 -0700 Subject: [PATCH 2/2] Display routes in assertion error --- zaza/openstack/charm_tests/dragent/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/dragent/test.py b/zaza/openstack/charm_tests/dragent/test.py index b8c9fd5..90aacb9 100644 --- a/zaza/openstack/charm_tests/dragent/test.py +++ b/zaza/openstack/charm_tests/dragent/test.py @@ -70,7 +70,8 @@ def test_bgp_routes(peer_application_name="quagga", keystone_session=None): peer_unit, remote_cmd='vtysh -c "show ip route bgp"') logging.info(routes) assert cidr in routes, ( - "CIDR, {}, not found in BGP peer's routing table" .format(cidr)) + "CIDR, {}, not found in BGP peer's routing table: {}" + .format(cidr, routes)) _assert_cidr_in_peer_routing_table(peer_unit, private_cidr) logging.info("Private subnet CIDR, {}, found in routing table"