From 8efeb17ba517675ace1058a178285c68fd13bb19 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Mon, 21 May 2018 16:07:32 +0900 Subject: bgp_router_test: Retry assertions of RIB for stability To improve the stability of "bgp_router_test.py", this patch fixes to retry assertions of RIB on a Quagga router after shutting down a neighbor. Signed-off-by: IWASE Yusuke --- test/scenario_test/bgp_router_test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/scenario_test/bgp_router_test.py') diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py index 727c598e..a69aa3f7 100644 --- a/test/scenario_test/bgp_router_test.py +++ b/test/scenario_test/bgp_router_test.py @@ -321,9 +321,12 @@ class GoBGPTestBase(unittest.TestCase): self.gobgp.wait_for(expected_state=BGP_FSM_ACTIVE, peer=q3) - paths = q1.get_global_rib('20.0.0.0/24') - self.assertEqual(len(paths), 1) - self.assertIn(paths[0]['nexthop'], n_addrs) + def f(): + paths = q1.get_global_rib('20.0.0.0/24') + self.assertEqual(len(paths), 1) + self.assertIn(paths[0]['nexthop'], n_addrs) + + assert_several_times(f) g1.del_peer(q3) del self.quaggas['q3'] -- cgit v1.2.3