aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-01-03 16:24:24 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-03 17:53:03 (GMT)
commit1edc31904a34645602c76e17fb6c9442b5d4e597 (patch)
treee18e2426c040bea27de8a61b19225724117c1549 /tests
parent618073aa2e8a8e80289ee0e3062e3eec9ec9c32e (diff)
downloadhostap-1edc31904a34645602c76e17fb6c9442b5d4e597.zip
hostap-1edc31904a34645602c76e17fb6c9442b5d4e597.tar.gz
hostap-1edc31904a34645602c76e17fb6c9442b5d4e597.tar.bz2
tests: Beacon request - active scan mode and many BSSs
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/bss-4.conf11
-rw-r--r--tests/hwsim/bss-5.conf11
-rw-r--r--tests/hwsim/bss-6.conf11
-rwxr-xr-xtests/hwsim/run-tests.py3
-rw-r--r--tests/hwsim/test_rrm.py51
5 files changed, 87 insertions, 0 deletions
diff --git a/tests/hwsim/bss-4.conf b/tests/hwsim/bss-4.conf
new file mode 100644
index 0000000..4028794
--- /dev/null
+++ b/tests/hwsim/bss-4.conf
@@ -0,0 +1,11 @@
+driver=nl80211
+
+hw_mode=g
+channel=1
+ieee80211n=1
+
+interface=wlan3-4
+bssid=02:00:00:00:03:03
+ctrl_interface=/var/run/hostapd
+
+ssid=bss-4
diff --git a/tests/hwsim/bss-5.conf b/tests/hwsim/bss-5.conf
new file mode 100644
index 0000000..8b88368
--- /dev/null
+++ b/tests/hwsim/bss-5.conf
@@ -0,0 +1,11 @@
+driver=nl80211
+
+hw_mode=g
+channel=1
+ieee80211n=1
+
+interface=wlan3-5
+bssid=02:00:00:00:03:04
+ctrl_interface=/var/run/hostapd
+
+ssid=bss-5
diff --git a/tests/hwsim/bss-6.conf b/tests/hwsim/bss-6.conf
new file mode 100644
index 0000000..66a0d0c
--- /dev/null
+++ b/tests/hwsim/bss-6.conf
@@ -0,0 +1,11 @@
+driver=nl80211
+
+hw_mode=g
+channel=1
+ieee80211n=1
+
+interface=wlan3-6
+bssid=02:00:00:00:03:05
+ctrl_interface=/var/run/hostapd
+
+ssid=bss-6
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index 0ec9d23..6f62dea 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -67,6 +67,9 @@ def reset_devs(dev, apdev):
try:
hapd = HostapdGlobal()
hapd.flush()
+ hapd.remove('wlan3-6')
+ hapd.remove('wlan3-5')
+ hapd.remove('wlan3-4')
hapd.remove('wlan3-3')
hapd.remove('wlan3-2')
for ap in apdev:
diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py
index b9566cc..bf05756 100644
--- a/tests/hwsim/test_rrm.py
+++ b/tests/hwsim/test_rrm.py
@@ -14,6 +14,7 @@ import struct
import subprocess
import hostapd
+from wpasupplicant import WpaSupplicant
from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
from test_ap_ht import clear_scan_cache
@@ -992,6 +993,56 @@ def test_rrm_beacon_req_active(dev, apdev):
if report.opclass != 81 or report.channel != 11:
raise Exception("Incorrect opclass/channel for AP1")
+def start_ap(dev):
+ id = dev.add_network()
+ dev.set_network(id, "mode", "2")
+ dev.set_network_quoted(id, "ssid", 32*'A')
+ dev.set_network_quoted(id, "psk", "1234567890")
+ dev.set_network(id, "frequency", "2412")
+ dev.set_network(id, "scan_freq", "2412")
+ dev.select_network(id)
+ dev.wait_connected()
+
+def test_rrm_beacon_req_active_many(dev, apdev):
+ """Beacon request - active scan mode and many BSSs"""
+ for i in range(1, 7):
+ ifname = apdev[0]['ifname'] if i == 1 else apdev[0]['ifname'] + "-%d" % i
+ hapd1 = hostapd.add_bss(apdev[0], ifname, 'bss-%i.conf' % i)
+ hapd1.set('vendor_elements', "dd50" + 80*'bb')
+ hapd1.request("UPDATE_BEACON")
+
+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas.interface_add("wlan5")
+ wpas.request("SET device_name " + 20*'a')
+ start_ap(wpas)
+ start_ap(dev[1])
+ start_ap(dev[2])
+
+ params = { "ssid": "rrm", "rrm_beacon_report": "1" }
+ params['vendor_elements'] = "dd50" + 80*'aa'
+ hapd = hostapd.add_ap(apdev[1]['ifname'], params)
+
+ dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412")
+ addr = dev[0].own_addr()
+
+ ok = False
+ for j in range(3):
+ token = run_req_beacon(hapd, addr, "51010000640001ffffffffffff")
+
+ for i in range(10):
+ ev = hapd.wait_event(["BEACON-RESP-RX"], timeout=10)
+ if ev is None:
+ raise Exception("Beacon report %d response not received" % i)
+ fields = ev.split(' ')
+ if len(fields[4]) == 0:
+ break
+ report = BeaconReport(binascii.unhexlify(fields[4]))
+ logger.info("Received beacon report: " + str(report))
+ if i == 9:
+ ok = True
+ if ok:
+ break
+
def test_rrm_beacon_req_active_ap_channels(dev, apdev):
"""Beacon request - active scan mode with AP Channel Report subelement"""
params = { "ssid": "rrm", "rrm_beacon_report": "1" }