[PATCH 04/14] tests: GO negotiation with BSS connected

Ilan Peer ilan.peer
Tue Jun 10 10:50:32 PDT 2014


From: Avraham Stern <avraham.stern at intel.com>

Verify that when BSS is connected and GO negotiation is initiated,
the P2P group is formed on the same channel as the BSS.

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 tests/hwsim/test_p2p_channel.py |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index 731025f..0a6f0c1 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -14,6 +14,7 @@ import hostapd
 from test_p2p_grpform import go_neg_pin_authorized
 from test_p2p_grpform import check_grpform_results
 from test_p2p_grpform import remove_group
+from test_p2p_grpform import go_neg_pbc
 from test_p2p_autogo import autogo
 from hwsim_utils import test_connectivity
 
@@ -202,3 +203,34 @@ def test_autogo_following_bss(dev, apdev):
 			break
 		test_connectivity(dev[0].ifname, apdev[0]['ifname'])
 		dev[0].remove_group(res_go['ifname'])
+
+def test_go_neg_with_bss_connected(dev, apdev):
+    """P2P channel selection: GO negotiation when BSS is connected"""
+
+    dev[0].request("SET p2p_no_group_iface 0")
+
+    hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz', "channel": '5' })
+    dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2432")
+    #dev[0] as GO
+    [i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=10, r_dev=dev[1],
+		    r_intent=1)
+    check_grpform_results(i_res, r_res)
+    if i_res['role'] != "GO":
+       raise Exception("GO not selected according to go_intent")
+    if i_res['freq'] != "2432":
+       raise Exception("Group formed on a different frequency than BSS")
+    test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+    dev[0].remove_group(i_res['ifname'])
+
+    if dev[0].get_mcc() > 1:
+	    return;
+
+    #dev[0] as client
+    [i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=1, r_dev=dev[1],
+		    r_intent=10)
+    check_grpform_results(i_res2, r_res2)
+    if i_res2['role'] != "client":
+       raise Exception("GO not selected according to go_intent")
+    if i_res2['freq'] != "2432":
+       raise Exception("Group formed on a different frequency than BSS")
+    test_connectivity(dev[0].ifname, apdev[0]['ifname'])
-- 
1.7.10.4




More information about the Hostap mailing list