auto-t: wait for mode change to finish on stop_ap
PATCH 1/2 auto-t: wait for mode change to finish on stop_ap
--- autotests/util/iwd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
autotests/util/iwd.py +4 -1
@@ -481,7 +481,10 @@ class Device(IWDDBusAbstract): self._wait_for_async_op() def stop_ap(self): - self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station') + self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station', + reply_handler=self._success, + error_handler=self._failure) + self._wait_for_async_op() def connect_hidden_network(self, name): '''Connect to a hidden network
Signature · 1 line
2.26.2
PATCH 2/2 auto-t: only return expected number from list_devices
If the caller specifies the number of devices only return that many. Some sub-tests may only need a subset of the total number of devices for the test. If the number of devices expected is less than the total being returned, python would throw an exception.
--- autotests/util/iwd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
autotests/util/iwd.py +1 -1
@@ -1085,7 +1085,7 @@ class IWD(AsyncOpAbstract): if not self._wait_timed_out: GLib.source_remove(timeout) - return list(self._devices.values() if not p2p else self._devices.p2p_dict.values()) + return list(self._devices.values() if not p2p else self._devices.p2p_dict.values())[:wait_to_appear] def list_p2p_devices(self, *args, **kwargs): return self.list_devices(*args, **kwargs, p2p=True)
Signature · 1 line
2.26.2
Denis Kenzior
AppliedRe: [PATCH 2/2] auto-t: only return expected number from list_devices
Hi James,
Quoted 8 lines · James Prestwood
If the caller specifies the number of devices only return that many. Some sub-tests may only need a subset of the total number of devices for the test. If the number of devices expected is less than the total being returned, python would throw an exception.
--- autotests/util/iwd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Regards,
-Denis
You can leave this patch out actually. Andrew pointed out that any DBus method call is synchronous if the reply handlers are left out. But patch 2/2 is still needed.
Quoted 22 lines · James Prestwood
--- autotests/util/iwd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)autotests/util/iwd.py +4
-1@@ -481,7 +481,10 @@ class Device(IWDDBusAbstract): self._wait_for_async_op() def stop_ap(self): - self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station') + self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station', + reply_handler=self._success, + error_handler=self._failure) + self._wait_for_async_op()def
connect_hidden_network(self, name):
'''Connect to a hidden network