All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] auto-t: wpas.py: don't require strict match on wait_for_event
@ 2022-01-04 18:18 James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2022-01-04 18:18 UTC (permalink / raw)
  To: iwd

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

wait_for_event was checking the event string presence in the rx_data
array which meant the event string had to match perfectly to any
received events. This poses problems with events that include additional
information which the caller may not be able to know or does not care
about. For example:

DPP-RX src=02:00:00:00:02:00 freq=2437 type=11

Waiting for this event previously would require the caller know src, freq,
and type. If the caller only wants to wait for DPP-RX, it can now do that.
---
 autotests/util/wpas.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/autotests/util/wpas.py b/autotests/util/wpas.py
index 8fb725f8..5680ec2a 100644
--- a/autotests/util/wpas.py
+++ b/autotests/util/wpas.py
@@ -70,9 +70,10 @@ class Wpas:
         while True:
             context.iteration(may_block=True)
 
-            if event in self._rx_data:
-                GLib.source_remove(timeout)
-                return self._rx_data
+            for e in self._rx_data:
+                if event in e:
+                    GLib.source_remove(timeout)
+                    return self._rx_data
 
             if self._wait_timed_out:
                 raise TimeoutError('waiting for wpas event timed out')
-- 
2.31.1

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

* Re: [PATCH 1/6] auto-t: wpas.py: don't require strict match on wait_for_event
@ 2022-01-04 18:03 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2022-01-04 18:03 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 1/4/22 12:18, James Prestwood wrote:
> wait_for_event was checking the event string presence in the rx_data
> array which meant the event string had to match perfectly to any
> received events. This poses problems with events that include additional
> information which the caller may not be able to know or does not care
> about. For example:
> 
> DPP-RX src=02:00:00:00:02:00 freq=2437 type=11
> 
> Waiting for this event previously would require the caller know src, freq,
> and type. If the caller only wants to wait for DPP-RX, it can now do that.
> ---
>   autotests/util/wpas.py | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 

All applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2022-01-04 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 18:18 [PATCH 1/6] auto-t: wpas.py: don't require strict match on wait_for_event James Prestwood
  -- strict thread matches above, loose matches on Subject: below --
2022-01-04 18:03 Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.