]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Negative test case for P2P group formation with incorrect PIN
authorJouni Malinen <j@w1.fi>
Mon, 6 Jan 2014 15:58:25 +0000 (17:58 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:12 +0000 (10:45 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_p2p_grpform.py

index 48e063c9f631d9ed47fcf675948edf87022f93b4..c673a4c61b69cbd833f41e1754d6cca4583e7ea7 100644 (file)
@@ -405,3 +405,19 @@ def test_grpform_no_5ghz_add_cli4(dev):
     if int(i_res['freq']) > 4000:
         raise Exception("Unexpected channel - did not follow world roaming rules")
     remove_group(dev[0], dev[1])
+
+def test_grpform_incorrect_pin(dev):
+    """P2P GO Negotiation with incorrect PIN"""
+    dev[1].p2p_listen()
+    pin = dev[1].wps_read_pin()
+    addr1 = dev[1].p2p_dev_addr()
+    if not dev[0].discover_peer(addr1):
+        raise Exception("Peer not found")
+    dev[1].p2p_go_neg_auth(dev[0].p2p_dev_addr(), pin, 'display', go_intent=0)
+    dev[0].request("P2P_CONNECT " + addr1 + " 00000000 enter go_intent=15")
+    ev = dev[1].wait_event(["P2P-GROUP-FORMATION-FAILURE"], timeout=10)
+    if ev is None:
+        raise Exception("Group formation failure timed out")
+    ev = dev[0].wait_event(["P2P-GROUP-FORMATION-FAILURE"], timeout=5)
+    if ev is None:
+        raise Exception("Group formation failure timed out")