]> git.proxmox.com Git - mirror_frr.git/commit
tests: apply KISS to retry fixture
authorChristian Hopps <chopps@labn.net>
Sat, 19 Jun 2021 12:09:06 +0000 (12:09 +0000)
committerChristian Hopps <chopps@labn.net>
Fri, 25 Jun 2021 05:33:04 +0000 (05:33 +0000)
commited776e38f69080febcc5b4d9db8d55b5101cbdf1
treee8b3dae689ab9900ec24c79c333a5cb117f13ec2
parentd8c3138cd9d18563e291586f1d4c0b2ca0fc9184
tests: apply KISS to retry fixture

This python fixture was way too complex for what is needed.

Eliminate gratuitous options/over-engineering:

- Change from non-deterministic `wait` and `attempts` to a single
`retry_timeout` value. This is both more deterministic, as well as
what the user should actually be thinking about.

- Use a fixed 2 second pause between executing the wrapped function
rather than a bunch of arbitrary choices of 2, 3 and 4 seconds
spread all over the test code.

- Get rid of the multiple variables for determining what "Positive" and
"Negative" results are. Instead just implement what all the user code
already wants, i.e., boolean False or a str (errormsg) means
"Negative" result otherwise it's a "Positive" result.

- As part of the above the inversion logic is much more comprehensible
in the fixture code (and more correct to boot).

Signed-off-by: Christian Hopps <chopps@labn.net>
12 files changed:
tests/topotests/lib/bgp.py
tests/topotests/lib/common_config.py
tests/topotests/lib/ospf.py
tests/topotests/lib/pim.py
tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py
tests/topotests/ospf_basic_functionality/test_ospf_authentication.py
tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py
tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py
tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py
tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py
tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py