diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 02:58:34 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 16:23:02 +0900 |
commit | 119137f4fdf4123fcba808d5f736eed4bb1e1968 (patch) | |
tree | ee8a25d35c015439a100482a84c8022143ea8320 /test/scenario_test/lib/exabgp.py | |
parent | 0b021a22b8a8c5e7e9f9cb840c5268a77eaa6417 (diff) |
test: enable parallel execution of policy test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib/exabgp.py')
-rw-r--r-- | test/scenario_test/lib/exabgp.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/scenario_test/lib/exabgp.py b/test/scenario_test/lib/exabgp.py index 9d211342..f5cdd313 100644 --- a/test/scenario_test/lib/exabgp.py +++ b/test/scenario_test/lib/exabgp.py @@ -76,15 +76,25 @@ class ExaBGPContainer(BGPContainer): cmd << ' local-as {0};'.format(self.asn) cmd << ' peer-as {0};'.format(peer.asn) - routes = [r for r in self.routes.values() if r['rf'] == 'ipv4'] + routes = [r for r in self.routes.values() if r['rf'] == 'ipv4' or r['rf'] == 'ipv6'] if len(routes) > 0: cmd << ' static {' for route in routes: + r = CmdBuffer(' ') + r << ' route {0} next-hop {1}'.format(route['prefix'], local_addr) + if route['as-path']: + r << 'as-path [{0}]'.format(' '.join(str(i) for i in route['as-path'])) + if route['community']: + r << 'community [{0}]'.format(' '.join(c for c in route['community'])) + if route['med']: + r << 'med {0}'.format(route['med']) + if route['extended-community']: + r << 'extended-community [{0}]'.format(route['extended-community']) if route['attr']: - cmd << ' route {0} next-hop {1};'.format(route['prefix'], local_addr) - else: - cmd << ' route {0} next-hop {1} attribute {2};'.format(route['prefix'], local_addr, attr) + r << 'attribute {0}'.format(route['attr']) + + cmd << '{0};'.format(str(r)) cmd << ' }' routes = [r for r in self.routes.values() if r['rf'] == 'ipv4-flowspec'] |