diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-12-28 11:22:01 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-12-28 11:45:48 +0900 |
commit | 577662422ee02622e4a8277ad570d501e0cf7ebc (patch) | |
tree | 186651a6a4f7eba4d247beae13393e106346204e | |
parent | 3145a05a84da7036def7996d76ae9e110cdc1a10 (diff) |
addpath_test: Wait for re-establishment with ExaBGP
When adding or deleting routes in ExaBGPContainer, it is required to
restart ExaBGPContainer with the current implementation.
This patch fixes to wait for the re-establishment with ExaBGP and
improves the stability of this test case.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | test/scenario_test/addpath_test.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/scenario_test/addpath_test.py b/test/scenario_test/addpath_test.py index dc7db766..de0f337b 100644 --- a/test/scenario_test/addpath_test.py +++ b/test/scenario_test/addpath_test.py @@ -74,7 +74,10 @@ class GoBGPTestBase(unittest.TestCase): self.e1.add_route(route='192.168.100.0/24', identifier=10, aspath=[100, 200, 300]) self.e1.add_route(route='192.168.100.0/24', identifier=20, aspath=[100, 200]) self.e1.add_route(route='192.168.100.0/24', identifier=30, aspath=[100]) - time.sleep(1) # XXX: wait for routes re-calculated and advertised + # Because ExaBGPContainer will be restarted internally for adding or + # deleting routes, here waits for re-establishment. + self.g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=self.e1) + time.sleep(1) # test three routes are installed to the rib due to add-path feature def test_02_check_g1_global_rib(self): @@ -98,7 +101,10 @@ class GoBGPTestBase(unittest.TestCase): # withdraw a route with path_id (no error check) def test_05_withdraw_route_with_path_id(self): self.e1.del_route(route='192.168.100.0/24', identifier=30) - time.sleep(1) # XXX: wait for routes re-calculated and advertised + # Because ExaBGPContainer will be restarted internally for adding or + # deleting routes, here waits for re-establishment. + self.g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=self.e1) + time.sleep(1) # test the withdrawn route is removed from the rib def test_06_check_g1_global_rib(self): |