From a68a749322482e003910abd8ee690836e50553fa Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 20 May 2016 23:37:51 +0300 Subject: [PATCH] tests: P2P group formation using P2PS method without specifying PIN Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2ps.py | 13 +++++++++++++ tests/hwsim/wpasupplicant.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_p2ps.py b/tests/hwsim/test_p2ps.py index ad2382ce1..e71b6a53c 100644 --- a/tests/hwsim/test_p2ps.py +++ b/tests/hwsim/test_p2ps.py @@ -1531,3 +1531,16 @@ def run_p2ps_connect_p2p_device2(dev, no_group_iface): if ev0 is None: raise Exception("Unable to remove the advertisement instance") remove_group(wpas, dev[0]) + +def test_p2ps_connect_p2ps_method_no_pin(dev): + """P2P group formation using P2PS method without specifying PIN""" + dev[0].p2p_listen() + dev[1].p2p_go_neg_auth(dev[0].p2p_dev_addr(), None, "p2ps", go_intent=15) + dev[1].p2p_listen() + i_res = dev[0].p2p_go_neg_init(dev[1].p2p_dev_addr(), None, "p2ps", + timeout=20, go_intent=0) + r_res = dev[1].p2p_go_neg_auth_result() + logger.debug("i_res: " + str(i_res)) + logger.debug("r_res: " + str(r_res)) + check_grpform_results(i_res, r_res) + remove_group(dev[0], dev[1]) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index f26124d24..77c84f8b6 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -669,7 +669,7 @@ class WpaSupplicant: cmd = "P2P_CONNECT " + peer + " " + pin + " " + method else: cmd = "P2P_CONNECT " + peer + " " + method - if go_intent: + if go_intent is not None: cmd = cmd + ' go_intent=' + str(go_intent) if freq: cmd = cmd + ' freq=' + str(freq)