diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-01-17 11:02:12 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-02-10 21:47:38 +0900 |
commit | aae35319a8421705f17e02e1a89aad9486ee713e (patch) | |
tree | 329d364d92a2901ea4140930af61692a2224e368 /test/scenario_test/route_server_test2.py | |
parent | 1fd46103728f0ed421a74a5fd6b96cb74b44bb38 (diff) |
test/lib/exabgp: Use exabgpcli to add/del routes
Currently, to advertise or withdraw routes with ExaBGPContainer, we need
to configure static routes via config file and restart ExaBGP daemon.
In other words, we can NOT send withdrawing advertisement with
ExaBGPContainer. Also, restating ExaBGP daemon frequently can make
scenario test unstable, and it should be avoided.
On the other hand, with ExaBGP version 4.0.5 or later(*), we can
advertise or withdraw routes using "exabgpcli" without restating ExaBGP
daemon (or writing application which calls ExaBGP's APIs).
This patch fixes to use "exabgpcli" and reduces the number of restating
ExaBGP daemon.
Note: According to this change, adding routes into ExaBGP should be
called after adding neighbor.
(*): "exabgpcli" is introduced at version 4.0.2, but has some bugs
related to Python 3 compatibility and FlowSpec rules combinations, then
we need to use version 4.0.5 or later.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/scenario_test/route_server_test2.py')
-rw-r--r-- | test/scenario_test/route_server_test2.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/scenario_test/route_server_test2.py b/test/scenario_test/route_server_test2.py index e60e264e..61c546b8 100644 --- a/test/scenario_test/route_server_test2.py +++ b/test/scenario_test/route_server_test2.py @@ -43,7 +43,6 @@ class GoBGPTestBase(unittest.TestCase): g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) - g2 = GoBGPContainer(name='g2', asn=65001, router_id='192.168.0.2', ctn_image_name=gobgp_ctn_image_name) e1 = ExaBGPContainer(name='e1', asn=65002, router_id='192.168.0.3') @@ -55,8 +54,10 @@ class GoBGPTestBase(unittest.TestCase): time.sleep(initial_wait_time) for cli in cls.clients.values(): - g1.add_peer(cli, is_rs_client=True, passwd='passwd', passive=True, prefix_limit=10) - cli.add_peer(g1, passwd='passwd') + # Omit "passwd" to avoid a issue on ExaBGP version 4.0.5: + # https://github.com/Exa-Networks/exabgp/issues/766 + g1.add_peer(cli, is_rs_client=True, passive=True, prefix_limit=10) + cli.add_peer(g1) # advertise a route from route-server-clients g2.add_route('10.0.0.0/24') @@ -66,7 +67,7 @@ class GoBGPTestBase(unittest.TestCase): # test each neighbor state is turned establish def test_01_neighbor_established(self): - for cli in self.clients.itervalues(): + for cli in self.clients.values(): self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=cli) def test_02_add_neighbor(self): |