summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib/gobgp.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-10 02:10:59 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-12 08:04:31 +0900
commit5099fbe54de38f09d874e078caaaf4a5adaa66dc (patch)
tree8a258835a8077a34bb9b23586138f1d2ce3dfb10 /test/scenario_test/lib/gobgp.py
parent5c066cc6a64b03126a737fb41954a62bae762806 (diff)
test: add flowspec scenario test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib/gobgp.py')
-rw-r--r--test/scenario_test/lib/gobgp.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/scenario_test/lib/gobgp.py b/test/scenario_test/lib/gobgp.py
index e1da72c8..63f65928 100644
--- a/test/scenario_test/lib/gobgp.py
+++ b/test/scenario_test/lib/gobgp.py
@@ -148,6 +148,9 @@ class GoBGPContainer(BGPContainer):
afi_safi_list.append({'AfiSafiName': 'encap'})
afi_safi_list.append({'AfiSafiName': 'rtc'})
+ if info['flowspec']:
+ afi_safi_list.append({'AfiSafiName': 'ipv4-flowspec'})
+
n = {'NeighborConfig':
{'NeighborAddress': info['neigh_addr'].split('/')[0],
'PeerAs': peer.asn,
@@ -182,6 +185,12 @@ class GoBGPContainer(BGPContainer):
cmd = '/usr/bin/pkill gobgpd -SIGHUP'
self.local(cmd)
for v in self.routes.itervalues():
- cmd = 'gobgp global '\
- 'rib add {0} -a {1}'.format(v['prefix'], v['rf'])
+ if v['rf'] == 'ipv4' or v['rf'] == 'ipv6':
+ cmd = 'gobgp global '\
+ 'rib add {0} -a {1}'.format(v['prefix'], v['rf'])
+ elif v['rf']== 'ipv4-flowspec':
+ cmd = 'gobgp global '\
+ 'rib add match {0} then {1} -a {2}'.format(' '.join(v['matchs']), ' '.join(v['thens']), v['rf'])
+ else:
+ raise Exception('unsupported route faily: {0}'.format(rf))
self.local(cmd)