[PATCH 09/14] tests: Change gas_max_pending() and gas_no_pending() tests

Ilan Peer ilan.peer
Wed Oct 14 08:43:15 PDT 2015


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

Use the global control interface for RX and TX mgmt handling to
support configurations that use a dedicated P2P Device interface.

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

diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py
index 2fb43ec..42ac9b8 100644
--- a/tests/hwsim/test_gas.py
+++ b/tests/hwsim/test_gas.py
@@ -773,11 +773,11 @@ def test_gas_max_pending(dev, apdev):
 
     wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
     wpas.interface_add("wlan5")
-    if "OK" not in wpas.request("P2P_SET listen_channel 1"):
+    if "OK" not in wpas.global_request("P2P_SET listen_channel 1"):
         raise Exception("Failed to set listen channel")
     if "OK" not in wpas.p2p_listen():
         raise Exception("Failed to start listen state")
-    if "FAIL" in wpas.request("SET ext_mgmt_frame_handling 1"):
+    if "FAIL" in wpas.global_request("SET ext_mgmt_frame_handling 1"):
         raise Exception("Failed to enable external management frame handling")
 
     anqp_query = struct.pack('<HHHHHHHHHH', 256, 16, 257, 258, 260, 261, 262, 263, 264, 268)
@@ -787,9 +787,9 @@ def test_gas_max_pending(dev, apdev):
         msg = struct.pack('<BBB', ACTION_CATEG_PUBLIC, GAS_INITIAL_REQUEST,
                           dialog_token) + anqp_adv_proto() + gas
         req = "MGMT_TX {} {} freq=2412 wait_time=10 action={}".format(bssid, bssid, binascii.hexlify(msg))
-        if "OK" not in wpas.request(req):
+        if "OK" not in wpas.global_request(req):
             raise Exception("Could not send management frame")
-        resp = wpas.mgmt_rx()
+        resp = wpas.mgmt_rx_global()
         if resp is None:
             raise Exception("MGMT-RX timeout")
         if 'payload' not in resp:
@@ -810,18 +810,18 @@ def test_gas_no_pending(dev, apdev):
 
     wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
     wpas.interface_add("wlan5")
-    if "OK" not in wpas.request("P2P_SET listen_channel 1"):
+    if "OK" not in wpas.global_request("P2P_SET listen_channel 1"):
         raise Exception("Failed to set listen channel")
     if "OK" not in wpas.p2p_listen():
         raise Exception("Failed to start listen state")
-    if "FAIL" in wpas.request("SET ext_mgmt_frame_handling 1"):
+    if "FAIL" in wpas.global_request("SET ext_mgmt_frame_handling 1"):
         raise Exception("Failed to enable external management frame handling")
 
     msg = struct.pack('<BBB', ACTION_CATEG_PUBLIC, GAS_COMEBACK_REQUEST, 1)
     req = "MGMT_TX {} {} freq=2412 wait_time=10 action={}".format(bssid, bssid, binascii.hexlify(msg))
-    if "OK" not in wpas.request(req):
+    if "OK" not in wpas.global_request(req):
         raise Exception("Could not send management frame")
-    resp = wpas.mgmt_rx()
+    resp = wpas.mgmt_rx_global()
     if resp is None:
         raise Exception("MGMT-RX timeout")
     if 'payload' not in resp:
-- 
1.9.1




More information about the Hostap mailing list