This lets the test environment know if IWD is attempting a roam
prior to the roaming state being set.
---
src/station.c | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/station.c b/src/station.c
index 408ae887..a1885cfa 100644
--- a/src/station.c
+++ b/src/station.c
@@ -114,6 +114,7 @@ struct station {
bool ap_directed_roaming : 1;
bool scanning : 1;
bool autoconnect : 1;
+ bool roam_scanning : 1;
};
struct anqp_entry {
@@ -1842,8 +1843,15 @@ static void station_roam_scan_triggered(int err, void *user_data)
/*
* Do not update the Scanning property as we won't be updating the
- * list of networks.
+ * list of networks. But if in developer mode update the RoamScanning
+ * property for autotesting.
*/
+ station->roam_scanning = true;
+
+ if (iwd_is_developer_mode())
+ l_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(station->netdev),
+ IWD_STATION_DEBUG_INTERFACE, "RoamScanning");
}
static bool station_roam_scan_notify(int err, struct l_queue *bss_list,
@@ -1968,6 +1976,12 @@ static void station_roam_scan_destroy(void *userdata)
struct station *station = userdata;
station->roam_scan_id = 0;
+ station->roam_scanning = false;
+
+ if (iwd_is_developer_mode())
+ l_dbus_property_changed(dbus_get_bus(),
+ netdev_get_path(station->netdev),
+ IWD_STATION_DEBUG_INTERFACE, "RoamScanning");
}
static int station_roam_scan(struct station *station,
@@ -3978,6 +3992,22 @@ static struct l_dbus_message *station_property_set_autoconnect(
return l_dbus_message_new_method_return(message);
}
+static bool station_property_get_roam_scanning(struct l_dbus *dbus,
+ struct l_dbus_message *message,
+ struct l_dbus_message_builder *builder,
+ void *user_data)
+{
+ struct station *station = user_data;
+ bool scanning;
+
+ scanning = station->roam_scanning;
+
+ l_dbus_message_builder_append_basic(builder, 'b', &scanning);
+
+ return true;
+}
+
+
static void station_setup_debug_interface(
struct l_dbus_interface *interface)
{
@@ -3994,6 +4024,9 @@ static void station_setup_debug_interface(
l_dbus_interface_property(interface, "AutoConnect", 0, "b",
station_property_get_autoconnect,
station_property_set_autoconnect);
+ l_dbus_interface_property(interface, "RoamScanning", 0, "b",
+ station_property_get_roam_scanning,
+ NULL);
}
static void ap_roam_frame_event(const struct mmpdu_header *hdr,
--
2.31.1
Show replies by date
---
autotests/util/iwd.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index cee1b99d..18840cd6 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -242,6 +242,10 @@ class StationDebug(IWDDBusAbstract):
def autoconnect(self):
return self._properties['AutoConnect']
+ @property
+ def roam_scanning(self):
+ return self._properties['RoamScanning']
+
def scan(self, frequencies):
frequencies = dbus.Array([dbus.UInt16(f) for f in frequencies])
self._iface.Scan(frequencies)
@@ -389,6 +393,13 @@ class Device(IWDDBusAbstract):
self._station_debug._prop_proxy.Set(IWD_STATION_DEBUG_INTERFACE,
'AutoConnect', value)
+ @property
+ def roam_scanning(self):
+ if not self._station_debug:
+ self._station_debug = StationDebug(self._object_path)
+
+ return self._station_debug.roam_scanning
+
def scan(self):
'''Schedule a network scan.
--
2.31.1
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 RoamScanning is a property so that can be used to
avoid sleeping. 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.
---
autotests/testRoamRetry/fast_retry_test.py | 15 ++++++++++++---
autotests/testRoamRetry/main.conf | 2 ++
autotests/testRoamRetry/stop_retry_test.py | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
create mode 100644 autotests/testRoamRetry/main.conf
diff --git a/autotests/testRoamRetry/fast_retry_test.py
b/autotests/testRoamRetry/fast_retry_test.py
index d6324c31..fccd42bb 100644
--- a/autotests/testRoamRetry/fast_retry_test.py
+++ b/autotests/testRoamRetry/fast_retry_test.py
@@ -82,7 +82,11 @@ class Test(unittest.TestCase):
# schedule another attempt for 60 seconds later
rule0.signal = -8000
- wd.wait(20)
+ condition = 'obj.roam_scanning == True'
+ wd.wait_for_object_condition(device, condition)
+
+ condition = 'obj.roam_scanning == False'
+ wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(bss_hostapd[0].list_sta())
@@ -99,11 +103,16 @@ class Test(unittest.TestCase):
wd.wait(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
- # not be necessary.
+ # in less than 10 seconds.
rule0.signal = -8000
rule1.signal = -2000
+ condition = 'obj.roam_scanning == True'
+ wd.wait_for_object_condition(device, condition)
+
+ condition = 'obj.roam_scanning == False'
+ wd.wait_for_object_condition(device, condition)
+
condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, max_wait=10)
diff --git a/autotests/testRoamRetry/main.conf b/autotests/testRoamRetry/main.conf
new file mode 100644
index 00000000..f0d1c0f4
--- /dev/null
+++ b/autotests/testRoamRetry/main.conf
@@ -0,0 +1,2 @@
+[General]
+RoamRetryInterval=5
diff --git a/autotests/testRoamRetry/stop_retry_test.py
b/autotests/testRoamRetry/stop_retry_test.py
index be9776a5..3bf166d8 100644
--- a/autotests/testRoamRetry/stop_retry_test.py
+++ b/autotests/testRoamRetry/stop_retry_test.py
@@ -99,7 +99,7 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.roaming'
self.assertRaises(TimeoutError, wd.wait_for_object_condition, device,
- condition, max_wait=70)
+ condition, max_wait=10)
device.disconnect()
--
2.31.1