From 0b78f57ccdf63591fd211ade0b571189e070f598 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 19 Feb 2016 15:40:30 +0900 Subject: config/server: support per-peer asn you can override `global.config.as` by `neighbor.config.local-as` Signed-off-by: ISHIDA Wataru --- test/lib/base.py | 5 +++-- test/lib/gobgp.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'test/lib') diff --git a/test/lib/base.py b/test/lib/base.py index 37cc26f4..3dcbc1e8 100644 --- a/test/lib/base.py +++ b/test/lib/base.py @@ -248,7 +248,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): + graceful_restart=None, local_as=None): neigh_addr = '' local_addr = '' for me, you in itertools.product(self.ip_addrs, peer.ip_addrs): @@ -276,7 +276,8 @@ class BGPContainer(Container): 'passive': passive, 'local_addr': local_addr, 'as2': as2, - 'graceful_restart': graceful_restart} + 'graceful_restart': graceful_restart, + 'local_as': local_as} 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 1f956587..774113e0 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -215,6 +215,9 @@ class GoBGPContainer(BGPContainer): if info['is_rs_client']: n['route-server'] = {'config': {'route-server-client': True}} + if info['local_as']: + n['config']['local-as'] = info['local_as'] + if info['graceful_restart'] is not None: n['graceful-restart'] = {'config': {'enabled': True, 'restart-time': 20}} for afi_safi in afi_safi_list: -- cgit v1.2.3