Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap
@ 2020-10-23 22:18 James Prestwood
  2020-10-23 22:19 ` [PATCH 2/2] auto-t: only return expected number from list_devices James Prestwood
  2020-10-26 18:11 ` [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood
  0 siblings, 2 replies; 4+ messages in thread
From: James Prestwood @ 2020-10-23 22:18 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

---
 autotests/util/iwd.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index 9bfc8c1a..c65dd4a2 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -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
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] auto-t: only return expected number from list_devices
  2020-10-23 22:18 [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood
@ 2020-10-23 22:19 ` James Prestwood
  2020-10-26 19:27   ` Denis Kenzior
  2020-10-26 18:11 ` [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood
  1 sibling, 1 reply; 4+ messages in thread
From: James Prestwood @ 2020-10-23 22:19 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

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(-)

diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index c65dd4a2..b557c17f 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -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)
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap
  2020-10-23 22:18 [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood
  2020-10-23 22:19 ` [PATCH 2/2] auto-t: only return expected number from list_devices James Prestwood
@ 2020-10-26 18:11 ` James Prestwood
  1 sibling, 0 replies; 4+ messages in thread
From: James Prestwood @ 2020-10-26 18:11 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

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.

On Fri, 2020-10-23 at 15:18 -0700, James Prestwood wrote:
> ---
>  autotests/util/iwd.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
> index 9bfc8c1a..c65dd4a2 100755
> --- a/autotests/util/iwd.py
> +++ b/autotests/util/iwd.py
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] auto-t: only return expected number from list_devices
  2020-10-23 22:19 ` [PATCH 2/2] auto-t: only return expected number from list_devices James Prestwood
@ 2020-10-26 19:27   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2020-10-26 19:27 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

Hi James,

On 10/23/20 5:19 PM, James Prestwood wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-26 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-23 22:18 [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood
2020-10-23 22:19 ` [PATCH 2/2] auto-t: only return expected number from list_devices James Prestwood
2020-10-26 19:27   ` Denis Kenzior
2020-10-26 18:11 ` [PATCH 1/2] auto-t: wait for mode change to finish on stop_ap James Prestwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox