summaryrefslogtreecommitdiffhomepage
path: root/test/lib/exabgp.py
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-12-25 14:46:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-19 13:25:19 +0900
commit3707b5aedf11e1adc2bd35baba9d05a308ba384b (patch)
treea77e042560c21b42366b79f5dd393001e034a3c6 /test/lib/exabgp.py
parent52770785bd2c9b77744ace2a2e2092132b534406 (diff)
test/lib/base: Delete FlowSpec routes with keyword
Currently, in case of the FlowSpec routes, "prefix" value which stored on each container instance is just a keyword and not valid NLRI arguments for adding or deleting routes. So when deleting routes with "route" keyword, it is required to construct the NLRI arguments using "matchs" value. This patch enables to construct the valid NLIR arguments as "prefix" value when adding the FlowSpec routes and enables to delete the FlowSpec routes with "route" keyword. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/lib/exabgp.py')
-rw-r--r--test/lib/exabgp.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lib/exabgp.py b/test/lib/exabgp.py
index efc39ac1..3bb9d207 100644
--- a/test/lib/exabgp.py
+++ b/test/lib/exabgp.py
@@ -15,11 +15,11 @@
from __future__ import absolute_import
+from itertools import chain
import time
from fabric import colors
from fabric.api import local
-from itertools import chain
from lib.base import (
BGPContainer,
@@ -124,11 +124,11 @@ class ExaBGPContainer(BGPContainer):
cmd << '{0};'.format(str(r))
cmd << ' }'
- routes = [r for r in chain.from_iterable(self.routes.itervalues()) if 'flowspec' in r['rf']]
- if len(routes) > 0:
+ routes = self._extract_routes(['ipv4-flowspec', 'ipv6-flowspec'])
+ for key, routes in routes.items():
cmd << ' flow {'
for route in routes:
- cmd << ' route {0}{{'.format(route['prefix'])
+ cmd << ' route {0} {{'.format(key)
cmd << ' match {'
for match in route['matchs']:
cmd << ' {0};'.format(match)