[PATCH 09/14] tests: Autonomous GO with preferred channel and BSS on another channel

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


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

Verify that when setting up an autonomous GO with configured preferred
channel and a BSS is on another channel, then the GO is instantiated
on the same channel as the BSS and not on the configured preferred
channel.

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

diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index 52e7a02..d4e68cb 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -344,3 +344,21 @@ def test_go_neg_forced_freq_diff_than_bss_freq(dev, apdev):
     if r_res2['role'] != "client":
        raise Exception("GO not selected according to go_intent")
     test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+
+def test_go_pref_chan_bss_on_diff_chan(dev, apdev):
+    """P2P channel selection: BSS on different channel than GO configured
+    pref channel"""
+
+    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("SET p2p_pref_chan 81:2")
+	dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
+	res = autogo(dev[0])
+        if res['freq'] != "2412":
+           raise Exception("GO channel did not follow BSS")
+        test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+    finally:
+	dev[0].request("SET p2p_pref_chan ")
-- 
1.7.10.4



More information about the HostAP mailing list