summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
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'] = {}