3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

auto-t: Increase all test timeouts

Slower systems may not be able to make some timeouts that tests
mandated. All timeouts were increased significantly to allow tests
to pass on slow systems.
This commit is contained in:
James Prestwood 2020-09-10 16:12:37 -07:00 committed by Denis Kenzior
parent 0036cb976f
commit 6e2aba3907
17 changed files with 37 additions and 37 deletions

View File

@ -60,10 +60,10 @@ class Test(unittest.TestCase):
(bss_radio[2].addresses[0], '8f0000005103060603000000')]) (bss_radio[2].addresses[0], '8f0000005103060603000000')])
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 15) wd.wait_for_object_condition(device, condition)
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(bss_hostapd[1].list_sta()) self.assertTrue(bss_hostapd[1].list_sta())

View File

@ -99,10 +99,10 @@ class Test(unittest.TestCase):
# Now we wait... AutoConnect should take over # Now we wait... AutoConnect should take over
condition = 'obj.state == DeviceState.connecting' condition = 'obj.state == DeviceState.connecting'
wd.wait_for_object_condition(device, condition, 15) wd.wait_for_object_condition(device, condition)
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition, 15) wd.wait_for_object_condition(device, condition)
# Same as before, make sure we didn't connect to the blacklisted AP. # Same as before, make sure we didn't connect to the blacklisted AP.
self.assertNotIn(device.address, bss_hostapd[0].list_sta()) self.assertNotIn(device.address, bss_hostapd[0].list_sta())

View File

@ -75,12 +75,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())
@ -151,12 +151,12 @@ class Test(unittest.TestCase):
rule0.drop = False rule0.drop = False
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 20) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())

View File

@ -105,12 +105,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())

View File

@ -105,12 +105,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())

View File

@ -81,12 +81,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())

View File

@ -83,12 +83,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta()) self.assertTrue(self.bss_hostapd[1].list_sta())

View File

@ -86,12 +86,12 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 10) wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
rule1.signal = -2000 rule1.signal = -2000
@ -112,10 +112,10 @@ class Test(unittest.TestCase):
rule2.signal = -1000 rule2.signal = -1000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 15) wd.wait_for_object_condition(device, condition)
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[2].list_sta()) self.assertTrue(self.bss_hostapd[2].list_sta())

View File

@ -20,12 +20,12 @@ class TestConnectAutoConnect(unittest.TestCase):
device.connect_hidden_network(ssid) device.connect_hidden_network(ssid)
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition, 30) wd.wait_for_object_condition(device, condition)
def check_autoconnect_hidden_network(self, wd, device, ssid, throws): def check_autoconnect_hidden_network(self, wd, device, ssid, throws):
if throws is None: if throws is None:
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition, 30) wd.wait_for_object_condition(device, condition)
condition = 'obj.connected_network is not None' condition = 'obj.connected_network is not None'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
@ -37,7 +37,7 @@ class TestConnectAutoConnect(unittest.TestCase):
device.disconnect() device.disconnect()
condition = 'obj.state == DeviceState.disconnected' condition = 'obj.state == DeviceState.disconnected'
wd.wait_for_object_condition(device, condition, 30) wd.wait_for_object_condition(device, condition)
def validate_connection(self, wd, ssid, autoconnect, throws, use_agent, def validate_connection(self, wd, ssid, autoconnect, throws, use_agent,
wait_periodic_scan): wait_periodic_scan):

View File

@ -56,7 +56,7 @@ class Test(unittest.TestCase):
IWD.copy_to_storage('known_networks/ssidPSK.psk') IWD.copy_to_storage('known_networks/ssidPSK.psk')
condition = 'len(obj.list_known_networks()) == 5' condition = 'len(obj.list_known_networks()) == 5'
wd.wait_for_object_condition(wd, condition, 1) wd.wait_for_object_condition(wd, condition)
expected = ['ssidNew', 'ssidOpen', 'ssidPSK', 'ssidEAP-TLS', expected = ['ssidNew', 'ssidOpen', 'ssidPSK', 'ssidEAP-TLS',
'Hotspot Network'] 'Hotspot Network']
@ -65,7 +65,7 @@ class Test(unittest.TestCase):
IWD.remove_from_storage('ssidPSK.psk') IWD.remove_from_storage('ssidPSK.psk')
condition = 'len(obj.list_known_networks()) == 4' condition = 'len(obj.list_known_networks()) == 4'
wd.wait_for_object_condition(wd, condition, 1) wd.wait_for_object_condition(wd, condition)
for net in known_networks: for net in known_networks:
net.forget() net.forget()

