Skip to content

Commit

Permalink
bgp: T6106: fix test and verify()
Browse files Browse the repository at this point in the history
(cherry picked from commit 2ba435f)
  • Loading branch information
HollyGurza authored and mergify[bot] committed Mar 26, 2024
1 parent 2589161 commit f62e67e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions smoketest/scripts/cli/test_protocols_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,11 @@ def test_bgp_26_ipv6_labeled_unicast_peer_group(self):
self.assertIn(f' neighbor {pg_ipv6} activate', afiv6_config)
self.assertIn(f' neighbor {pg_ipv6} maximum-prefix {ipv6_max_prefix}', afiv6_config)

def test_bgp_26_commit_error(self):
def test_bgp_27_route_reflector_client(self):
self.cli_set(base_path + ['peer-group', 'peer1', 'address-family', 'l2vpn-evpn', 'route-reflector-client'])
with self.assertRaises(ConfigSessionError) as e:
self.cli_commit()

self.assertTrue("% Invalid command. Not an internal neighbor" in str(e.exception))

def test_bgp_99_bmp(self):
target_name = 'instance-bmp'
target_address = '127.0.0.1'
Expand Down
2 changes: 2 additions & 0 deletions src/conf_mode/protocols_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ def verify(bgp):
peer_group_as = dict_search(f'peer_group.{peer_group}.remote_as', bgp)
if peer_group_as != None and peer_group_as != 'internal' and peer_group_as != bgp['system_as']:
raise ConfigError('route-reflector-client only supported for iBGP peers')
else:
raise ConfigError('route-reflector-client only supported for iBGP peers')

# Throw an error if a peer group is not configured for allow range
for prefix in dict_search('listen.range', bgp) or []:
Expand Down

0 comments on commit f62e67e

Please sign in to comment.