Skip to content

Commit

Permalink
fix for test_snmp_numpsu failure (#14860)
Browse files Browse the repository at this point in the history
* fix for test_snmp_numpsu tc failure

* Trigger Pipeline again
  • Loading branch information
agadia-cisco authored Oct 30, 2024
1 parent 6acc725 commit a20e752
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/snmp/test_snmp_psu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ def test_snmp_numpsu(duthosts, enum_supervisor_dut_hostname, localhost, creds_al

assert int(res['rc']) == 0, "Failed to get number of PSUs"

numpsus = int(res['stdout'])
assert numpsus == len(snmp_facts['snmp_psu'])
output = res["stdout_lines"]
numpsus = None
if len(output):
try:
numpsus = int(output[-1])
except (IndexError, ValueError):
pass
assert numpsus == len(snmp_facts['snmp_psu']), "PSUs count doesn't match"


@pytest.mark.bsl
Expand Down

0 comments on commit a20e752

Please sign in to comment.