View File

@ -91,14 +91,14 @@ class Test(unittest.TestCase):
rule0.signal = -8000 rule0.signal = -8000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 15) wd.wait_for_object_condition(device, condition)
# TODO: verify that the PMK from preauthentication was used # TODO: verify that the PMK from preauthentication was used
# Check that iwd is on BSS 1 once out of roaming state and doesn't # Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between # go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming' condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5) wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(bss_hostapd[1].list_sta()) self.assertTrue(bss_hostapd[1].list_sta())

View File

@ -71,7 +71,7 @@ class Test(unittest.TestCase):
rule.signal = centre rule.signal = centre
agent.level = -1 agent.level = -1
condition = 'obj.level == ' + str(level) condition = 'obj.level == ' + str(level)
wd.wait_for_object_condition(agent, condition, 3) wd.wait_for_object_condition(agent, condition)
self.assertTrue(agent.calls > 0) self.assertTrue(agent.calls > 0)
self.assertEqual(agent.device_path, device.device_path) self.assertEqual(agent.device_path, device.device_path)

View File

@ -24,7 +24,7 @@ class Test(unittest.TestCase):
devices[3].disconnect() devices[3].disconnect()
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition, 30) wd.wait_for_object_condition(device, condition)
condition = 'obj.connected_network is not None' condition = 'obj.connected_network is not None'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)

View File

@ -36,9 +36,9 @@ class Test(unittest.TestCase):
device = devices[0] device = devices[0]
condition = 'obj.scanning' condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition, 20) wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition, 20) wd.wait_for_object_condition(device, condition)
device.scan() device.scan()

View File

@ -867,8 +867,8 @@ class IWD(AsyncOpAbstract):
tries = 0 tries = 0
while not self._bus.name_has_owner(IWD_SERVICE): while not self._bus.name_has_owner(IWD_SERVICE):
if ctx.args.gdb == 'None': if not ctx.args.gdb:
if tries > 100: if tries > 200:
if start_iwd_daemon: if start_iwd_daemon:
ctx.stop_process(self._iwd_proc) ctx.stop_process(self._iwd_proc)
self._iwd_proc = None self._iwd_proc = None
@ -913,7 +913,7 @@ class IWD(AsyncOpAbstract):
IWD_AGENT_MANAGER_INTERFACE) IWD_AGENT_MANAGER_INTERFACE)
return self._agent_manager_if return self._agent_manager_if
def wait_for_object_condition(self, obj, condition_str, max_wait = 15): def wait_for_object_condition(self, obj, condition_str, max_wait = 50):
self._wait_timed_out = False self._wait_timed_out = False
def wait_timeout_cb(): def wait_timeout_cb():
self._wait_timed_out = True self._wait_timed_out = True
@ -982,7 +982,7 @@ class IWD(AsyncOpAbstract):
def remove_from_storage(file_name): def remove_from_storage(file_name):
os.system('rm -rf ' + IWD_STORAGE_DIR + '/\'' + file_name + '\'') os.system('rm -rf ' + IWD_STORAGE_DIR + '/\'' + file_name + '\'')
def list_devices(self, wait_to_appear = 0, max_wait = 15): def list_devices(self, wait_to_appear = 0, max_wait = 50):
if not wait_to_appear: if not wait_to_appear:
return list(self._devices.values()) return list(self._devices.values())

View File

@ -82,7 +82,7 @@ def test_connected(if0=None, if1=None, group=True):
rec.append(False) rec.append(False)
while not all(rec): while not all(rec):
r, w, x = select.select([sock0, sock1], [], [], 1.0) r, w, x = select.select([sock0, sock1], [], [], 10)
if not r: if not r:
raise Exception('timeout waiting for packets: ' + repr(rec)) raise Exception('timeout waiting for packets: ' + repr(rec))

View File

@ -43,7 +43,7 @@ config = None
intf_id = 0 intf_id = 0
rad_id = 0 rad_id = 0
TEST_MAX_TIMEOUT = 45 TEST_MAX_TIMEOUT = 120
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)