From 87e5dd0af1ec6e00779b977d09922201c1689f25 Mon Sep 17 00:00:00 2001 From: Avraham Stern Date: Tue, 10 Jun 2014 20:50:39 +0300 Subject: [PATCH] tests: GO with preferred channel and station on a disallowed channel Verify that when setting up autonomous GO with configured preferred channel and a station interface is connected on a channel that is disallowed for P2P, the GO is instantiated on the preferred channel. Requires MCC. Signed-off-by: Avraham Stern --- tests/hwsim/test_p2p_channel.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index 3baae3c..eeb9af2 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -360,3 +360,25 @@ def test_go_pref_chan_bss_on_diff_chan(dev, apdev): hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) finally: dev[0].request("SET p2p_pref_chan ") + +def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev): + """P2P channel selection: Station interface on different channel than GO configured pref channel, and station 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") + hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) + finally: + dev[0].request("P2P_SET disallow_freq ") + dev[0].request("SET p2p_pref_chan ") -- 2.1.4