[PATCH 1/1] hwsim tests: adapt p2p_discovery to new notation

Eduardo Abinader eduardo.abinader
Thu Jan 30 06:39:00 PST 2014


This patch removes "magic" ctrl_iface calls from test case,
thus, complying with he new notation.

Signed-hostap: Eduardo Abinader <eduardo.abinader at openbossa.org>
---
 tests/hwsim/test_p2p_discovery.py | 6 +++---
 tests/hwsim/wpasupplicant.py      | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py
index d555e02..1825c38 100644
--- a/tests/hwsim/test_p2p_discovery.py
+++ b/tests/hwsim/test_p2p_discovery.py
@@ -23,7 +23,7 @@ def test_discovery(dev):
         raise Exception("Device discovery timed out")
 
     logger.info("Test provision discovery for display")
-    dev[0].global_request("P2P_PROV_DISC " + addr1 + " display")
+    dev[0].p2p_prov_disc(addr1, "display")
     ev1 = dev[1].wait_global_event(["P2P-PROV-DISC-SHOW-PIN"], timeout=15)
     if ev1 is None:
         raise Exception("Provision discovery timed out (display/dev1)")
@@ -39,7 +39,7 @@ def test_discovery(dev):
         raise Exception("Dev1 not in provision discovery event")
 
     logger.info("Test provision discovery for keypad")
-    dev[0].global_request("P2P_PROV_DISC " + addr1 + " keypad")
+    dev[0].p2p_prov_disc(addr1, "keypad")
     ev1 = dev[1].wait_global_event(["P2P-PROV-DISC-ENTER-PIN"], timeout=15)
     if ev1 is None:
         raise Exception("Provision discovery timed out (keypad/dev1)")
@@ -56,7 +56,7 @@ def test_discovery(dev):
         raise Exception("Dev1 not in provision discovery event")
 
     logger.info("Test provision discovery for push button")
-    dev[0].global_request("P2P_PROV_DISC " + addr1 + " pbc")
+    dev[0].p2p_prov_disc(addr1, "pbc")
     ev1 = dev[1].wait_global_event(["P2P-PROV-DISC-PBC-REQ"], timeout=15)
     if ev1 is None:
         raise Exception("Provision discovery timed out (pbc/dev1)")
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index 3707cbb..3d67861 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -297,6 +297,9 @@ class WpaSupplicant:
     def p2p_stop_find(self):
         return self.global_request("P2P_STOP_FIND")
 
+    def p2p_prov_disc(self, dev_addr, method):
+        return self.global_request("P2P_PROV_DISC " + dev_addr + " " + method)
+
     def wps_read_pin(self):
         #TODO: make this random
         self.pin = "12345670"
-- 
1.8.1.2




More information about the Hostap mailing list