diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-06 23:33:02 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-10 23:58:17 +0000 |
commit | 59420a4c4623492085348e07fb78eaae51182782 (patch) | |
tree | ea4ab75a0b39ca4ff049924edec59d7247ca0759 /test/lib | |
parent | aa79a4de21772f556450cfe7e55e6f400c3f9dec (diff) |
server: support prefix-limit
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/base.py | 5 | ||||
-rw-r--r-- | test/lib/gobgp.py | 4 |
2 files changed, 7 insertions, 2 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: |