aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-04-07 10:31:57 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-24 20:11:13 (GMT)
commita7efe6c386a885f546e8f5e6e2a66cfb7e1ddd6f (patch)
tree39652bb7ece7ad2dfa5dbac5f11f2c6249e60b93
parent12de787527c6d5bd16e42cbef4351ec7db58ddcc (diff)
downloadhostap-a7efe6c386a885f546e8f5e6e2a66cfb7e1ddd6f.zip
hostap-a7efe6c386a885f546e8f5e6e2a66cfb7e1ddd6f.tar.gz
hostap-a7efe6c386a885f546e8f5e6e2a66cfb7e1ddd6f.tar.bz2
tests: Modify autogo_scan to support P2P Device interface
Support configurations that use a dedicated P2P Device interface by sending the P2P_CONNECT command on the global control interface. In addition, when a dedicated P2P Device interface is used, there is no need to manually respond to the Provision Discovery Request since the request is processed by the P2P Device interface and this interface was not set for external RX management frames handling. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
-rw-r--r--tests/hwsim/test_p2p_autogo.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py
index c883626..b630f24 100644
--- a/tests/hwsim/test_p2p_autogo.py
+++ b/tests/hwsim/test_p2p_autogo.py
@@ -743,7 +743,7 @@ def test_autogo_scan(dev):
# frame with P2P IE.
dev[0].group_request("SET ext_mgmt_frame_handling 1")
- dev[1].request("P2P_CONNECT " + bssid + " " + pin + " freq=2412 join")
+ dev[1].global_request("P2P_CONNECT " + bssid + " " + pin + " freq=2412 join")
# Skip the first Probe Request frame
ev = dev[0].wait_group_event(["MGMT-RX"], timeout=10)
@@ -752,9 +752,15 @@ def test_autogo_scan(dev):
if not ev.split(' ')[4].startswith("40"):
raise Exception("Not a Probe Request frame")
- # Reply to PD Request while still filtering Probe Request frames
- msg = rx_pd_req(dev[0])
- mgmt_tx(dev[0], "MGMT_TX {} {} freq={} wait_time=10 no_cck=1 action={}".format(addr1, addr0, 2412, "0409506f9a0908%02xdd0a0050f204100800020008" % msg['dialog_token']))
+ # If a P2P Device is not used, the PD Request will be received on the group
+ # interface (which is actually wlan0, since a separate interface is not
+ # used), which was set to external management frame handling, so need to
+ # reply to it manually.
+ res = dev[0].get_driver_status()
+ if not (int(res['capa.flags'], 0) & 0x20000000):
+ # Reply to PD Request while still filtering Probe Request frames
+ msg = rx_pd_req(dev[0])
+ mgmt_tx(dev[0], "MGMT_TX {} {} freq={} wait_time=10 no_cck=1 action={}".format(addr1, addr0, 2412, "0409506f9a0908%02xdd0a0050f204100800020008" % msg['dialog_token']))
# Skip Probe Request frames until something else is received
for i in range(10):