summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-11-27 11:06:07 +0900
committerSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-11-27 14:19:58 +0900
commit5440f32fcd85264b659d126573f447a80eb3db31 (patch)
treeee48d20108bf0bb50c93efabf94556b2137f2709 /test
parent9225bec8e032aebfbf52b6435bc0b7bb9b7a93ff (diff)
test/lib: Allow unconfigured peer-as for Unnumbered BGP
For Unnumbered BGP, neighbor AS number isn't needed to be specified, so 'peer-as' should not be specified in the scenario test for Unnumbered BGP. However, currently 'peer-as' is always specified in test/lib/gobgp.py This commit solves this by not specifying `peer-as` if 'neighbor-interface' is configured. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/lib/gobgp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py
index 601883e5..e1e7b15b 100644
--- a/test/lib/gobgp.py
+++ b/test/lib/gobgp.py
@@ -366,15 +366,17 @@ class GoBGPContainer(BGPContainer):
neigh_addr = None
interface = None
+ peer_as = None
if info['interface'] == '':
neigh_addr = info['neigh_addr'].split('/')[0]
+ peer_as = info['remote_as']
else:
interface = info['interface']
n = {
'config': {
'neighbor-address': neigh_addr,
'neighbor-interface': interface,
- 'peer-as': info['remote_as'],
+ 'peer-as': peer_as,
'auth-password': info['passwd'],
'vrf': info['vrf'],
'remove-private-as': info['remove_private_as'],