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/flow_spec_test.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/flow_spec_test.py')
-rw-r--r-- | test/scenario_test/flow_spec_test.py | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/test/scenario_test/flow_spec_test.py b/test/scenario_test/flow_spec_test.py index d4b401a7..0a94962f 100644 --- a/test/scenario_test/flow_spec_test.py +++ b/test/scenario_test/flow_spec_test.py @@ -65,26 +65,6 @@ class FlowSpecTest(unittest.TestCase): initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) - # Add FlowSpec routes into ExaBGP. - # Note: Currently, ExaBGPContainer only supports to add routes by - # reloading configuration, so we add routes here. - cls.e1.add_route( - route='ipv4/dst/src', - rf='ipv4-flowspec', - matchs=[ - 'destination 12.1.0.0/24', - 'source 12.2.0.0/24', - ], - thens=['discard']) - cls.e1.add_route( - route='ipv6/dst/src', - rf='ipv6-flowspec', - matchs=[ - 'destination 2002:1::/64/10', - 'source 2002:2::/64/15', - ], - thens=['discard']) - # Add FlowSpec routes into GoBGP. cls.g1.add_route( route='ipv4/all', @@ -122,9 +102,25 @@ class FlowSpecTest(unittest.TestCase): cls.g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=cls.e1) cls.g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=cls.y1) + # Add FlowSpec routes into ExaBGP. + cls.e1.add_route( + route='ipv4/dst/src', + rf='ipv4-flowspec', + matchs=[ + 'destination 12.1.0.0/24', + 'source 12.2.0.0/24', + ], + thens=['discard']) + cls.e1.add_route( + route='ipv6/dst/src', + rf='ipv6-flowspec', + matchs=[ + 'destination 2002:1::/64/10', + 'source 2002:2::/64/15', + ], + thens=['discard']) + # Add FlowSpec routes into YABGP. - # Note: Currently, YABGPContainer only supports to add routes via - # REST API after connection established, so we add routes here. cls.y1.add_route( route='ipv4/all', rf='ipv4-flowspec', |