tests: Frequency set as no GO
authorAvraham Stern <avraham.stern@intel.com>
Tue, 10 Jun 2014 17:50:40 +0000 (20:50 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 14 Jun 2014 20:12:33 +0000 (23:12 +0300)
Verify that when setting frequency as no_go_freq and setting up
autonomous GO, the GO is instantiated on a different frequency, but
when forming a P2P group and becoming a client this frequency can be
used.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
tests/hwsim/test_p2p_channel.py

index eeb9af2..3092294 100644 (file)
@@ -382,3 +382,30 @@ def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev):
     finally:
         dev[0].request("P2P_SET disallow_freq ")
         dev[0].request("SET p2p_pref_chan ")
+
+def test_no_go_freq(dev, apdev):
+    """P2P channel selection: no GO freq"""
+    try:
+       dev[0].request("SET p2p_no_go_freq 2412")
+       # dev[0] as client, channel 1 is ok
+       [i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=1,
+                                   r_dev=dev[1], r_intent=14, r_freq=2412)
+       check_grpform_results(i_res, r_res)
+       if i_res['freq'] != "2412":
+          raise Exception("P2P group not formed on forced freq")
+
+       dev[1].remove_group(r_res['ifname'])
+       fail = False
+       # dev[0] as GO, channel 1 is not allowed
+       try:
+          dev[0].request("SET p2p_no_go_freq 2412")
+          [i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=14,
+                                        r_dev=dev[1], r_intent=1, r_freq=2412)
+          check_grpform_results(i_res2, r_res2)
+          fail = True
+       except:
+           pass
+       if fail:
+           raise Exception("GO set on a disallowed freq")
+    finally:
+       dev[0].request("SET p2p_no_go_freq ")