summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-09 15:42:08 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-09 15:56:39 +0900
commit78dd33b5a58db3d213e9ef9bf244d20bb063947b (patch)
tree6e10ceb07473ab91096443134badb28d5d3f2c34 /test/lib
parentf42b8fbae6d8eb381967e82867a1b67188bdcbc5 (diff)
test: add test to check as2 peer handling
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/base.py5
-rw-r--r--test/lib/exabgp.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index 8d27e996..5ab94d8b 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -247,7 +247,7 @@ class BGPContainer(Container):
def add_peer(self, peer, passwd=None, evpn=False, is_rs_client=False,
policies=None, passive=False,
is_rr_client=False, cluster_id=None,
- flowspec=False, bridge='', reload_config=True):
+ flowspec=False, bridge='', reload_config=True, as2=False):
neigh_addr = ''
local_addr = ''
for me, you in itertools.product(self.ip_addrs, peer.ip_addrs):
@@ -273,7 +273,8 @@ class BGPContainer(Container):
'cluster_id': cluster_id,
'policies': policies,
'passive': passive,
- 'local_addr': local_addr}
+ 'local_addr': local_addr,
+ 'as2': as2}
if self.is_running and reload_config:
self.create_config()
self.reload_config()
diff --git a/test/lib/exabgp.py b/test/lib/exabgp.py
index 39298c4c..af6b6e0c 100644
--- a/test/lib/exabgp.py
+++ b/test/lib/exabgp.py
@@ -69,6 +69,11 @@ class ExaBGPContainer(BGPContainer):
cmd << ' local-as {0};'.format(self.asn)
cmd << ' peer-as {0};'.format(peer.asn)
+ if info['as2']:
+ cmd << ' capability {'
+ cmd << ' asn4 disable;'
+ cmd << ' }'
+
routes = [r for r in self.routes.values() if r['rf'] == 'ipv4' or r['rf'] == 'ipv6']
if len(routes) > 0: