Skip to content

Commit

Permalink
issue_810 Handling review comments: updated failure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
VitthalMagadum committed Sep 12, 2024
1 parent a9139be commit 07ae814
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions anta/tests/routing/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,8 @@ def test(self) -> None:
failures: dict[Any, Any] = {}

for command, input_entry in zip(self.instance_commands, self.inputs.bgp_peers):
peer = command.params.peer
vrf = command.params.vrf
peer = str(input_entry.peer_address)
vrf = input_entry.vrf
peer_group = input_entry.peer_group

# Verify BGP peer.
Expand All @@ -1504,7 +1504,7 @@ def test(self) -> None:
failure_log = f"Expected `{peer_group}` as the configured peer-group, but found `{actual_peer_group}` instead."
if not actual_peer_group:
failure_log = "Peer-group not configured."
failures[peer] = failure_log
failures[peer] = {vrf: failure_log}

# Check if any failures
if not failures:
Expand Down
15 changes: 8 additions & 7 deletions tests/units/anta_tests/routing/test_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4658,11 +4658,11 @@
"result": "failure",
"messages": [
"The following BGP peer(s) are not configured or have incorrect peer-group configured:\n"
"{'10.100.0.8': 'Expected `IPv4-UNDERLAY-PEERS` as the configured peer-group, but found `UNDERLAY-PEERS` instead.', "
"'10.100.0.10': 'Expected `IPv4-UNDERLAY-PEERS` as the configured peer-group, but found `UNDERLAY-PEERS` instead.', "
"'10.100.1.1': 'Expected `EVPN-OVERLAY-PEERS` as the configured peer-group, but found `OVERLAY-PEERS` instead.', "
"'10.100.1.2': 'Expected `EVPN-OVERLAY-PEERS` as the configured peer-group, but found `OVERLAY-PEERS` instead.', "
"'10.100.4.5': 'Expected `MLAG-IPv4-UNDERLAY-PEER` as the configured peer-group, but found `UNDERLAY-PEER` instead.'}"
"{'10.100.0.8': {'default': 'Expected `IPv4-UNDERLAY-PEERS` as the configured peer-group, but found `UNDERLAY-PEERS` instead.'}, "
"'10.100.0.10': {'MGMT': 'Expected `IPv4-UNDERLAY-PEERS` as the configured peer-group, but found `UNDERLAY-PEERS` instead.'}, "
"'10.100.1.1': {'default': 'Expected `EVPN-OVERLAY-PEERS` as the configured peer-group, but found `OVERLAY-PEERS` instead.'}, "
"'10.100.1.2': {'MGMT': 'Expected `EVPN-OVERLAY-PEERS` as the configured peer-group, but found `OVERLAY-PEERS` instead.'}, "
"'10.100.4.5': {'default': 'Expected `MLAG-IPv4-UNDERLAY-PEER` as the configured peer-group, but found `UNDERLAY-PEER` instead.'}}"
],
},
},
Expand Down Expand Up @@ -4787,8 +4787,9 @@
"result": "failure",
"messages": [
"The following BGP peer(s) are not configured or have incorrect peer-group configured:\n"
"{'10.100.0.8': 'Peer-group not configured.', '10.100.0.10': 'Peer-group not configured.', '10.100.1.1': "
"'Peer-group not configured.', '10.100.1.2': 'Peer-group not configured.', '10.100.4.5': 'Peer-group not configured.'}"
"{'10.100.0.8': {'default': 'Peer-group not configured.'}, '10.100.0.10': {'MGMT': 'Peer-group not configured.'}, '10.100.1.1': "
"{'default': 'Peer-group not configured.'}, '10.100.1.2': {'MGMT': 'Peer-group not configured.'}, "
"'10.100.4.5': {'default': 'Peer-group not configured.'}}"
],
},
},
Expand Down

0 comments on commit 07ae814

Please sign in to comment.