summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-22 17:42:29 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-22 17:48:57 +0900
commite0c7d1823a0ffa5661f7b2dd54810e0fd92f72fb (patch)
tree4e0fcadd8142db39d2d62849f2d416c7dbc89d66 /test/scenario_test/lib
parentcbd731658749acad58759e4f7fe0849d5111a3b3 (diff)
test: enable parallel execution of malformed test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib')
-rw-r--r--test/scenario_test/lib/base.py3
-rw-r--r--test/scenario_test/lib/exabgp.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py
index d8ab74d5..7922bbdf 100644
--- a/test/scenario_test/lib/base.py
+++ b/test/scenario_test/lib/base.py
@@ -272,10 +272,11 @@ class BGPContainer(Container):
def add_route(self, route, rf='ipv4', attribute=None, aspath=None,
community=None, med=None, extendedcommunity=None,
- matchs=None, thens=None):
+ nexthop=None, matchs=None, thens=None):
self.routes[route] = {'prefix': route,
'rf': rf,
'attr': attribute,
+ 'next-hop': nexthop,
'as-path': aspath,
'community': community,
'med': med,
diff --git a/test/scenario_test/lib/exabgp.py b/test/scenario_test/lib/exabgp.py
index f5cdd313..cf5fbc1a 100644
--- a/test/scenario_test/lib/exabgp.py
+++ b/test/scenario_test/lib/exabgp.py
@@ -82,7 +82,10 @@ class ExaBGPContainer(BGPContainer):
cmd << ' static {'
for route in routes:
r = CmdBuffer(' ')
- r << ' route {0} next-hop {1}'.format(route['prefix'], local_addr)
+ nexthop = local_addr
+ if route['next-hop']:
+ nexthop = route['next-hop']
+ r << ' route {0} next-hop {1}'.format(route['prefix'], nexthop)
if route['as-path']:
r << 'as-path [{0}]'.format(' '.join(str(i) for i in route['as-path']))
if route['community']:
@@ -92,7 +95,7 @@ class ExaBGPContainer(BGPContainer):
if route['extended-community']:
r << 'extended-community [{0}]'.format(route['extended-community'])
if route['attr']:
- r << 'attribute {0}'.format(route['attr'])
+ r << 'attribute [ {0} ]'.format(route['attr'])
cmd << '{0};'.format(str(r))
cmd << ' }'