tests: P2P group formation using parameters from persistent group

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-04-15 01:06:39 +03:00
parent d7fb9e4819
commit bdc4476476
2 changed files with 24 additions and 1 deletions

View file

@ -377,3 +377,24 @@ def test_persistent_go_client_list(dev):
peer = dev[0].get_peer(addr2) peer = dev[0].get_peer(addr2)
if 'persistent' not in peer or peer['persistent'] != id: if 'persistent' not in peer or peer['persistent'] != id:
raise Exception("Persistent group client not recognized(2)") raise Exception("Persistent group client not recognized(2)")
def test_persistent_group_in_grpform(dev):
"""P2P persistent group parameters re-used in group formation"""
addr0 = dev[0].p2p_dev_addr()
addr1 = dev[1].p2p_dev_addr()
form(dev[0], dev[1])
dev[1].p2p_listen()
if not dev[0].discover_peer(addr1, social=True):
raise Exception("Could not discover peer")
peer = dev[0].get_peer(addr1)
if "persistent" not in peer:
raise Exception("Could not map peer to a persistent group")
pin = dev[1].wps_read_pin()
dev[1].p2p_go_neg_auth(addr0, pin, "display", go_intent=0)
i_res = dev[0].p2p_go_neg_init(addr1, pin, "enter", timeout=20,
go_intent=15,
persistent_id=peer['persistent'])
r_res = dev[1].p2p_go_neg_auth_result()
logger.debug("i_res: " + str(i_res))
logger.debug("r_res: " + str(r_res))

View file

@ -476,7 +476,7 @@ class WpaSupplicant:
self.dump_monitor() self.dump_monitor()
return self.group_form_result(ev, expect_failure, go_neg_res) return self.group_form_result(ev, expect_failure, go_neg_res)
def p2p_go_neg_init(self, peer, pin, method, timeout=0, go_intent=None, expect_failure=False, persistent=False, freq=None, provdisc=False): def p2p_go_neg_init(self, peer, pin, method, timeout=0, go_intent=None, expect_failure=False, persistent=False, persistent_id=None, freq=None, provdisc=False):
if not self.discover_peer(peer): if not self.discover_peer(peer):
raise Exception("Peer " + peer + " not found") raise Exception("Peer " + peer + " not found")
self.dump_monitor() self.dump_monitor()
@ -490,6 +490,8 @@ class WpaSupplicant:
cmd = cmd + ' freq=' + str(freq) cmd = cmd + ' freq=' + str(freq)
if persistent: if persistent:
cmd = cmd + " persistent" cmd = cmd + " persistent"
elif persistent_id:
cmd = cmd + " persistent=" + persistent_id
if provdisc: if provdisc:
cmd = cmd + " provdisc" cmd = cmd + " provdisc"
if "OK" in self.global_request(cmd): if "OK" in self.global_request(cmd):