]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: hostapd as P2P Device manager
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 10 Mar 2014 08:58:01 +0000 (10:58 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 10 Mar 2014 08:58:01 +0000 (10:58 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_hapd_ctrl.py

index b82c03725bb8804f92afc216985ffb5084db0b8b..0bb98236f7244c7abf1fc54d6dd230709cc81d5b 100644 (file)
@@ -28,3 +28,19 @@ def test_hapd_ctrl_status(dev, apdev):
         raise Exception("Unexpected beacon_set")
     if driver['addr'] != bssid:
         raise Exception("Unexpected addr")
+
+def test_hapd_ctrl_p2p_manager(dev, apdev):
+    """hostapd as P2P Device manager"""
+    ssid = "hapd-p2p-mgr"
+    passphrase = "12345678"
+    params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+    params['manage_p2p'] = '1'
+    params['allow_cross_connection'] = '0'
+    hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+    dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
+    addr = dev[0].p2p_dev_addr()
+    if "OK" not in hapd.request("DEAUTHENTICATE " + addr + " p2p=2"):
+        raise Exception("DEAUTHENTICATE command failed")
+    ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
+    if ev is None:
+        raise Exception("Disconnection event timed out")