summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_snmp_bgp4v2mib
diff options
context:
space:
mode:
authorFrancois Dumontet <francois.dumontet@6wind.com>2023-11-19 22:55:06 +0100
committerton31337 <3352707+ton31337@users.noreply.github.com>2023-11-22 07:24:00 +0000
commita5bee822f42cac5b74cf21f33d9ddea4f5a4bbd0 (patch)
tree1dc2b6bde9518b874958a480094bc54b3dad4076 /tests/topotests/bgp_snmp_bgp4v2mib
parentb84476e0bb46ea7f6d6b6d180f06602b27a34ecd (diff)
tests: bgp_snmp_bgp4v2mib fix some random failure
avoid to consider additionnal traps randomly received later Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Diffstat (limited to 'tests/topotests/bgp_snmp_bgp4v2mib')
-rwxr-xr-xtests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py25
1 files changed, 23 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 4d87621fa9..14dadd4504 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 test_bgp_snmp_bgp4v2():
# 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)
@@ -284,13 +283,35 @@ def test_bgp_snmp_bgp4v2():
("1.3.6.1.3.5.1.1.2.1.6.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "179"),
]
+ expected2 = [
+ ("1.3.6.1.3.5.1.1.2.1.13.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "7"),
+ ("1.3.6.1.3.5.1.1.2.1.6.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "179"),
+ ("1.3.6.1.3.5.1.1.3.1.1.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "6"),
+ ("1.3.6.1.3.5.1.1.3.1.2.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "4"),
+ (
+ "1.3.6.1.3.5.1.1.3.1.4.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1",
+ '"00 "',
+ ),
+ ("1.3.6.1.3.5.1.1.2.1.13.1.1.192.168.12.1", "7"),
+ ("1.3.6.1.3.5.1.1.2.1.6.1.1.192.168.12.1", "179"),
+ ("1.3.6.1.3.5.1.1.3.1.1.1.1.192.168.12.1", "6"),
+ ("1.3.6.1.3.5.1.1.3.1.2.1.1.192.168.12.1", "4"),
+ ("1.3.6.1.3.5.1.1.3.1.4.1.1.192.168.12.1", '"00 "'),
+ ("1.3.6.1.3.5.1.1.2.1.13.1.1.192.168.12.1", "6"),
+ ("1.3.6.1.3.5.1.1.2.1.6.1.1.192.168.12.1", "179"),
+ ("1.3.6.1.3.5.1.1.2.1.13.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "6"),
+ ("1.3.6.1.3.5.1.1.2.1.6.1.2.32.1.13.184.0.0.0.0.0.0.0.0.0.18.0.1", "179"),
+ ]
+
# load trapd resulting file
# tgen.mininet_cli()
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 or output_cut == expected2
snmptrapfile = "{}/{}/snmptrapd.log".format(r2.logdir, r2.name)
trap_file = open(snmptrapfile, "w")