tests: P2P_FIND with freq parameter to scan a single channel
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
9542f21f3a
commit
6d0b447464
2 changed files with 19 additions and 1 deletions
|
@ -606,3 +606,19 @@ def test_autogo_join_auto_go_neg_after_seeing_go(dev):
|
||||||
dev[0].remove_group()
|
dev[0].remove_group()
|
||||||
dev[1].wait_go_ending_session()
|
dev[1].wait_go_ending_session()
|
||||||
dev[1].flush_scan_cache()
|
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()
|
||||||
|
|
|
@ -387,7 +387,7 @@ class WpaSupplicant:
|
||||||
return self.global_request("P2P_LISTEN")
|
return self.global_request("P2P_LISTEN")
|
||||||
|
|
||||||
def p2p_find(self, social=False, progressive=False, dev_id=None,
|
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"
|
cmd = "P2P_FIND"
|
||||||
if social:
|
if social:
|
||||||
cmd = cmd + " type=social"
|
cmd = cmd + " type=social"
|
||||||
|
@ -399,6 +399,8 @@ class WpaSupplicant:
|
||||||
cmd = cmd + " dev_type=" + dev_type
|
cmd = cmd + " dev_type=" + dev_type
|
||||||
if delay:
|
if delay:
|
||||||
cmd = cmd + " delay=" + str(delay)
|
cmd = cmd + " delay=" + str(delay)
|
||||||
|
if freq:
|
||||||
|
cmd = cmd + " freq=" + str(freq)
|
||||||
return self.global_request(cmd)
|
return self.global_request(cmd)
|
||||||
|
|
||||||
def p2p_stop_find(self):
|
def p2p_stop_find(self):
|
||||||
|
|
Loading…
Reference in a new issue