summaryrefslogtreecommitdiffhomepage
path: root/test/lib/exabgp.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-09-17 20:01:22 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-05 04:57:27 +0900
commitf48c4deaa19ca8b36d87a0d71776bc29b7e17ebe (patch)
tree169474793f5afba6db03d9743a3ab747b6a0d7a7 /test/lib/exabgp.py
parent87f0b0bdc52945ae98ef6d44b7f118216bde95ca (diff)
test: add addpath_test.py
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib/exabgp.py')
-rw-r--r--test/lib/exabgp.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/lib/exabgp.py b/test/lib/exabgp.py
index dbf8f023..efc39ac1 100644
--- a/test/lib/exabgp.py
+++ b/test/lib/exabgp.py
@@ -19,6 +19,7 @@ import time
from fabric import colors
from fabric.api import local
+from itertools import chain
from lib.base import (
BGPContainer,
@@ -92,7 +93,10 @@ class ExaBGPContainer(BGPContainer):
if info['passive']:
cmd << ' passive;'
- routes = [r for r in self.routes.values() if r['rf'] == 'ipv4' or r['rf'] == 'ipv6']
+ if info['addpath']:
+ cmd << ' add-path send/receive;'
+
+ routes = [r for r in chain.from_iterable(self.routes.itervalues()) if r['rf'] == 'ipv4' or r['rf'] == 'ipv6']
if len(routes) > 0:
cmd << ' static {'
@@ -114,11 +118,13 @@ class ExaBGPContainer(BGPContainer):
r << 'extended-community [{0}]'.format(route['extended-community'])
if route['attr']:
r << 'attribute [ {0} ]'.format(route['attr'])
+ if route['identifier']:
+ r << 'path-information {0}'.format(route['identifier'])
cmd << '{0};'.format(str(r))
cmd << ' }'
- routes = [r for r in self.routes.itervalues() if 'flowspec' in r['rf']]
+ routes = [r for r in chain.from_iterable(self.routes.itervalues()) if 'flowspec' in r['rf']]
if len(routes) > 0:
cmd << ' flow {'
for route in routes: