[PATCH 03/14] tests: Autonomous GO channel selection following BSS
Ilan Peer
ilan.peer
Tue Jun 10 10:50:31 PDT 2014
From: Haim Dreyfuss <haim.dreyfuss at intel.com>
This test verifies that if a GO is instantiated after a connection of a
station interface, the chosen operating channel is that of the station
interface.
Signed-off-by: Haim Dreyfuss <haim.dreyfuss at intel.com>
---
tests/hwsim/test_p2p_channel.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py
index 49bae4f..731025f 100644
--- a/tests/hwsim/test_p2p_channel.py
+++ b/tests/hwsim/test_p2p_channel.py
@@ -9,10 +9,13 @@ logger = logging.getLogger()
import os
import subprocess
import time
+import hostapd
from test_p2p_grpform import go_neg_pin_authorized
from test_p2p_grpform import check_grpform_results
from test_p2p_grpform import remove_group
+from test_p2p_autogo import autogo
+from hwsim_utils import test_connectivity
def set_country(country):
subprocess.call(['sudo', 'iw', 'reg', 'set', country])
@@ -178,3 +181,24 @@ def test_p2p_channel_avoid(dev):
finally:
set_country("00")
dev[0].request("DRIVER_EVENT AVOID_FREQUENCIES")
+
+def test_autogo_following_bss(dev, apdev):
+ """P2P autonomous GO operate on the same channel as bss"""
+ if dev[0].get_mcc() > 1:
+ print "test mode: MCC"
+
+ dev[0].request("SET p2p_no_group_iface 0")
+
+ channels = {3 : "2422", 5 : "2432", 9 : "2452"}
+ for key in channels:
+ hostapd.add_ap(apdev[0]['ifname'], { "ssid" : 'ap-test',
+ "channel" : str(key)})
+ dev[0].connect("ap-test",
+ key_mgmt="NONE",scan_freq=str(channels[key]))
+ res_go = autogo(dev[0])
+ if res_go['freq'] != channels[key]:
+ raise Exception("Group operation channel is not the same "
+ "as bss")
+ break
+ test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+ dev[0].remove_group(res_go['ifname'])
--
1.7.10.4
More information about the Hostap
mailing list