[PATCH 06/14] tests: GO negotiation with BSS on a disallowed channel

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


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

Verify that when P2P group is formed and a BSS is on a disallowed
channel, the group is formed on a different channel than the BSS (both
as GO and client).

Requires MCC.

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

diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index f8002e7..ceb815d 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -254,3 +254,39 @@ def test_autogo_with_bss_on_disallowed_chan(dev, apdev):
         test_connectivity(dev[0].ifname, apdev[0]['ifname'])
     finally:
         dev[0].request("P2P_SET disallow_freq ")
+
+def test_go_neg_with_bss_on_disallowed_chan(dev, apdev):
+    """P2P channel selection: GO negotiation with BSS on a disallowed channel"""
+
+    dev[0].request("SET p2p_no_group_iface 0")
+
+    if dev[0].get_mcc() < 2:
+       logger.info("Skipping test because driver does not support MCC")
+       return "skip"
+    try:
+        hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz', "channel": '1' })
+        dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
+        dev[0].request("P2P_SET disallow_freq 2412")
+
+	#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'] == "2412":
+           raise Exception("Group formed on a disallowed channel")
+        test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+        dev[0].remove_group(i_res['ifname'])
+
+        #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'] == "2412":
+           raise Exception("Group formed on a disallowed channel")
+        test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+    finally:
+        dev[0].request("P2P_SET disallow_freq ")
-- 
1.7.10.4




More information about the Hostap mailing list