commit 55a077d399a9701967d26226dfb771531793b3ba
parent c80d32a162f36c910795b0ce5ba86f38e9870c3d
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Wed, 5 Jun 2019 14:02:24 -0700
auto-t: testutil: allow skipping of group traffic test
If the network does not support group traffic we can now skip the
broadcast test by specifying group=False in test_ifaces_connected.
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/autotests/util/testutil.py b/autotests/util/testutil.py
@@ -51,7 +51,7 @@ def tx(fromsock, tosock, src, dst):
return (frame, fromsock, tosock, src, dst)
-def test_connected(if0=None, if1=None):
+def test_connected(if0=None, if1=None, group=True):
if if0 is None or if1 is None:
iwd_list = [dev.name for dev in iwd.IWD.get_instance().list_devices()]
non_iwd_list = [ifname for w in wiphy.wiphy_map.values()
@@ -69,12 +69,16 @@ def test_connected(if0=None, if1=None):
try:
frames = [
tx(sock0, sock1, addr0, addr1),
- tx(sock0, sock1, addr0, bcast),
tx(sock1, sock0, addr1, addr0),
- tx(sock1, sock0, addr1, bcast),
]
- rec = [False, False, False, False]
+ rec = [False, False]
+
+ if group:
+ frames.append(tx(sock0, sock1, addr0, bcast))
+ frames.append(tx(sock1, sock0, addr1, bcast))
+ rec.append(False)
+ rec.append(False)
while not all(rec):
r, w, x = select.select([sock0, sock1], [], [], 1.0)
@@ -105,11 +109,11 @@ def test_connected(if0=None, if1=None):
sock0.close()
sock1.close()
-def test_ifaces_connected(if0=None, if1=None):
+def test_ifaces_connected(if0=None, if1=None, group=True):
retry = 0
while True:
try:
- test_connected(if0, if1)
+ test_connected(if0, if1, group)
break
except Exception as e: