diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index 6e8758d45..8afa19a35 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -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() diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 4f1f17653..9565b9d4f 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -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):