tests: p2p_find with progressive scan

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-04-12 20:03:24 +03:00
parent 24e330f7e2
commit 5070b14a51
2 changed files with 26 additions and 1 deletions

View file

@ -209,3 +209,26 @@ def test_discovery_dev_id_go(dev):
ev = dev[2].wait_event(['P2P-DEVICE-FOUND ' + addr1], timeout=2)
if ev is None:
raise Exception("P2P device not found")
def test_discovery_social_plus_one(dev):
"""P2P device discovery with social-plus-one"""
logger.info("Start autonomous GO " + dev[0].ifname)
dev[2].p2p_start_go(freq="2422")
go = dev[2].p2p_dev_addr()
dev[1].p2p_find(social=True)
dev[0].p2p_find(progressive=True)
ev = dev[0].wait_event(["P2P-DEVICE-FOUND"])
if ev is None:
raise Exception("Peer not found")
ev = dev[0].wait_event(["P2P-DEVICE-FOUND"])
if ev is None:
raise Exception("Peer not found")
ev = dev[1].wait_event(["P2P-DEVICE-FOUND"])
if ev is None:
raise Exception("Peer not found")
dev[0].p2p_stop_find()
dev[1].p2p_stop_find()
if not dev[0].peer_known(go):
raise Exception("GO not found in progressive scan")
if dev[1].peer_known(go):
raise Exception("GO found in social-only scan")

View file

@ -330,10 +330,12 @@ class WpaSupplicant:
def p2p_listen(self):
return self.global_request("P2P_LISTEN")
def p2p_find(self, social=False, dev_id=None, dev_type=None):
def p2p_find(self, social=False, progressive=False, dev_id=None, dev_type=None):
cmd = "P2P_FIND"
if social:
cmd = cmd + " type=social"
elif progressive:
cmd = cmd + " type=progressive"
if dev_id:
cmd = cmd + " dev_id=" + dev_id
if dev_type: