Skip to content

Commit

Permalink
fixing the pipeline failures
Browse files Browse the repository at this point in the history
  • Loading branch information
vitthalmagadum committed Jan 10, 2025
1 parent e1ac318 commit 3e3508f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions anta/tests/routing/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,11 +1394,11 @@ def test(self) -> None:
output = self.instance_commands[0].json_output

for peer in self.inputs.bgp_peers:
peer_ip = str(peer.peer_address)
peer_list = get_value(output, f"vrfs.{peer.vrf}.peerList", default=[])
peer_address = str(peer.peer_address)
peers = get_value(output, f"vrfs.{peer.vrf}.peerList", default=[])

# Check if the peer is found
if (peer_data := get_item(peer_list, "peerAddress", peer_ip)) is None:
if (peer_data := get_item(peers, "peerAddress", peer_address)) is None:
self.result.is_failure(f"{peer} - Not found")
continue

Expand All @@ -1409,10 +1409,10 @@ def test(self) -> None:

# Check the TCP session message queues
if self.inputs.check_tcp_queues:
inq = peer_data["peerTcpInfo"]["inputQueueLength"]
outq = peer_data["peerTcpInfo"]["outputQueueLength"]
if inq != 0 or outq != 0:
self.result.is_failure(f"{peer} - Session has non-empty message queues - InQ: {inq}, OutQ: {outq}")
inq_stat = peer_data["peerTcpInfo"]["inputQueueLength"]
outq_stat = peer_data["peerTcpInfo"]["outputQueueLength"]
if inq_stat != 0 or outq_stat != 0:
self.result.is_failure(f"{peer} - Session has non-empty message queues - InQ: {inq_stat}, OutQ: {outq_stat}")


class VerifyBGPPeersHealthRibd(AntaTest):
Expand Down Expand Up @@ -1471,8 +1471,7 @@ def test(self) -> None:
continue

# Check the TCP session message queues
if self.inputs.check_tcp_queues:
inq = peer["peerTcpInfo"]["inputQueueLength"]
outq = peer["peerTcpInfo"]["outputQueueLength"]
if inq != 0 or outq != 0:
self.result.is_failure(f"Peer: {peer['peerAddress']} VRF: {vrf} - Session has non-empty message queues - InQ: {inq}, OutQ: {outq}")
inq = peer["peerTcpInfo"]["inputQueueLength"]
outq = peer["peerTcpInfo"]["outputQueueLength"]
if self.inputs.check_tcp_queues and (inq != 0 or outq != 0):
self.result.is_failure(f"Peer: {peer['peerAddress']} VRF: {vrf} - Session has non-empty message queues - InQ: {inq}, OutQ: {outq}")

0 comments on commit 3e3508f

Please sign in to comment.