3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

auto-t: fix unreliable behavior in testPSK-roam

The packet loss test had a few problems. First being that the RSSI for
the original BSS was not low enough to change the rank. This meant any
roam was just lucky that the intended BSS was first in the results.

The second problem is timing related, and only happens on UML. Disabling
the rules after the roaming condition sometimes allows IWD to fully
roam and connect before the next state change checks.
This commit is contained in:
James Prestwood 2022-08-22 10:01:45 -07:00 committed by Denis Kenzior
parent fb76a4ef13
commit 41ce56bf0d

View File

@ -55,16 +55,16 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
if pkt_loss:
self.rule1.enabled = False
self.rule2.enabled = False
# Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between
from_condition = 'obj.state == DeviceState.roaming'
to_condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_change(device, from_condition, to_condition)
if pkt_loss:
self.rule1.enabled = False
self.rule2.enabled = False
self.bss_hostapd[1].wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
@ -197,7 +197,7 @@ class Test(unittest.TestCase):
cls.rule2 = hwsim.rules.create()
cls.rule2.source = rad0.addresses[0]
cls.rule2.signal = -4000
cls.rule2.signal = -7000
# Set interface addresses to those expected by hostapd config files
os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down')