diff mbox

[04/24] tests: Use Global and Group control interfaces in test_p2p_autogo

Message ID 1423042236-25252-5-git-send-email-ilan.peer@intel.com
State Changes Requested
Headers show

Commit Message

Ilan Peer Feb. 4, 2015, 9:30 a.m. UTC
1. In test_autogo_m2d(), in case that group interface
   is not the same as the main interface, need to use
   the group interface to listen for WPS-M2D event.
2. Similarly, in test_autogo_pbc(), use the global control
   interface to get the WPS-M2D event.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 tests/hwsim/test_p2p_autogo.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jouni Malinen Feb. 5, 2015, 11:39 a.m. UTC | #1
On Wed, Feb 04, 2015 at 04:30:16AM -0500, Ilan Peer wrote:
> 1. In test_autogo_m2d(), in case that group interface
>    is not the same as the main interface, need to use
>    the group interface to listen for WPS-M2D event.
> 2. Similarly, in test_autogo_pbc(), use the global control
>    interface to get the WPS-M2D event.

This sounds quite conflicting..

> diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py
> @@ -183,10 +183,10 @@ def test_autogo_m2d(dev):
> -    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=10)
> +    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
>      if ev is None:
>          raise Exception("No global M2D event (2)")
> -    ev = dev[2].wait_event(["WPS-M2D"], timeout=10)
> +    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
>      if ev is None:
>          raise Exception("No M2D event on group interface (2)")

Based on those error messages, this was clearly trying to verify that
WPS-M2D event is delivered through two different control interfaces.
Changing that to require that two copies of that event are delivered on
the group event sounds incorrect. Changing the second one to use
wait_group_event sounds fine, but the first one should likely remain as
wait_global_event.

> @@ -235,7 +235,7 @@ def test_autogo_pbc(dev):
>          raise Exception("WPS_PBC failed")
>      dev[2].p2p_connect_group(dev[0].p2p_dev_addr(), "pbc", timeout=0,
>                               social=True)
> -    ev = dev[2].wait_event(["WPS-M2D"], timeout=15)
> +    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=15)
>      if ev is None:
>          raise Exception("WPS-M2D not reported")

I guess this is fine since WPS-M2D gets sent both to the group and
global control interface.
Ilan Peer Feb. 6, 2015, 7:18 a.m. UTC | #2
I'll drop this one for now. Need to better understand the use case. Will try to get to it next week.

Ilan.

> -----Original Message-----
> From: hostap-bounces@lists.shmoo.com [mailto:hostap-
> bounces@lists.shmoo.com] On Behalf Of Jouni Malinen
> Sent: Thursday, February 05, 2015 13:39
> To: hostap@lists.shmoo.com
> Subject: Re: [PATCH 04/24] tests: Use Global and Group control interfaces in
> test_p2p_autogo
> 
> On Wed, Feb 04, 2015 at 04:30:16AM -0500, Ilan Peer wrote:
> > 1. In test_autogo_m2d(), in case that group interface
> >    is not the same as the main interface, need to use
> >    the group interface to listen for WPS-M2D event.
> > 2. Similarly, in test_autogo_pbc(), use the global control
> >    interface to get the WPS-M2D event.
> 
> This sounds quite conflicting..
> 
> > diff --git a/tests/hwsim/test_p2p_autogo.py
> > b/tests/hwsim/test_p2p_autogo.py @@ -183,10 +183,10 @@ def
> test_autogo_m2d(dev):
> > -    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=10)
> > +    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
> >      if ev is None:
> >          raise Exception("No global M2D event (2)")
> > -    ev = dev[2].wait_event(["WPS-M2D"], timeout=10)
> > +    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
> >      if ev is None:
> >          raise Exception("No M2D event on group interface (2)")
> 
> Based on those error messages, this was clearly trying to verify that WPS-
> M2D event is delivered through two different control interfaces.
> Changing that to require that two copies of that event are delivered on the
> group event sounds incorrect. Changing the second one to use
> wait_group_event sounds fine, but the first one should likely remain as
> wait_global_event.
> 
> > @@ -235,7 +235,7 @@ def test_autogo_pbc(dev):
> >          raise Exception("WPS_PBC failed")
> >      dev[2].p2p_connect_group(dev[0].p2p_dev_addr(), "pbc", timeout=0,
> >                               social=True)
> > -    ev = dev[2].wait_event(["WPS-M2D"], timeout=15)
> > +    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=15)
> >      if ev is None:
> >          raise Exception("WPS-M2D not reported")
> 
> I guess this is fine since WPS-M2D gets sent both to the group and global
> control interface.
> 
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
diff mbox

Patch

diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py
index a6d9511..9e78f05 100644
--- a/tests/hwsim/test_p2p_autogo.py
+++ b/tests/hwsim/test_p2p_autogo.py
@@ -153,7 +153,7 @@  def test_autogo_m2d(dev):
     autogo(dev[0], freq=2412)
     go_addr = dev[0].p2p_dev_addr()
 
-    dev[1].request("SET p2p_no_group_iface 0")
+    dev[1].global_request("SET p2p_no_group_iface 0")
     if not dev[1].discover_peer(go_addr, social=True):
         raise Exception("GO " + go_addr + " not found")
     dev[1].dump_monitor()
@@ -183,10 +183,10 @@  def test_autogo_m2d(dev):
     if ev is None:
         raise Exception("No M2D event on group interface")
 
-    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=10)
+    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
     if ev is None:
         raise Exception("No global M2D event (2)")
-    ev = dev[2].wait_event(["WPS-M2D"], timeout=10)
+    ev = dev[2].wait_group_event(["WPS-M2D"], timeout=10)
     if ev is None:
         raise Exception("No M2D event on group interface (2)")
 
@@ -235,7 +235,7 @@  def test_autogo_pbc(dev):
         raise Exception("WPS_PBC failed")
     dev[2].p2p_connect_group(dev[0].p2p_dev_addr(), "pbc", timeout=0,
                              social=True)
-    ev = dev[2].wait_event(["WPS-M2D"], timeout=15)
+    ev = dev[2].wait_global_event(["WPS-M2D"], timeout=15)
     if ev is None:
         raise Exception("WPS-M2D not reported")
     if "config_error=12" not in ev: