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

Ilan Peer ilan.peer at intel.com
Tue Jun 10 13:50:33 EDT 2014


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

Verify that when setting up an autonomous GO and BSS is on a
disallowed channel, the GO is instantiated on a different channel
than the BSS.

Requires MCC.

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

diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index 0a6f0c1..f8002e7 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -234,3 +234,23 @@ def test_go_neg_with_bss_connected(dev, apdev):
     if i_res2['freq'] != "2432":
        raise Exception("Group formed on a different frequency than BSS")
     test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+
+def test_autogo_with_bss_on_disallowed_chan(dev, apdev):
+    """P2P channel selection: Autonomous GO 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].request("P2P_SET disallow_freq 2412")
+	dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
+	res = autogo(dev[0])
+        if res['freq'] == "2412":
+           raise Exception("GO set 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