diff --git a/autotests/util/testutil.py b/autotests/util/testutil.py index 4c2c4ac5..4028c004 100644 --- a/autotests/util/testutil.py +++ b/autotests/util/testutil.py @@ -50,7 +50,7 @@ def tx(fromsock, tosock, src, dst): return (frame, fromsock, tosock, src, dst) -def test_ifaces_connected(if0=None, if1=None): +def test_connected(if0=None, if1=None): for wname in wiphy.wiphy_map: for intf in wiphy.wiphy_map[wname]: if if0 is None: @@ -101,6 +101,20 @@ def test_ifaces_connected(if0=None, if1=None): sock0.close() sock1.close() +def test_ifaces_connected(if0=None, if1=None): + retry = 0 + while True: + try: + test_connected(if0, if1) + break + + except Exception as e: + if retry < 3: + print('retrying connection test: %i' % retry) + retry += 1 + continue + raise e + SIOCGIFFLAGS = 0x8913 IFF_UP = 1 << 0 IFF_RUNNING = 1 << 6