From d8605e2cc4147815e89fa5f63ce0296c801e5a01 Mon Sep 17 00:00:00 2001 From: Francois Dumontet Date: Sun, 19 Nov 2023 22:55:06 +0100 Subject: [PATCH] tests: bgp_snmp_bgp4v2mib fix some random failure avoid to consider additionnal traps randomly received later Signed-off-by: Francois Dumontet --- .../topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py b/tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py index 4d87621fa952..23e68008639f 100755 --- a/tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py +++ b/tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py @@ -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) @@ -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")