diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-01-25 16:51:06 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-01-27 20:48:42 +0900 |
commit | f5b79f84744ec53a9457c0f610dfde0581d5d4be (patch) | |
tree | aeca6146c59fab06edaa09367c44c59817e29689 /test/scenario_test | |
parent | 5ea3cbdd9dc41e6dcf3c0258455a357e154efdb1 (diff) |
test/lib/gobgp: Adding routes without reloading
With the current implementation, when adding routes on GoBGPContainer,
we re-configure and reload daemon, then add routes using CLI command.
Differ from QuaggaBGPContainer, when deletion of routes, reloading is
not required, but if reloading daemon frequently, we need to wait for
the daemon restarting, it causes testing time longer and unstable.
This patch enables to add routes without reloading daemon.
Note: According to this change, adding routes should be called after
starting daemons.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/scenario_test')
-rw-r--r-- | test/scenario_test/route_server_test2.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/scenario_test/route_server_test2.py b/test/scenario_test/route_server_test2.py index 73f106a8..e60e264e 100644 --- a/test/scenario_test/route_server_test2.py +++ b/test/scenario_test/route_server_test2.py @@ -47,23 +47,21 @@ class GoBGPTestBase(unittest.TestCase): 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') - ctns = [g1, g2, e1] - # advertise a route from route-server-clients - cls.clients = {} - for idx, cli in enumerate((g2, e1)): - route = '10.0.{0}.0/24'.format(idx) - cli.add_route(route) - cls.clients[cli.name] = cli + ctns = [g1, g2, e1] + cls.clients = {cli.name: cli for cli in (g2, e1)} initial_wait_time = max(ctn.run() for ctn in ctns) - time.sleep(initial_wait_time) - for cli in cls.clients.itervalues(): + 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') + # advertise a route from route-server-clients + g2.add_route('10.0.0.0/24') + e1.add_route('10.0.1.0/24') + cls.gobgp = g1 # test each neighbor state is turned establish |