]> git.ipfire.org Git - thirdparty/hostap.git/blob - tests/hwsim/test_wpas_ctrl.py
2def9889841460400e5806092c0a85b6018d9246
[thirdparty/hostap.git] / tests / hwsim / test_wpas_ctrl.py
1 # wpa_supplicant control interface
2 # Copyright (c) 2014, Qualcomm Atheros, Inc.
3 #
4 # This software may be distributed under the terms of the BSD license.
5 # See README for more details.
6
7 import hostapd
8
9 def test_wpas_ctrl_network(dev):
10 """wpa_supplicant ctrl_iface network set/get"""
11 id = dev[0].add_network()
12
13 tests = (("key_mgmt", "WPA-PSK WPA-EAP IEEE8021X NONE WPA-NONE FT-PSK FT-EAP WPA-PSK-SHA256 WPA-EAP-SHA256"),
14 ("pairwise", "CCMP-256 GCMP-256 CCMP GCMP TKIP"),
15 ("group", "CCMP-256 GCMP-256 CCMP GCMP TKIP WEP104 WEP40"),
16 ("auth_alg", "OPEN SHARED LEAP"),
17 ("scan_freq", "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"),
18 ("freq_list", "2412 2417"),
19 ("scan_ssid", "1"),
20 ("bssid", "00:11:22:33:44:55"),
21 ("proto", "WPA RSN OSEN"),
22 ("eap", "TLS"),
23 ("go_p2p_dev_addr", "22:33:44:55:66:aa"),
24 ("p2p_client_list", "22:33:44:55:66:bb 02:11:22:33:44:55"))
25
26 dev[0].set_network_quoted(id, "ssid", "test")
27 for field, value in tests:
28 dev[0].set_network(id, field, value)
29 res = dev[0].get_network(id, field)
30 if res != value:
31 raise Exception("Unexpected response for '" + field + "': '" + res + "'")
32
33 q_tests = (("identity", "hello"),
34 ("anonymous_identity", "foo@nowhere.com"))
35 for field, value in q_tests:
36 dev[0].set_network_quoted(id, field, value)
37 res = dev[0].get_network(id, field)
38 if res != '"' + value + '"':
39 raise Exception("Unexpected quoted response for '" + field + "': '" + res + "'")
40
41 get_tests = (("foo", None), ("ssid", '"test"'))
42 for field, value in get_tests:
43 res = dev[0].get_network(id, field)
44 if res != value:
45 raise Exception("Unexpected response for '" + field + "': '" + res + "'")
46
47 if dev[0].get_network(id, "password"):
48 raise Exception("Unexpected response for 'password'")
49 dev[0].set_network_quoted(id, "password", "foo")
50 if dev[0].get_network(id, "password") != '*':
51 raise Exception("Unexpected response for 'password' (expected *)")
52 dev[0].set_network(id, "password", "hash:12345678901234567890123456789012")
53 if dev[0].get_network(id, "password") != '*':
54 raise Exception("Unexpected response for 'password' (expected *)")
55 dev[0].set_network(id, "password", "NULL")
56 if dev[0].get_network(id, "password"):
57 raise Exception("Unexpected response for 'password'")
58 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + " password hash:12"):
59 raise Exception("Unexpected success for invalid password hash")
60 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + " password hash:123456789012345678x0123456789012"):
61 raise Exception("Unexpected success for invalid password hash")
62
63 dev[0].set_network(id, "identity", "414243")
64 if dev[0].get_network(id, "identity") != '"ABC"':
65 raise Exception("Unexpected identity hex->text response")
66
67 dev[0].set_network(id, "identity", 'P"abc\ndef"')
68 if dev[0].get_network(id, "identity") != "6162630a646566":
69 raise Exception("Unexpected identity printf->hex response")
70
71 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' identity P"foo'):
72 raise Exception("Unexpected success for invalid identity string")
73
74 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' identity 12x3'):
75 raise Exception("Unexpected success for invalid identity string")
76
77 for i in range(0, 4):
78 if "FAIL" in dev[0].request("SET_NETWORK " + str(id) + ' wep_key' + str(i) + ' aabbccddee'):
79 raise Exception("Unexpected wep_key set failure")
80 if dev[0].get_network(id, "wep_key" + str(i)) != '*':
81 raise Exception("Unexpected wep_key get failure")
82
83 if "FAIL" in dev[0].request("SET_NETWORK " + str(id) + ' psk_list P2P-00:11:22:33:44:55-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'):
84 raise Exception("Unexpected failure for psk_list string")
85
86 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' psk_list 00:11:x2:33:44:55-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'):
87 raise Exception("Unexpected success for invalid psk_list string")
88
89 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' psk_list P2P-00:11:x2:33:44:55-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'):
90 raise Exception("Unexpected success for invalid psk_list string")
91
92 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' psk_list P2P-00:11:22:33:44:55+0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'):
93 raise Exception("Unexpected success for invalid psk_list string")
94
95 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' psk_list P2P-00:11:22:33:44:55-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde'):
96 raise Exception("Unexpected success for invalid psk_list string")
97
98 if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' psk_list P2P-00:11:22:33:44:55-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdex'):
99 raise Exception("Unexpected success for invalid psk_list string")
100
101 if dev[0].get_network(id, "psk_list"):
102 raise Exception("Unexpected psk_list get response")
103
104 if dev[0].list_networks()[0]['ssid'] != "test":
105 raise Exception("Unexpected ssid in LIST_NETWORKS")
106 dev[0].set_network(id, "ssid", "NULL")
107 if dev[0].list_networks()[0]['ssid'] != "":
108 raise Exception("Unexpected ssid in LIST_NETWORKS after clearing it")
109
110 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' ssid "0123456789abcdef0123456789abcdef0"'):
111 raise Exception("Too long SSID accepted")
112 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' scan_ssid qwerty'):
113 raise Exception("Invalid integer accepted")
114 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' scan_ssid 2'):
115 raise Exception("Too large integer accepted")
116 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk 12345678'):
117 raise Exception("Invalid PSK accepted")
118 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk "1234567"'):
119 raise Exception("Too short PSK accepted")
120 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk "1234567890123456789012345678901234567890123456789012345678901234"'):
121 raise Exception("Too long PSK accepted")
122 dev[0].set_network_quoted(id, "psk", "123456768");
123 dev[0].set_network_quoted(id, "psk", "123456789012345678901234567890123456789012345678901234567890123");
124 if dev[0].get_network(id, "psk") != '*':
125 raise Exception("Unexpected psk read result");
126
127 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' eap UNKNOWN'):
128 raise Exception("Unknown EAP method accepted")
129
130 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' password "foo'):
131 raise Exception("Invalid password accepted")
132
133 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' wep_key0 "foo'):
134 raise Exception("Invalid WEP key accepted")
135 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' wep_key0 "12345678901234567"'):
136 raise Exception("Too long WEP key accepted")
137 # too short WEP key is ignored
138 dev[0].set_network_quoted(id, "wep_key0", "1234")
139 dev[0].set_network_quoted(id, "wep_key1", "12345")
140 dev[0].set_network_quoted(id, "wep_key2", "1234567890123")
141 dev[0].set_network_quoted(id, "wep_key3", "1234567890123456")
142
143 dev[0].set_network(id, "go_p2p_dev_addr", "any")
144 if dev[0].get_network(id, "go_p2p_dev_addr") is not None:
145 raise Exception("Unexpected go_p2p_dev_addr value")
146 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' go_p2p_dev_addr 00:11:22:33:44'):
147 raise Exception("Invalid go_p2p_dev_addr accepted")
148 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' p2p_client_list 00:11:22:33:44'):
149 raise Exception("Invalid p2p_client_list accepted")
150 if "FAIL" in dev[0].request('SET_NETWORK ' + str(id) + ' p2p_client_list 00:11:22:33:44:55 00:1'):
151 raise Exception("p2p_client_list truncation workaround failed")
152 if dev[0].get_network(id, "p2p_client_list") != "00:11:22:33:44:55":
153 raise Exception("p2p_client_list truncation workaround did not work")
154
155 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' auth_alg '):
156 raise Exception("Empty auth_alg accepted")
157 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' auth_alg FOO'):
158 raise Exception("Invalid auth_alg accepted")
159
160 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' proto '):
161 raise Exception("Empty proto accepted")
162 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' proto FOO'):
163 raise Exception("Invalid proto accepted")
164
165 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' pairwise '):
166 raise Exception("Empty pairwise accepted")
167 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' pairwise FOO'):
168 raise Exception("Invalid pairwise accepted")
169 if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' pairwise WEP40'):
170 raise Exception("Invalid pairwise accepted")
171
172 def add_cred(dev):
173 id = dev.add_cred()
174 ev = dev.wait_event(["CRED-ADDED"])
175 if ev is None:
176 raise Exception("Missing CRED-ADDED event")
177 if " " + str(id) not in ev:
178 raise Exception("CRED-ADDED event without matching id")
179 return id
180
181 def set_cred(dev, id, field, value):
182 dev.set_cred(id, field, value)
183 ev = dev.wait_event(["CRED-MODIFIED"])
184 if ev is None:
185 raise Exception("Missing CRED-MODIFIED event")
186 if " " + str(id) + " " not in ev:
187 raise Exception("CRED-MODIFIED event without matching id")
188 if field not in ev:
189 raise Exception("CRED-MODIFIED event without matching field")
190
191 def set_cred_quoted(dev, id, field, value):
192 dev.set_cred_quoted(id, field, value)
193 ev = dev.wait_event(["CRED-MODIFIED"])
194 if ev is None:
195 raise Exception("Missing CRED-MODIFIED event")
196 if " " + str(id) + " " not in ev:
197 raise Exception("CRED-MODIFIED event without matching id")
198 if field not in ev:
199 raise Exception("CRED-MODIFIED event without matching field")
200
201 def remove_cred(dev, id):
202 dev.remove_cred(id)
203 ev = dev.wait_event(["CRED-REMOVED"])
204 if ev is None:
205 raise Exception("Missing CRED-REMOVED event")
206 if " " + str(id) not in ev:
207 raise Exception("CRED-REMOVED event without matching id")
208
209 def test_wpas_ctrl_cred(dev):
210 """wpa_supplicant ctrl_iface cred set"""
211 id1 = add_cred(dev[0])
212 id = add_cred(dev[0])
213 id2 = add_cred(dev[0])
214 set_cred(dev[0], id, "temporary", "1")
215 set_cred(dev[0], id, "priority", "1")
216 set_cred(dev[0], id, "pcsc", "1")
217 set_cred_quoted(dev[0], id, "private_key_passwd", "test")
218 set_cred_quoted(dev[0], id, "domain_suffix_match", "test")
219 set_cred_quoted(dev[0], id, "phase1", "test")
220 set_cred_quoted(dev[0], id, "phase2", "test")
221
222 if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " eap FOO"):
223 raise Exception("Unexpected success on unknown EAP method")
224
225 if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " username 12xa"):
226 raise Exception("Unexpected success on invalid string")
227
228 for i in ("11", "1122", "112233445566778899aabbccddeeff00"):
229 if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " roaming_consortium " + i):
230 raise Exception("Unexpected success on invalid roaming_consortium")
231
232 dev[0].set_cred(id, "excluded_ssid", "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff")
233 if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " excluded_ssid 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"):
234 raise Exception("Unexpected success on invalid excluded_ssid")
235
236 if "FAIL" not in dev[0].request("SET_CRED " + str(id) + " foo 4142"):
237 raise Exception("Unexpected success on unknown field")
238
239 id3 = add_cred(dev[0])
240 id4 = add_cred(dev[0])
241
242 remove_cred(dev[0], id1)
243 remove_cred(dev[0], id3)
244 remove_cred(dev[0], id4)
245 remove_cred(dev[0], id2)
246 remove_cred(dev[0], id)
247 if "FAIL" not in dev[0].request("REMOVE_CRED 1"):
248 raise Exception("Unexpected success on invalid remove cred")
249
250 id = add_cred(dev[0])
251 values = [ ("temporary", "1", False),
252 ("temporary", "0", False),
253 ("pcsc", "1", False),
254 ("realm", "example.com", True),
255 ("username", "user@example.com", True),
256 ("password", "foo", True, "*"),
257 ("ca_cert", "ca.pem", True),
258 ("client_cert", "user.pem", True),
259 ("private_key", "key.pem", True),
260 ("private_key_passwd", "foo", True, "*"),
261 ("imsi", "310026-000000000", True),
262 ("milenage", "foo", True, "*"),
263 ("domain_suffix_match", "example.com", True),
264 ("domain", "example.com", True),
265 ("domain", "example.org", True, "example.com\nexample.org"),
266 ("roaming_consortium", "0123456789", False),
267 ("required_roaming_consortium", "456789", False),
268 ("eap", "TTLS", False),
269 ("phase1", "foo=bar1", True),
270 ("phase2", "foo=bar2", True),
271 ("excluded_ssid", "test", True),
272 ("excluded_ssid", "foo", True, "test\nfoo"),
273 ("roaming_partner", "example.com,0,4,*", True),
274 ("roaming_partner", "example.org,1,2,US", True,
275 "example.com,0,4,*\nexample.org,1,2,US"),
276 ("update_identifier", "4", False),
277 ("provisioning_sp", "sp.example.com", True),
278 ("sp_priority", "7", False),
279 ("min_dl_bandwidth_home", "100", False),
280 ("min_ul_bandwidth_home", "101", False),
281 ("min_dl_bandwidth_roaming", "102", False),
282 ("min_ul_bandwidth_roaming", "103", False),
283 ("max_bss_load", "57", False),
284 ("req_conn_capab", "6:22,80,443", False),
285 ("req_conn_capab", "17:500", False, "6:22,80,443\n17:500"),
286 ("req_conn_capab", "50", False, "6:22,80,443\n17:500\n50"),
287 ("ocsp", "1", False) ]
288 for v in values:
289 if v[2]:
290 set_cred_quoted(dev[0], id, v[0], v[1])
291 else:
292 set_cred(dev[0], id, v[0], v[1])
293 val = dev[0].get_cred(id, v[0])
294 if len(v) == 4:
295 expect = v[3]
296 else:
297 expect = v[1]
298 if val != expect:
299 raise Exception("Unexpected GET_CRED value for {}: {} != {}".format(v[0], val, expect))
300 remove_cred(dev[0], id)
301
302 def test_wpas_ctrl_pno(dev):
303 """wpa_supplicant ctrl_iface pno"""
304 if "FAIL" not in dev[0].request("SET pno 1"):
305 raise Exception("Unexpected success in enabling PNO without enabled network blocks")
306 id = dev[0].add_network()
307 dev[0].set_network_quoted(id, "ssid", "test")
308 dev[0].set_network(id, "key_mgmt", "NONE")
309 dev[0].request("ENABLE_NETWORK " + str(id) + " no-connect")
310 #mac80211_hwsim does not yet support PNO, so this fails
311 if "FAIL" not in dev[0].request("SET pno 1"):
312 raise Exception("Unexpected success in enabling PNO")
313 if "FAIL" in dev[0].request("SET pno 0"):
314 raise Exception("Unexpected failure in disabling PNO")
315
316 def test_wpas_ctrl_get(dev):
317 """wpa_supplicant ctrl_iface get"""
318 if "FAIL" in dev[0].request("GET version"):
319 raise Exception("Unexpected get failure for version")
320 if "FAIL" in dev[0].request("GET wifi_display"):
321 raise Exception("Unexpected get failure for wifi_display")
322 if "FAIL" not in dev[0].request("GET foo"):
323 raise Exception("Unexpected success on get command")
324
325 def test_wpas_ctrl_preauth(dev):
326 """wpa_supplicant ctrl_iface preauth"""
327 if "FAIL" not in dev[0].request("PREAUTH "):
328 raise Exception("Unexpected success on invalid PREAUTH")
329 if "FAIL" in dev[0].request("PREAUTH 00:11:22:33:44:55"):
330 raise Exception("Unexpected failure on PREAUTH")
331
332 def test_wpas_ctrl_stkstart(dev):
333 """wpa_supplicant ctrl_iface strkstart"""
334 if "FAIL" not in dev[0].request("STKSTART "):
335 raise Exception("Unexpected success on invalid STKSTART")
336 if "FAIL" not in dev[0].request("STKSTART 00:11:22:33:44:55"):
337 raise Exception("Unexpected success on STKSTART")
338
339 def test_wpas_ctrl_tdls_discover(dev):
340 """wpa_supplicant ctrl_iface tdls_discover"""
341 if "FAIL" not in dev[0].request("TDLS_DISCOVER "):
342 raise Exception("Unexpected success on invalid TDLS_DISCOVER")
343 if "FAIL" not in dev[0].request("TDLS_DISCOVER 00:11:22:33:44:55"):
344 raise Exception("Unexpected success on TDLS_DISCOVER")
345
346 def test_wpas_ctrl_config_parser(dev):
347 """wpa_supplicant ctrl_iface SET config parser"""
348 if "FAIL" not in dev[0].request("SET pbc_in_m1 qwerty"):
349 raise Exception("Non-number accepted as integer")
350 if "FAIL" not in dev[0].request("SET eapol_version 0"):
351 raise Exception("Out-of-range value accepted")
352 if "FAIL" not in dev[0].request("SET eapol_version 10"):
353 raise Exception("Out-of-range value accepted")
354
355 if "FAIL" not in dev[0].request("SET serial_number 0123456789abcdef0123456789abcdef0"):
356 raise Exception("Too long string accepted")
357
358 def test_wpas_ctrl_mib(dev):
359 """wpa_supplicant ctrl_iface MIB"""
360 mib = dev[0].get_mib()
361 if "dot11RSNAOptionImplemented" not in mib:
362 raise Exception("Missing MIB entry")
363 if mib["dot11RSNAOptionImplemented"] != "TRUE":
364 raise Exception("Unexpected dot11RSNAOptionImplemented value")
365
366 def test_wpas_ctrl_set_wps_params(dev):
367 """wpa_supplicant ctrl_iface SET config_methods"""
368 ts = [ "config_methods label virtual_display virtual_push_button keypad",
369 "device_type 1-0050F204-1",
370 "os_version 01020300",
371 "uuid 12345678-9abc-def0-1234-56789abcdef0" ]
372 for t in ts:
373 if "OK" not in dev[2].request("SET " + t):
374 raise Exception("SET failed for: " + t)
375
376 def test_wpas_ctrl_level(dev):
377 """wpa_supplicant ctrl_iface LEVEL"""
378 try:
379 if "FAIL" not in dev[2].request("LEVEL 3"):
380 raise Exception("Unexpected LEVEL success")
381 if "OK" not in dev[2].mon.request("LEVEL 2"):
382 raise Exception("Unexpected LEVEL failure")
383 dev[2].request("SCAN freq=2412")
384 ev = dev[2].wait_event(["State:"], timeout=5)
385 if ev is None:
386 raise Exception("No debug message received")
387 dev[2].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=5)
388 finally:
389 dev[2].mon.request("LEVEL 3")
390
391 def test_wpas_ctrl_bssid_filter(dev, apdev):
392 """wpa_supplicant bssid_filter"""
393 try:
394 if "OK" not in dev[2].request("SET bssid_filter " + apdev[0]['bssid']):
395 raise Exception("Failed to set bssid_filter")
396 params = { "ssid": "test" }
397 hostapd.add_ap(apdev[0]['ifname'], params)
398 hostapd.add_ap(apdev[1]['ifname'], params)
399 dev[2].scan(freq="2412")
400 bss = dev[2].get_bss(apdev[0]['bssid'])
401 if len(bss) == 0:
402 raise Exception("Missing BSS data")
403 bss = dev[2].get_bss(apdev[1]['bssid'])
404 if len(bss) != 0:
405 raise Exception("Unexpected BSS data")
406 dev[2].request("SET bssid_filter ")
407 dev[2].scan(freq="2412")
408 bss = dev[2].get_bss(apdev[0]['bssid'])
409 if len(bss) == 0:
410 raise Exception("Missing BSS data")
411 bss = dev[2].get_bss(apdev[1]['bssid'])
412 if len(bss) == 0:
413 raise Exception("Missing BSS data(2)")
414 finally:
415 dev[2].request("SET bssid_filter ")
416
417 def test_wpas_ctrl_disallow_aps(dev, apdev):
418 """wpa_supplicant ctrl_iface disallow_aps"""
419 params = { "ssid": "test" }
420 hostapd.add_ap(apdev[0]['ifname'], params)
421
422 if "FAIL" not in dev[0].request("SET disallow_aps bssid "):
423 raise Exception("Unexpected success on invalid disallow_aps")
424 if "FAIL" not in dev[0].request("SET disallow_aps bssid 00:11:22:33:44"):
425 raise Exception("Unexpected success on invalid disallow_aps")
426 if "FAIL" not in dev[0].request("SET disallow_aps ssid 0"):
427 raise Exception("Unexpected success on invalid disallow_aps")
428 if "FAIL" not in dev[0].request("SET disallow_aps ssid 4q"):
429 raise Exception("Unexpected success on invalid disallow_aps")
430 if "FAIL" not in dev[0].request("SET disallow_aps ssid 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f00"):
431 raise Exception("Unexpected success on invalid disallow_aps")
432 if "FAIL" not in dev[0].request("SET disallow_aps foo 112233445566"):
433 raise Exception("Unexpected success on invalid disallow_aps")
434
435 dev[0].connect("test", key_mgmt="NONE", scan_freq="2412")
436 hostapd.add_ap(apdev[1]['ifname'], params)
437 dev[0].dump_monitor()
438 if "OK" not in dev[0].request("SET disallow_aps bssid " + apdev[0]['bssid']):
439 raise Exception("Failed to set disallow_aps")
440 ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
441 if ev is None:
442 raise Exception("Reassociation timed out")
443 if apdev[1]['bssid'] not in ev:
444 raise Exception("Unexpected BSSID")
445
446 dev[0].dump_monitor()
447 if "OK" not in dev[0].request("SET disallow_aps ssid " + "test".encode("hex")):
448 raise Exception("Failed to set disallow_aps")
449 ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
450 if ev is None:
451 raise Exception("Disconnection not seen")
452 ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
453 if ev is not None:
454 raise Exception("Unexpected reassociation")