tests: Expand minimum run_and_expect to 5 seconds

Ensure that the minimum time spent run and expecting is
5 seconds.  Heavy load is not a reason to fail a test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-11-19 07:31:57 -05:00
parent 6d48dfcb71
commit c6653ab2eb
7 changed files with 29 additions and 28 deletions

View File

@ -207,7 +207,7 @@ def test_bgp_fast_reconvergence():
test_func = partial( test_func = partial(
topotest.router_json_cmp, router, "show ip bgp json", expected topotest.router_json_cmp, router, "show ip bgp json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "{}: bgp did not converge".format(router.name) assertmsg = "{}: bgp did not converge".format(router.name)
assert res is None, assertmsg assert res is None, assertmsg

View File

@ -785,7 +785,7 @@ def test_bgp_delayopen_without():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show ip bgp summary json", expected topotest.router_json_cmp, router, "show ip bgp summary json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r{} did not shut down peer".format(router_num) assertmsg = "BGP session on r{} did not shut down peer".format(router_num)
assert res is None, assertmsg assert res is None, assertmsg
@ -862,7 +862,7 @@ def test_bgp_delayopen_singular():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show ip bgp summary json", expected topotest.router_json_cmp, router, "show ip bgp summary json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r{} did not shut down peer".format(router_num) assertmsg = "BGP session on r{} did not shut down peer".format(router_num)
assert res is None, assertmsg assert res is None, assertmsg
@ -880,7 +880,7 @@ def test_bgp_delayopen_singular():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show bgp neighbors json", expected topotest.router_json_cmp, router, "show bgp neighbors json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r1 failed to set DelayOpenTime for r4" assertmsg = "BGP session on r1 failed to set DelayOpenTime for r4"
assert res is None, assertmsg assert res is None, assertmsg
@ -974,7 +974,7 @@ def test_bgp_delayopen_dual():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show ip bgp summary json", expected topotest.router_json_cmp, router, "show ip bgp summary json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r{} did not shut down peer".format(router_num) assertmsg = "BGP session on r{} did not shut down peer".format(router_num)
assert res is None, assertmsg assert res is None, assertmsg
@ -1003,7 +1003,7 @@ def test_bgp_delayopen_dual():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show bgp neighbors json", expected topotest.router_json_cmp, router, "show bgp neighbors json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r{} failed to set DelayOpenTime".format(router_num) assertmsg = "BGP session on r{} failed to set DelayOpenTime".format(router_num)
assert res is None, assertmsg assert res is None, assertmsg
@ -1032,7 +1032,7 @@ def test_bgp_delayopen_dual():
test_func = functools.partial( test_func = functools.partial(
topotest.router_json_cmp, router, "show ip bgp summary json", expected topotest.router_json_cmp, router, "show ip bgp summary json", expected
) )
_, res = topotest.run_and_expect(test_func, None, count=3, wait=1) _, res = topotest.run_and_expect(test_func, None, count=5, wait=1)
assertmsg = "BGP session on r{} did not enter Connect state with peer".format( assertmsg = "BGP session on r{} did not enter Connect state with peer".format(
router_num router_num
) )

View File

@ -106,7 +106,7 @@ def test_bgp_route():
"show ip route 50.0.0.0 json", "show ip route 50.0.0.0 json",
expected, expected,
) )
_, result = topotest.run_and_expect(test_func, None, count=3, wait=0.5) _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assertmsg = '"r3" JSON output mismatches' assertmsg = '"r3" JSON output mismatches'
assert result is None, assertmsg assert result is None, assertmsg
@ -118,8 +118,9 @@ def test_bgp_route():
r3, r3,
"show ip route 10.0.0.3 json", "show ip route 10.0.0.3 json",
expected, expected,
) )
_, result = topotest.run_and_expect(test_func, None, count=3, wait=0.5) _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
def test_bgp_better_admin_won(): def test_bgp_better_admin_won():
"A better Admin distance protocol may come along and knock us out" "A better Admin distance protocol may come along and knock us out"

View File

