diff mbox

[02/24] tests: Use global control interface in test_wpas_ctrl_global()

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

Commit Message

Peer, Ilan Feb. 4, 2015, 9:30 a.m. UTC
Use the global control interface to set/get the status of the
P2P Device.

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

Comments

Jouni Malinen Feb. 5, 2015, 11:28 a.m. UTC | #1
On Wed, Feb 04, 2015 at 04:30:14AM -0500, Ilan Peer wrote:
> Use the global control interface to set/get the status of the
> P2P Device.

>  tests/hwsim/test_wpas_ctrl.py | 10 +++++-----
> diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py
> @@ -1073,13 +1073,13 @@ def test_wpas_ctrl_global(dev):
> -    wpas.request("P2P_SET disabled 1")
> -    if "p2p_state=DISABLED" not in wpas.global_request("STATUS"):
> +    dev[0].global_request("P2P_SET disabled 1")
> +    if "p2p_state=DISABLED" not in dev[0].global_request("STATUS"):

This looks suspicious. dev[0] is completely different radio compared to
wpas. The temporarily allocated wpas was used here on purpose to avoid
any potential issues due to P2P_SET disabled changes remaining in
effect.
Peer, Ilan Feb. 5, 2015, 2:22 p.m. UTC | #2
> -----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:28
> To: hostap@lists.shmoo.com
> Subject: Re: [PATCH 02/24] tests: Use global control interface in
> test_wpas_ctrl_global()
> 
> On Wed, Feb 04, 2015 at 04:30:14AM -0500, Ilan Peer wrote:
> > Use the global control interface to set/get the status of the P2P
> > Device.
> 
> >  tests/hwsim/test_wpas_ctrl.py | 10 +++++----- diff --git
> > a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py @@
> > -1073,13 +1073,13 @@ def test_wpas_ctrl_global(dev):
> > -    wpas.request("P2P_SET disabled 1")
> > -    if "p2p_state=DISABLED" not in wpas.global_request("STATUS"):
> > +    dev[0].global_request("P2P_SET disabled 1")
> > +    if "p2p_state=DISABLED" not in dev[0].global_request("STATUS"):
> 
> This looks suspicious. dev[0] is completely different radio compared to wpas.
> The temporarily allocated wpas was used here on purpose to avoid any
> potential issues due to P2P_SET disabled changes remaining in effect.
> 

My bad. Will fix.

Thanks,

Ilan.
diff mbox

Patch

diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py
index eb32206..203c9f8 100644
--- a/tests/hwsim/test_wpas_ctrl.py
+++ b/tests/hwsim/test_wpas_ctrl.py
@@ -1073,13 +1073,13 @@  def test_wpas_ctrl_global(dev):
     if "FAIL" not in wpas.global_request("SET foo 1"):
         raise Exception("SET succeeded unexpectedly")
 
-    if "p2p_state=IDLE" not in wpas.global_request("STATUS"):
+    if "p2p_state=IDLE" not in dev[0].global_request("STATUS"):
         raise Exception("P2P was disabled")
-    wpas.request("P2P_SET disabled 1")
-    if "p2p_state=DISABLED" not in wpas.global_request("STATUS"):
+    dev[0].global_request("P2P_SET disabled 1")
+    if "p2p_state=DISABLED" not in dev[0].global_request("STATUS"):
         raise Exception("P2P was not disabled")
-    wpas.request("P2P_SET disabled 0")
-    if "p2p_state=IDLE" not in wpas.global_request("STATUS"):
+    dev[0].global_request("P2P_SET disabled 0")
+    if "p2p_state=IDLE" not in dev[0].global_request("STATUS"):
         raise Exception("P2P was not enabled")
 
     # driver_nl80211.c does not support interface list, so do not fail because