aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-12-20 19:34:24 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-20 19:44:33 (GMT)
commit432c0972ad6336ab1b759b6c6dca6a66d3841aef (patch)
tree88a91f9f30c1860e766445a9049367ff262dd8a4 /tests
parent8d176ae689f517344d96b6b51d05e643ed4b2626 (diff)
downloadhostap-432c0972ad6336ab1b759b6c6dca6a66d3841aef.zip
hostap-432c0972ad6336ab1b759b6c6dca6a66d3841aef.tar.gz
hostap-432c0972ad6336ab1b759b6c6dca6a66d3841aef.tar.bz2
tests: Connect attempt with transmitting/nontransmitting BSS
This adds some minimal testing for Multi-BSS connection attempts. The part for nontransmitted BSS is limited since hostapd/mac80211 does not yet have sufficient support for Multi-BSS in AP mode. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_scan.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py
index 8dc7c71..1ee9ef2 100644
--- a/tests/hwsim/test_scan.py
+++ b/tests/hwsim/test_scan.py
@@ -1828,3 +1828,50 @@ def test_scan_mbssid_hidden_ssid(dev, apdev):
(bssid[0:16] + '1', '', 0x1),
(bssid[0:16] + '2', '2', 0x2) ]
run_scans(dev[0], check)
+
+def test_connect_mbssid_open_1(dev, apdev):
+ """Connect to transmitting and nontransmitting BSS in open mode"""
+ check_multibss_sta_capa(dev[0])
+ dev[0].flush_scan_cache()
+
+ bssid = apdev[0]['bssid']
+ params = { "ssid": "transmitted" }
+
+ elems = elem_capab(1) + elem_ssid("nontransmitted") + elem_bssid_index(1)
+ profile1 = struct.pack('BB', 0, len(elems)) + elems
+
+ elems = elem_capab(1) + elem_ssid("nontransmitted_2") + elem_bssid_index(2)
+ profile2 = struct.pack('BB', 0, len(elems)) + elems
+
+ profiles = profile1 + profile2
+ params['vendor_elements'] = elem_multibssid(profiles, 4)
+ hostapd.add_ap(apdev[0], params)
+
+ dev[0].connect("transmitted", key_mgmt="NONE", scan_freq="2412")
+ dev[0].request("REMOVE_NETWORK all")
+ dev[0].wait_disconnected()
+ dev[0].dump_monitor()
+
+ dev[0].connect("nontransmitted", key_mgmt="NONE", scan_freq="2412",
+ wait_connect=False)
+ ev = dev[0].wait_event(["SME: Trying to authenticate"], timeout=10)
+ if ev is None:
+ raise Exception("Connection attempt to nontransmitted BSS not started")
+ if "02:00:00:00:03:01 (SSID='nontransmitted'" not in ev:
+ raise Exception("Unexpected authentication target")
+ # hostapd does not yet support Multiple-BSSID, so only verify that STA is
+ # able to start connection attempt.
+ dev[0].request("REMOVE_NETWORK all")
+ dev[0].dump_monitor()
+
+ dev[0].connect("nontransmitted_2", key_mgmt="NONE", scan_freq="2412",
+ wait_connect=False)
+ ev = dev[0].wait_event(["SME: Trying to authenticate"], timeout=10)
+ if ev is None:
+ raise Exception("Connection attempt to nontransmitted BSS not started")
+ if "02:00:00:00:03:02 (SSID='nontransmitted_2'" not in ev:
+ raise Exception("Unexpected authentication target")
+ # hostapd does not yet support Multiple-BSSID, so only verify that STA is
+ # able to start connection attempt.
+ dev[0].request("REMOVE_NETWORK all")
+ dev[0].dump_monitor()