From 41ce56bf0ddee8384ff9eae578752af9b6f06634 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 22 Aug 2022 10:01:45 -0700 Subject: [PATCH] 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. --- autotests/testPSK-roam/connection_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autotests/testPSK-roam/connection_test.py b/autotests/testPSK-roam/connection_test.py index c926e255..364f75c2 100644 --- a/autotests/testPSK-roam/connection_test.py +++ b/autotests/testPSK-roam/connection_test.py @@ -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')