[PATCH 11/14] tests: GO with preferred channel and BSS on a disallowed channel

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


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

Verify that when setting up autonomous GO with configured preferred
channel and a BSS is on a disallowed channel, the GO is instantiated
on the preferred channel.

Requires MCC.

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

diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index 9047731..1d18382 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -376,3 +376,26 @@ def test_p2p_autogo_pref_chan_disallowed(dev, apdev):
     finally:
        dev[0].request("P2P_SET disallow_freq ")
        dev[0].request("SET p2p_pref_chan ")
+
+def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev):
+    """P2P channel selection: BSS on different channel than GO configured
+    pref channel, and BSS channel is disallowed"""
+    if dev[0].get_mcc() < 2:
+       logger.info("Skipping test because driver does not support MCC")
+       return "skip"
+
+    dev[0].request("SET p2p_no_group_iface 0")
+
+    try:
+        hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz',
+		"channel": '1' })
+        dev[0].request("P2P_SET disallow_freq 2412")
+	dev[0].request("SET p2p_pref_chan 81:2")
+	dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
+	res2 = autogo(dev[0])
+        if res2['freq'] != "2417":
+           raise Exception("GO channel did not follow pref_chan configuration")
+        test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+    finally:
+        dev[0].request("P2P_SET disallow_freq ")
+	dev[0].request("SET p2p_pref_chan ")
-- 
1.7.10.4




More information about the Hostap mailing list