]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P_FIND with freq parameter to scan a single channel
authorJouni Malinen <j@w1.fi>
Sat, 28 Feb 2015 20:06:24 +0000 (22:06 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Feb 2015 20:06:24 +0000 (22:06 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_autogo.py
tests/hwsim/wpasupplicant.py

index 6e8758d450306bcd8672f3a16179555a4cd75688..8afa19a35e142e07db5312256c6fa54cf932e6fe 100644 (file)
@@ -606,3 +606,19 @@ def test_autogo_join_auto_go_neg_after_seeing_go(dev):
     dev[0].remove_group()
     dev[1].wait_go_ending_session()
     dev[1].flush_scan_cache()
+
+def test_go_search_non_social(dev):
+    """P2P_FIND with freq parameter to scan a single channel"""
+    addr0 = dev[0].p2p_dev_addr()
+    autogo(dev[0], freq=2422)
+    dev[1].p2p_find(freq=2422)
+    ev = dev[1].wait_event(["P2P-DEVICE-FOUND"], timeout=3.5)
+    if ev is None:
+        raise Exception("Did not find GO quickly enough")
+    dev[2].p2p_listen()
+    ev = dev[1].wait_event(["P2P-DEVICE-FOUND"], timeout=5)
+    if ev is None:
+        raise Exception("Did not find peer")
+    dev[2].p2p_stop_find()
+    dev[1].p2p_stop_find()
+    dev[0].remove_group()
index 4f1f1765394fbbdfe64f410bcc99e35b745226ab..9565b9d4f8094f945f0d3b4edb1d2157919c4b74 100644 (file)
@@ -387,7 +387,7 @@ class WpaSupplicant:
         return self.global_request("P2P_LISTEN")
 
     def p2p_find(self, social=False, progressive=False, dev_id=None,
-                 dev_type=None, delay=None):
+                 dev_type=None, delay=None, freq=None):
         cmd = "P2P_FIND"
         if social:
             cmd = cmd + " type=social"
@@ -399,6 +399,8 @@ class WpaSupplicant:
             cmd = cmd + " dev_type=" + dev_type
         if delay:
             cmd = cmd + " delay=" + str(delay)
+        if freq:
+            cmd = cmd + " freq=" + str(freq)
         return self.global_request(cmd)
 
     def p2p_stop_find(self):