]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P PD retries and timeout
authorJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 20:22:29 +0000 (22:22 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 20:23:52 +0000 (22:23 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_discovery.py

index a63768bbdee655da322252ce8fdba1594fe79657..e373172cc043a316acbbddf6785256ff8cc38325 100644 (file)
@@ -73,6 +73,20 @@ def test_discovery(dev):
     dev[0].p2p_stop_find
     dev[1].p2p_stop_find
 
+def test_discovery_pd_retries(dev):
+    """P2P device discovery and provision discovery retries"""
+    addr0 = dev[0].p2p_dev_addr()
+    addr1 = dev[1].p2p_dev_addr()
+    dev[1].p2p_listen()
+    if not dev[0].discover_peer(addr1):
+        raise Exception("Device discovery timed out")
+    dev[1].p2p_stop_find()
+    dev[0].p2p_stop_find()
+    dev[0].global_request("P2P_PROV_DISC " + addr1 + " display")
+    ev = dev[0].wait_event(["P2P-PROV-DISC-FAILURE"], timeout=60)
+    if ev is None:
+        raise Exception("No PD failure reported")
+
 def test_discovery_group_client(dev):
     """P2P device discovery for a client in a group"""
     logger.info("Start autonomous GO " + dev[0].ifname)