summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-09-26 16:06:25 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-09-29 15:05:43 +0900
commite637c746e9bc880b86ee11b06c306e533003598d (patch)
tree29ba207ae48a2cb3fcc589c909c4e8de8a659bb9 /test/lib
parentba395457213966dd8a49b5836b2341434f4025b9 (diff)
test: Add Scenario tests for Revised Error Handling
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/base.py6
-rw-r--r--test/lib/gobgp.py3
2 files changed, 7 insertions, 2 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index 5b1e4349..9dc44e82 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -326,7 +326,8 @@ class BGPContainer(Container):
flowspec=False, bridge='', reload_config=True, as2=False,
graceful_restart=None, local_as=None, prefix_limit=None,
v6=False, llgr=None, vrf='', interface='', allow_as_in=0,
- remove_private_as=None, replace_peer_as=False, addpath=False):
+ remove_private_as=None, replace_peer_as=False, addpath=False,
+ treat_as_withdraw=False):
neigh_addr = ''
local_addr = ''
it = itertools.product(self.ip_addrs, peer.ip_addrs)
@@ -371,7 +372,8 @@ class BGPContainer(Container):
'allow_as_in': allow_as_in,
'remove_private_as': remove_private_as,
'replace_peer_as': replace_peer_as,
- 'addpath': addpath}
+ 'addpath': addpath,
+ 'treat_as_withdraw': treat_as_withdraw}
if self.is_running and reload_config:
self.create_config()
self.reload_config()
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py
index dfdc6808..7fa90291 100644
--- a/test/lib/gobgp.py
+++ b/test/lib/gobgp.py
@@ -426,6 +426,9 @@ class GoBGPContainer(BGPContainer):
for typ, d in info.get('default-policy', {}).iteritems():
n['apply-policy']['config']['default-{0}-policy'.format(typ)] = _f(d)
+ if info['treat_as_withdraw']:
+ n['error-handling'] = {'config': {'treat-as-withdraw': True}}
+
config['neighbors'].append(n)
config['defined-sets'] = {}