Skip to content

Commit

Permalink
tests: bgp_snmp_bgp4v2mib fix some random failure
Browse files Browse the repository at this point in the history
avoid to consider additionnal traps randomly received later

Signed-off-by: Francois Dumontet <[email protected]>
  • Loading branch information
fdumontet6WIND committed Nov 19, 2023
1 parent f9012ed commit d8605e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def _snmpwalk_origin():
# bgp4V2NlriOrigin
# tgen.mininet_cli()
output, _ = snmp.walk(".1.3.6.1.3.5.1.1.9.1.9")
logger.info(output)
return output == expected

_, result = topotest.run_and_expect(_snmpwalk_origin, True, count=10, wait=1)
Expand Down Expand Up @@ -290,7 +289,9 @@ def _snmptrap_ipv6():
snmptrapfile = "{}/{}/snmptrapd.log".format(r2.logdir, r2.name)
outputfile = open(snmptrapfile).read()
output = snmp.trap(outputfile)
return output == expected
logger.info(output);
output_cut = output[:14]
return output_cut == expected

snmptrapfile = "{}/{}/snmptrapd.log".format(r2.logdir, r2.name)
trap_file = open(snmptrapfile, "w")
Expand Down

0 comments on commit d8605e2

Please sign in to comment.