[PATCH 06/15] tests: Modify persistent_group_profile_add() to support P2P Device interface

Ilan Peer ilan.peer at intel.com
Thu Apr 7 03:32:00 PDT 2016


From: Avraham Stern <avraham.stern at intel.com>

Modify persistent_group_profile_add() test to support configurations
that use a dedicated P2P Device interface by sending the ADD_NETWORK
and SET_NETWORK commands on the global control interface and
specifying the P2P Device interface name.

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 tests/hwsim/test_p2p_persistent.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/hwsim/test_p2p_persistent.py b/tests/hwsim/test_p2p_persistent.py
index 362e443..6451540 100644
--- a/tests/hwsim/test_p2p_persistent.py
+++ b/tests/hwsim/test_p2p_persistent.py
@@ -541,11 +541,13 @@ def test_persistent_group_missed_inv_resp(dev):
 def test_persistent_group_profile_add(dev):
     """Create a P2P persistent group with ADD_NETWORK"""
     passphrase="passphrase here"
-    id = dev[0].add_network()
-    dev[0].set_network_quoted(id, "ssid", "DIRECT-ab")
-    dev[0].set_network_quoted(id, "psk", passphrase)
-    dev[0].set_network(id, "mode", "3")
-    dev[0].set_network(id, "disabled", "2")
+    id = dev[0].global_request("IFNAME=" + dev[0].p2p_dev_ifname + " ADD_NETWORK")
+    if "FAIL" in id:
+	    raise Exception("ADD_NETWORK failed")
+    dev[0].global_request("IFNAME=" + dev[0].p2p_dev_ifname + " SET_NETWORK " + id + ' ssid "DIRECT-ab"')
+    dev[0].global_request("IFNAME=" + dev[0].p2p_dev_ifname + " SET_NETWORK " + id + ' psk "' + passphrase + '"')
+    dev[0].global_request("IFNAME=" + dev[0].p2p_dev_ifname + " SET_NETWORK " + id + " mode 3")
+    dev[0].global_request("IFNAME=" + dev[0].p2p_dev_ifname + " SET_NETWORK " + id + " disabled 2")
     dev[0].p2p_start_go(persistent=id, freq=2412)
 
     pin = dev[1].wps_read_pin()
-- 
1.9.1




More information about the Hostap mailing list