diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-09-13 08:32:54 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-13 08:32:54 -0400 |
| commit | 2fdfc842f81d1eab7fcb22a669b302c08d59e2b4 (patch) | |
| tree | 805c55ccda83ef5e82c0864af3a88088752e0f85 /tests/topotests/lib/topotest.py | |
| parent | 4731dc4518b4545a1a60c5ead28b460b960f17f0 (diff) | |
| parent | 1375385adf6bfd89d0bcffeec85596783addda0a (diff) | |
Merge pull request #9571 from LabNConsulting/chopps/impr-zeb-netlink
tests: increase wait and update test
Diffstat (limited to 'tests/topotests/lib/topotest.py')
| -rw-r--r-- | tests/topotests/lib/topotest.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 1b26ddc1b5..b98698185c 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -439,6 +439,19 @@ def run_and_expect_type(func, etype, count=20, wait=3, avalue=None): return (False, result) +def router_json_cmp_retry(router, cmd, data, exact=False, retry_timeout=10.0): + """ + Runs `cmd` that returns JSON data (normally the command ends with 'json') + and compare with `data` contents. Retry by default for 10 seconds + """ + + def test_func(): + return router_json_cmp(router, cmd, data, exact) + + ok, _ = run_and_expect(test_func, None, int(retry_timeout), 1) + return ok + + def int2dpid(dpid): "Converting Integer to DPID" |