@ -153,7 +153,7 @@ def test_bgp_tcp_mss():
"Verify if TCP MSS value is synced with neighbor in {}".format(router1.name) "Verify if TCP MSS value is synced with neighbor in {}".format(router1.name)
) )
test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router1, "192.168.255.2") test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router1, "192.168.255.2")
success, result = topotest.run_and_expect(test_func, None, count=3, wait=0.5) success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert ( assert (
result is None result is None
), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router1.name) ), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router1.name)
@ -163,7 +163,7 @@ def test_bgp_tcp_mss():
"Verify if TCP MSS value is synced with neighbor in {}".format(router2.name) "Verify if TCP MSS value is synced with neighbor in {}".format(router2.name)
) )
test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router2, "192.168.255.1") test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router2, "192.168.255.1")
success, result = topotest.run_and_expect(test_func, None, count=3, wait=0.5) success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert ( assert (
result is None result is None
), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router2.name) ), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router2.name)

View File

@ -177,7 +177,7 @@ def compare_cspf_output(tgen, rname, fileref, src, dst, cost, bw=""):
test_func = partial( test_func = partial(
topotest.router_output_cmp, tgen.gears[rname], command, expected topotest.router_output_cmp, tgen.gears[rname], command, expected
) )
result, diff = topotest.run_and_expect(test_func, "", count=2, wait=2) result, diff = topotest.run_and_expect(test_func, "", count=5, wait=2)
assert result, "CSPF output mismatches the expected result on {}:\n{}".format( assert result, "CSPF output mismatches the expected result on {}:\n{}".format(
rname, diff rname, diff
) )

View File

@ -676,8 +676,8 @@ def test_rib_ipv6_step15():
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][15]["show_ipv6_route.ref"], outputs[rname][15]["show_ipv6_route.ref"],
count=2, count=10,
wait=0.05, wait=0.5,
) )
@ -852,8 +852,8 @@ def test_rib_ipv6_step18():
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][15]["show_ipv6_route.ref"], outputs[rname][15]["show_ipv6_route.ref"],
count=2, count=10,
wait=0.05, wait=0.5,
) )
@ -948,8 +948,8 @@ def test_rib_ipv6_step21():
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][15]["show_ipv6_route.ref"], outputs[rname][15]["show_ipv6_route.ref"],
count=2, count=10,
wait=0.05, wait=0.5,
) )
@ -1047,14 +1047,14 @@ def test_rib_ipv6_step24():
rname = "rt1" rname = "rt1"
router = tgen.gears[rname] router = tgen.gears[rname]
test_func = partial(_bfd_down, router) test_func = partial(_bfd_down, router)
success, result = topotest.run_and_expect(test_func, None, count=30, wait=0.05) success, result = topotest.run_and_expect(test_func, None, count=30, wait=0.3)
assert result is None, 'BFD session is still up on "{}"'.format(router) assert result is None, 'BFD session is still up on "{}"'.format(router)
router_compare_json_output( router_compare_json_output(
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][15]["show_ipv6_route.ref"], outputs[rname][15]["show_ipv6_route.ref"],
count=4, count=5,
) )

View File

@ -831,19 +831,19 @@ def test_rt6_step11():
rname, rname,
"show ip route isis json", "show ip route isis json",
outputs[rname][11]["show_ip_route.ref"], outputs[rname][11]["show_ip_route.ref"],
count=1, count=5,
) )
router_compare_json_output( router_compare_json_output(
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][11]["show_ipv6_route.ref"], outputs[rname][11]["show_ipv6_route.ref"],
count=1, count=5,
) )
router_compare_json_output( router_compare_json_output(
rname, rname,
"show mpls table json", "show mpls table json",
outputs[rname][11]["show_mpls_table.ref"], outputs[rname][11]["show_mpls_table.ref"],
count=1, count=5,
) )
@ -1021,26 +1021,26 @@ def test_rt6_step14():
"show bfd peers json", "show bfd peers json",
expect, expect,
count=40, count=40,
wait=0.05, wait=0.5,
) )
router_compare_json_output( router_compare_json_output(
rname, rname,
"show ip route isis json", "show ip route isis json",
outputs[rname][11]["show_ip_route.ref"], outputs[rname][11]["show_ip_route.ref"],
count=4, count=5,
) )
router_compare_json_output( router_compare_json_output(
rname, rname,
"show ipv6 route isis json", "show ipv6 route isis json",
outputs[rname][11]["show_ipv6_route.ref"], outputs[rname][11]["show_ipv6_route.ref"],
count=4, count=5,
) )
router_compare_json_output( router_compare_json_output(
rname, rname,
"show mpls table json", "show mpls table json",
outputs[rname][11]["show_mpls_table.ref"], outputs[rname][11]["show_mpls_table.ref"],
count=4, count=5,
) )