]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P GO channel preference and regulatory rule mismatch
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 26 Aug 2014 14:57:26 +0000 (17:57 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 26 Aug 2014 14:57:26 +0000 (17:57 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_p2p_autogo.py
tests/hwsim/test_p2p_channel.py

index af34d6507886132e83ec7522806ec62ec4dbfe7b..10a1d2ea0fc08ed40a6649c413811de7f78a74a9 100644 (file)
@@ -14,9 +14,9 @@ import utils
 from wlantest import Wlantest
 from wpasupplicant import WpaSupplicant
 
-def autogo(go, freq=None):
+def autogo(go, freq=None, persistent=None):
     logger.info("Start autonomous GO " + go.ifname)
-    res = go.p2p_start_go(freq=freq)
+    res = go.p2p_start_go(freq=freq, persistent=persistent)
     logger.debug("res: " + str(res))
     return res
 
index 608b26533b2a504a3720d476955a9ebbcdd69190..ca5c03f72e4873a645f1274d17a3378f13e99231 100644 (file)
@@ -447,3 +447,27 @@ 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_p2p_autogo_pref_chan_not_in_regulatory(dev, apdev):
+    """P2P channel selection: GO preferred channel not allowed in the regulatory rules"""
+    try:
+        set_country("US")
+        dev[0].request("SET p2p_pref_chan 124:149")
+        res = autogo(dev[0], persistent=True)
+        if res['freq'] != "5745":
+            raise Exception("Unexpected channel selected: " + res['freq'])
+        dev[0].remove_group(res['ifname'])
+
+        netw = dev[0].list_networks()
+        if len(netw) != 1:
+            raise Exception("Unexpected number of network blocks: " + str(netw))
+        id = netw[0]['id']
+
+        set_country("DE")
+        res = autogo(dev[0], persistent=id)
+        if res['freq'] == "5745":
+            raise Exception("Unexpected channel selected(2): " + res['freq'])
+        dev[0].remove_group(res['ifname'])
+    finally:
+        dev[0].request("SET p2p_pref_chan ")
+        set_country("00")