summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-06 23:33:02 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-10 23:58:17 +0000
commit59420a4c4623492085348e07fb78eaae51182782 (patch)
treeea4ab75a0b39ca4ff049924edec59d7247ca0759 /test
parentaa79a4de21772f556450cfe7e55e6f400c3f9dec (diff)
server: support prefix-limit
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test')
-rw-r--r--test/lib/base.py5
-rw-r--r--test/lib/gobgp.py4
-rw-r--r--test/scenario_test/route_server_test.py2
3 files changed, 8 insertions, 3 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index 29920451..d5dfc221 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -254,7 +254,7 @@ class BGPContainer(Container):
policies=None, passive=False,
is_rr_client=False, cluster_id=None,
flowspec=False, bridge='', reload_config=True, as2=False,
- graceful_restart=None, local_as=None):
+ graceful_restart=None, local_as=None, prefix_limit=None):
neigh_addr = ''
local_addr = ''
for me, you in itertools.product(self.ip_addrs, peer.ip_addrs):
@@ -283,7 +283,8 @@ class BGPContainer(Container):
'local_addr': local_addr,
'as2': as2,
'graceful_restart': graceful_restart,
- 'local_as': local_as}
+ 'local_as': local_as,
+ 'prefix_limit': prefix_limit}
if self.is_running and reload_config:
self.create_config()
self.reload_config()
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py
index b8413f40..36b4b86e 100644
--- a/test/lib/gobgp.py
+++ b/test/lib/gobgp.py
@@ -243,6 +243,10 @@ class GoBGPContainer(BGPContainer):
if info['local_as']:
n['config']['local-as'] = info['local_as']
+ if info['prefix_limit']:
+ for v in afi_safi_list:
+ v['prefix-limit'] = {'config': {'max-prefixes': info['prefix_limit'], 'shutdown-threshold-pct': 80 }}
+
if info['graceful_restart'] is not None:
n['graceful-restart'] = {'config': {'enabled': True, 'restart-time': 20}}
for afi_safi in afi_safi_list:
diff --git a/test/scenario_test/route_server_test.py b/test/scenario_test/route_server_test.py
index ab305e44..3c8f9356 100644
--- a/test/scenario_test/route_server_test.py
+++ b/test/scenario_test/route_server_test.py
@@ -59,7 +59,7 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
for rs_client in rs_clients:
- g1.add_peer(rs_client, is_rs_client=True, passwd='passwd', passive=True)
+ g1.add_peer(rs_client, is_rs_client=True, passwd='passwd', passive=True, prefix_limit=10)
rs_client.add_peer(g1, passwd='passwd')
cls.gobgp = g1