From 5440f32fcd85264b659d126573f447a80eb3db31 Mon Sep 17 00:00:00 2001 From: Satoshi Fujimoto Date: Mon, 27 Nov 2017 11:06:07 +0900 Subject: 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 --- test/lib/gobgp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/lib') 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'], -- cgit v1.2.3