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

auto-t: speed up testRoamRetry

This test took quite a while to execute (~2 minutes on my machine)
because there was simply no other way to test this scenario but
waiting. Now the no-roam-candidates condition can be waited for
rather than just sleeping for 20 seconds. Additionally the default
RoamRetryInterval was being used which is 60 seconds. Instead
main.conf can set this to 5 seconds and really cut down on the time
to wait.

Part of a comment was also removed due to being incorrect. Even
with neighbor reports IWD still must scan, its just that the
scan is more limited and, in theory, faster.
This commit is contained in:
James Prestwood 2021-08-13 12:47:10 -07:00 committed by Denis Kenzior
parent 36777d1e68
commit 78f5a5dde4
3 changed files with 6 additions and 5 deletions

View File

@ -82,7 +82,7 @@ class Test(unittest.TestCase):
# schedule another attempt for 60 seconds later # schedule another attempt for 60 seconds later
rule0.signal = -8000 rule0.signal = -8000
wd.wait(20) device.wait_for_event('no-roam-candidates')
self.assertEqual(device.state, iwd.DeviceState.connected) self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(bss_hostapd[0].list_sta()) self.assertTrue(bss_hostapd[0].list_sta())
@ -99,13 +99,12 @@ class Test(unittest.TestCase):
wd.wait(1) wd.wait(1)
# Assert low signal for BSS 0, check that iwd starts transition to BSS 1 # Assert low signal for BSS 0, check that iwd starts transition to BSS 1
# in less than 10 seconds. Because of the neighbor report a scan should # in less than 10 seconds.
# not be necessary.
rule0.signal = -8000 rule0.signal = -8000
rule1.signal = -2000 rule1.signal = -2000
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, max_wait=10) wd.wait_for_object_condition(device, condition, max_wait=15)
# 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

View File

@ -0,0 +1,2 @@
[General]
RoamRetryInterval=5

View File

@ -99,7 +99,7 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.roaming' condition = 'obj.state == DeviceState.roaming'
self.assertRaises(TimeoutError, wd.wait_for_object_condition, device, self.assertRaises(TimeoutError, wd.wait_for_object_condition, device,
condition, max_wait=70) condition, max_wait=10)
device.disconnect() device.disconnect()