]>
Commit | Line | Data |
---|---|---|
fdae3c40 | 1 | # IBSS test cases |
dd025790 | 2 | # Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi> |
fdae3c40 JM |
3 | # |
4 | # This software may be distributed under the terms of the BSD license. | |
5 | # See README for more details. | |
6 | ||
9fd6804d | 7 | from remotehost import remote_compatible |
fdae3c40 | 8 | import logging |
c9aa4308 | 9 | logger = logging.getLogger() |
fdae3c40 | 10 | import time |
dcfb4d65 | 11 | import re |
6343f24d | 12 | import subprocess |
fdae3c40 JM |
13 | |
14 | import hwsim_utils | |
8aab5246 | 15 | from utils import alloc_fail |
fdae3c40 | 16 | |
dd025790 | 17 | def connect_ibss_cmd(dev, id, freq=2412): |
fdae3c40 | 18 | dev.dump_monitor() |
dd025790 | 19 | dev.select_network(id, freq=str(freq)) |
fdae3c40 JM |
20 | |
21 | def wait_ibss_connection(dev): | |
e5a39838 | 22 | logger.info(dev.ifname + " waiting for IBSS start/join to complete") |
5f35a5e2 JM |
23 | ev = dev.wait_connected(timeout=20, |
24 | error="Connection to the IBSS timed out") | |
dcfb4d65 JM |
25 | exp = r'<.>(CTRL-EVENT-CONNECTED) - Connection to ([0-9a-f:]*) completed.*' |
26 | s = re.split(exp, ev) | |
27 | if len(s) < 3: | |
28 | return None | |
29 | return s[2] | |
e5a39838 JM |
30 | |
31 | def wait_4way_handshake(dev1, dev2): | |
32 | logger.info(dev1.ifname + " waiting for 4-way handshake completion with " + dev2.ifname + " " + dev2.p2p_interface_addr()) | |
33 | ev = dev1.wait_event(["IBSS-RSN-COMPLETED " + dev2.p2p_interface_addr()], | |
34 | timeout=20) | |
35 | if ev is None: | |
36 | raise Exception("4-way handshake in IBSS timed out") | |
fdae3c40 | 37 | |
3d5b356a JM |
38 | def wait_4way_handshake2(dev1, dev2, dev3): |
39 | logger.info(dev1.ifname + " waiting for 4-way handshake completion with " + dev2.ifname + " " + dev2.p2p_interface_addr() + " and " + dev3.p2p_interface_addr()) | |
40 | ev = dev1.wait_event(["IBSS-RSN-COMPLETED " + dev2.p2p_interface_addr(), | |
41 | "IBSS-RSN-COMPLETED " + dev3.p2p_interface_addr()], | |
42 | timeout=20) | |
43 | if ev is None: | |
44 | raise Exception("4-way handshake in IBSS timed out") | |
45 | ev = dev1.wait_event(["IBSS-RSN-COMPLETED " + dev2.p2p_interface_addr(), | |
46 | "IBSS-RSN-COMPLETED " + dev3.p2p_interface_addr()], | |
47 | timeout=20) | |
48 | if ev is None: | |
49 | raise Exception("4-way handshake in IBSS timed out") | |
50 | ||
6343f24d | 51 | def add_ibss(dev, ssid, psk=None, proto=None, key_mgmt=None, pairwise=None, |
4cfc4693 | 52 | group=None, beacon_int=None, bssid=None, scan_freq=None, |
13f6ef9c | 53 | wep_key0=None, freq=2412, chwidth=0): |
fdae3c40 JM |
54 | id = dev.add_network() |
55 | dev.set_network(id, "mode", "1") | |
dd025790 | 56 | dev.set_network(id, "frequency", str(freq)) |
13f6ef9c JM |
57 | if chwidth > 0: |
58 | dev.set_network(id, "max_oper_chwidth", str(chwidth)) | |
6343f24d JM |
59 | if scan_freq: |
60 | dev.set_network(id, "scan_freq", str(scan_freq)) | |
fdae3c40 JM |
61 | dev.set_network_quoted(id, "ssid", ssid) |
62 | if psk: | |
63 | dev.set_network_quoted(id, "psk", psk) | |
64 | if proto: | |
65 | dev.set_network(id, "proto", proto) | |
66 | if key_mgmt: | |
67 | dev.set_network(id, "key_mgmt", key_mgmt) | |
68 | if pairwise: | |
69 | dev.set_network(id, "pairwise", pairwise) | |
70 | if group: | |
71 | dev.set_network(id, "group", group) | |
13adbe23 JM |
72 | if beacon_int: |
73 | dev.set_network(id, "beacon_int", beacon_int) | |
ca38a309 JM |
74 | if bssid: |
75 | dev.set_network(id, "bssid", bssid) | |
4cfc4693 JM |
76 | if wep_key0: |
77 | dev.set_network(id, "wep_key0", wep_key0) | |
ca38a309 | 78 | dev.request("ENABLE_NETWORK " + str(id) + " no-connect") |
fdae3c40 JM |
79 | return id |
80 | ||
81 | def add_ibss_rsn(dev, ssid): | |
82 | return add_ibss(dev, ssid, "12345678", "RSN", "WPA-PSK", "CCMP", "CCMP") | |
83 | ||
4cfc4693 JM |
84 | def add_ibss_rsn_tkip(dev, ssid): |
85 | return add_ibss(dev, ssid, "12345678", "RSN", "WPA-PSK", "TKIP", "TKIP") | |
86 | ||
910d2ca7 JM |
87 | def add_ibss_wpa_none(dev, ssid): |
88 | return add_ibss(dev, ssid, "12345678", "WPA", "WPA-NONE", "TKIP", "TKIP") | |
89 | ||
d65a90d7 JM |
90 | def add_ibss_wpa_none_ccmp(dev, ssid): |
91 | return add_ibss(dev, ssid, "12345678", "WPA", "WPA-NONE", "CCMP", "CCMP") | |
92 | ||
fdae3c40 JM |
93 | def test_ibss_rsn(dev): |
94 | """IBSS RSN""" | |
95 | ssid="ibss-rsn" | |
96 | ||
97 | logger.info("Start IBSS on the first STA") | |
98 | id = add_ibss_rsn(dev[0], ssid) | |
99 | connect_ibss_cmd(dev[0], id) | |
dcfb4d65 | 100 | bssid0 = wait_ibss_connection(dev[0]) |
fdae3c40 JM |
101 | |
102 | logger.info("Join two STAs to the IBSS") | |
103 | ||
104 | id = add_ibss_rsn(dev[1], ssid) | |
105 | connect_ibss_cmd(dev[1], id) | |
dcfb4d65 JM |
106 | bssid1 = wait_ibss_connection(dev[1]) |
107 | if bssid0 != bssid1: | |
108 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
109 | # try to merge with a scan | |
110 | dev[1].scan() | |
e5a39838 JM |
111 | wait_4way_handshake(dev[0], dev[1]) |
112 | wait_4way_handshake(dev[1], dev[0]) | |
fdae3c40 JM |
113 | |
114 | id = add_ibss_rsn(dev[2], ssid) | |
115 | connect_ibss_cmd(dev[2], id) | |
dcfb4d65 JM |
116 | bssid2 = wait_ibss_connection(dev[2]) |
117 | if bssid0 != bssid2: | |
118 | logger.info("STA0 BSSID " + bssid0 + " differs from STA2 BSSID " + bssid2) | |
119 | # try to merge with a scan | |
120 | dev[2].scan() | |
e5a39838 | 121 | wait_4way_handshake(dev[0], dev[2]) |
3d5b356a | 122 | wait_4way_handshake2(dev[2], dev[0], dev[1]) |
fdae3c40 JM |
123 | |
124 | # Allow some time for all peers to complete key setup | |
125 | time.sleep(3) | |
a8375c94 JM |
126 | hwsim_utils.test_connectivity(dev[0], dev[1]) |
127 | hwsim_utils.test_connectivity(dev[0], dev[2]) | |
128 | hwsim_utils.test_connectivity(dev[1], dev[2]) | |
910d2ca7 | 129 | |
bba4616c JM |
130 | dev[1].request("REMOVE_NETWORK all") |
131 | time.sleep(1) | |
132 | id = add_ibss_rsn(dev[1], ssid) | |
133 | connect_ibss_cmd(dev[1], id) | |
134 | bssid1 = wait_ibss_connection(dev[1]) | |
135 | if bssid0 != bssid1: | |
136 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
137 | # try to merge with a scan | |
138 | dev[1].scan() | |
139 | wait_4way_handshake(dev[0], dev[1]) | |
140 | wait_4way_handshake(dev[1], dev[0]) | |
141 | time.sleep(3) | |
a8375c94 | 142 | hwsim_utils.test_connectivity(dev[0], dev[1]) |
bba4616c | 143 | |
ed685e43 JM |
144 | if "OK" not in dev[0].request("IBSS_RSN " + dev[1].p2p_interface_addr()): |
145 | raise Exception("IBSS_RSN command failed") | |
146 | ||
910d2ca7 JM |
147 | def test_ibss_wpa_none(dev): |
148 | """IBSS WPA-None""" | |
149 | ssid="ibss-wpa-none" | |
150 | ||
151 | logger.info("Start IBSS on the first STA") | |
152 | id = add_ibss_wpa_none(dev[0], ssid) | |
153 | connect_ibss_cmd(dev[0], id) | |
154 | bssid0 = wait_ibss_connection(dev[0]) | |
155 | ||
910d2ca7 JM |
156 | # This is a bit ugly, but no one really cares about WPA-None, so there may |
157 | # not be enough justification to clean this up.. For now, wpa_supplicant | |
158 | # will show two connection events with mac80211_hwsim where the first one | |
159 | # comes with all zeros address. | |
160 | if bssid0 == "00:00:00:00:00:00": | |
161 | logger.info("Waiting for real BSSID on the first STA") | |
162 | bssid0 = wait_ibss_connection(dev[0]) | |
163 | ||
d65a90d7 JM |
164 | logger.info("Join two STAs to the IBSS") |
165 | ||
166 | id = add_ibss_wpa_none(dev[1], ssid) | |
167 | connect_ibss_cmd(dev[1], id) | |
168 | id = add_ibss_wpa_none(dev[2], ssid) | |
169 | connect_ibss_cmd(dev[2], id) | |
170 | ||
910d2ca7 JM |
171 | bssid1 = wait_ibss_connection(dev[1]) |
172 | if bssid0 != bssid1: | |
173 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
174 | bssid1 = wait_ibss_connection(dev[1]) | |
175 | ||
176 | bssid2 = wait_ibss_connection(dev[2]) | |
177 | if bssid0 != bssid2: | |
178 | logger.info("STA0 BSSID " + bssid0 + " differs from STA2 BSSID " + bssid2) | |
179 | bssid2 = wait_ibss_connection(dev[2]) | |
180 | ||
2e0d48e5 | 181 | logger.info("bssid0=%s bssid1=%s bssid2=%s" % (bssid0, bssid1, bssid2)) |
910d2ca7 | 182 | |
d463c556 JM |
183 | bss = dev[0].get_bss(bssid0) |
184 | if not bss: | |
185 | bss = dev[1].get_bss(bssid1) | |
186 | if not bss: | |
187 | raise Exception("Could not find BSS entry for IBSS") | |
188 | if 'flags' not in bss: | |
189 | raise Exception("Could not get BSS flags from BSS table") | |
190 | if "[WPA-None-TKIP]" not in bss['flags']: | |
191 | raise Exception("Unexpected BSS flags: " + bss['flags']) | |
192 | ||
910d2ca7 JM |
193 | # Allow some time for all peers to complete key setup |
194 | time.sleep(1) | |
195 | ||
196 | # This is supposed to work, but looks like WPA-None does not work with | |
197 | # mac80211 currently.. | |
198 | try: | |
a8375c94 | 199 | hwsim_utils.test_connectivity(dev[0], dev[1]) |
910d2ca7 JM |
200 | except Exception, e: |
201 | logger.info("Ignoring known connectivity failure: " + str(e)) | |
202 | try: | |
a8375c94 | 203 | hwsim_utils.test_connectivity(dev[0], dev[2]) |
910d2ca7 JM |
204 | except Exception, e: |
205 | logger.info("Ignoring known connectivity failure: " + str(e)) | |
206 | try: | |
a8375c94 | 207 | hwsim_utils.test_connectivity(dev[1], dev[2]) |
910d2ca7 JM |
208 | except Exception, e: |
209 | logger.info("Ignoring known connectivity failure: " + str(e)) | |
13adbe23 | 210 | |
d65a90d7 JM |
211 | def test_ibss_wpa_none_ccmp(dev): |
212 | """IBSS WPA-None/CCMP""" | |
213 | ssid="ibss-wpa-none" | |
214 | ||
215 | logger.info("Start IBSS on the first STA") | |
216 | id = add_ibss_wpa_none(dev[0], ssid) | |
217 | connect_ibss_cmd(dev[0], id) | |
218 | bssid0 = wait_ibss_connection(dev[0]) | |
219 | ||
220 | # This is a bit ugly, but no one really cares about WPA-None, so there may | |
221 | # not be enough justification to clean this up.. For now, wpa_supplicant | |
222 | # will show two connection events with mac80211_hwsim where the first one | |
223 | # comes with all zeros address. | |
224 | if bssid0 == "00:00:00:00:00:00": | |
225 | logger.info("Waiting for real BSSID on the first STA") | |
226 | bssid0 = wait_ibss_connection(dev[0]) | |
227 | ||
228 | ||
229 | logger.info("Join a STA to the IBSS") | |
230 | id = add_ibss_wpa_none(dev[1], ssid) | |
231 | connect_ibss_cmd(dev[1], id) | |
232 | ||
233 | bssid1 = wait_ibss_connection(dev[1]) | |
234 | if bssid0 != bssid1: | |
235 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
236 | bssid1 = wait_ibss_connection(dev[1]) | |
237 | ||
2e0d48e5 | 238 | logger.info("bssid0=%s bssid1=%s" % (bssid0, bssid1)) |
d65a90d7 JM |
239 | |
240 | # Allow some time for all peers to complete key setup | |
241 | time.sleep(1) | |
242 | ||
243 | # This is supposed to work, but looks like WPA-None does not work with | |
244 | # mac80211 currently.. | |
245 | try: | |
a8375c94 | 246 | hwsim_utils.test_connectivity(dev[0], dev[1]) |
d65a90d7 JM |
247 | except Exception, e: |
248 | logger.info("Ignoring known connectivity failure: " + str(e)) | |
249 | ||
13adbe23 JM |
250 | def test_ibss_open(dev): |
251 | """IBSS open (no security)""" | |
252 | ssid="ibss" | |
253 | id = add_ibss(dev[0], ssid, key_mgmt="NONE", beacon_int="150") | |
254 | connect_ibss_cmd(dev[0], id) | |
255 | bssid0 = wait_ibss_connection(dev[0]) | |
256 | ||
257 | id = add_ibss(dev[1], ssid, key_mgmt="NONE", beacon_int="200") | |
258 | connect_ibss_cmd(dev[1], id) | |
259 | bssid1 = wait_ibss_connection(dev[1]) | |
260 | if bssid0 != bssid1: | |
261 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
ca38a309 | 262 | |
d463c556 JM |
263 | res = dev[0].request("SCAN_RESULTS") |
264 | if "[IBSS]" not in res: | |
265 | res = dev[1].request("SCAN_RESULTS") | |
266 | if "[IBSS]" not in res: | |
267 | raise Exception("IBSS flag missing from scan results: " + res) | |
268 | bss = dev[0].get_bss(bssid0) | |
269 | if not bss: | |
270 | bss = dev[1].get_bss(bssid1) | |
271 | if not bss: | |
272 | raise Exception("Could not find BSS entry for IBSS") | |
273 | if 'flags' not in bss: | |
274 | raise Exception("Could not get BSS flags from BSS table") | |
275 | if "[IBSS]" not in bss['flags']: | |
276 | raise Exception("Unexpected BSS flags: " + bss['flags']) | |
277 | ||
ca38a309 JM |
278 | def test_ibss_open_fixed_bssid(dev): |
279 | """IBSS open (no security) and fixed BSSID""" | |
280 | ssid="ibss" | |
281 | bssid="02:11:22:33:44:55" | |
282 | try: | |
283 | dev[0].request("AP_SCAN 2") | |
284 | add_ibss(dev[0], ssid, key_mgmt="NONE", bssid=bssid, beacon_int="150") | |
285 | dev[0].request("REASSOCIATE") | |
286 | ||
287 | dev[1].request("AP_SCAN 2") | |
288 | add_ibss(dev[1], ssid, key_mgmt="NONE", bssid=bssid, beacon_int="200") | |
289 | dev[1].request("REASSOCIATE") | |
290 | ||
291 | bssid0 = wait_ibss_connection(dev[0]) | |
292 | bssid1 = wait_ibss_connection(dev[1]) | |
293 | if bssid0 != bssid: | |
294 | raise Exception("STA0 BSSID " + bssid0 + " differs from fixed BSSID " + bssid) | |
295 | if bssid1 != bssid: | |
296 | raise Exception("STA0 BSSID " + bssid0 + " differs from fixed BSSID " + bssid) | |
297 | finally: | |
298 | dev[0].request("AP_SCAN 1") | |
299 | dev[1].request("AP_SCAN 1") | |
6343f24d JM |
300 | |
301 | def test_ibss_open_retry(dev): | |
302 | """IBSS open (no security) with cfg80211 retry workaround""" | |
303 | subprocess.check_call(['iw', 'dev', dev[0].ifname, 'set', 'type', 'adhoc']) | |
304 | subprocess.check_call(['iw', 'dev', dev[0].ifname, 'ibss', 'join', | |
305 | 'ibss-test', '2412', 'HT20', 'fixed-freq', | |
306 | '02:22:33:44:55:66']) | |
307 | ssid="ibss" | |
308 | try: | |
309 | dev[0].request("AP_SCAN 2") | |
310 | id = add_ibss(dev[0], ssid, key_mgmt="NONE", beacon_int="150", | |
311 | bssid="02:33:44:55:66:77", scan_freq=2412) | |
312 | #connect_ibss_cmd(dev[0], id) | |
313 | dev[0].request("REASSOCIATE") | |
314 | bssid0 = wait_ibss_connection(dev[0]) | |
315 | ||
316 | subprocess.check_call(['iw', 'dev', dev[0].ifname, 'ibss', 'leave']) | |
317 | time.sleep(1) | |
318 | dev[0].request("DISCONNECT") | |
319 | finally: | |
320 | dev[0].request("AP_SCAN 1") | |
4cfc4693 JM |
321 | |
322 | def test_ibss_rsn_tkip(dev): | |
323 | """IBSS RSN with TKIP as the cipher""" | |
324 | ssid="ibss-rsn-tkip" | |
325 | ||
326 | id = add_ibss_rsn_tkip(dev[0], ssid) | |
327 | connect_ibss_cmd(dev[0], id) | |
328 | bssid0 = wait_ibss_connection(dev[0]) | |
329 | ||
330 | id = add_ibss_rsn_tkip(dev[1], ssid) | |
331 | connect_ibss_cmd(dev[1], id) | |
332 | bssid1 = wait_ibss_connection(dev[1]) | |
333 | if bssid0 != bssid1: | |
334 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
335 | # try to merge with a scan | |
336 | dev[1].scan() | |
337 | wait_4way_handshake(dev[0], dev[1]) | |
338 | wait_4way_handshake(dev[1], dev[0]) | |
339 | ||
340 | def test_ibss_wep(dev): | |
341 | """IBSS with WEP""" | |
342 | ssid="ibss-wep" | |
343 | ||
344 | id = add_ibss(dev[0], ssid, key_mgmt="NONE", wep_key0='"hello"') | |
345 | connect_ibss_cmd(dev[0], id) | |
346 | bssid0 = wait_ibss_connection(dev[0]) | |
347 | ||
348 | id = add_ibss(dev[1], ssid, key_mgmt="NONE", wep_key0='"hello"') | |
349 | connect_ibss_cmd(dev[1], id) | |
350 | bssid1 = wait_ibss_connection(dev[1]) | |
c53a3f29 | 351 | |
9fd6804d | 352 | @remote_compatible |
c53a3f29 JM |
353 | def test_ibss_rsn_error_case(dev): |
354 | """IBSS RSN regression test for IBSS_RSN prior IBSS setup""" | |
355 | if "FAIL" not in dev[0].request("IBSS_RSN 02:03:04:05:06:07"): | |
356 | raise Exception("Unexpected IBSS_RSN result") | |
dd025790 JM |
357 | |
358 | def test_ibss_5ghz(dev): | |
359 | """IBSS on 5 GHz band""" | |
360 | try: | |
361 | _test_ibss_5ghz(dev) | |
362 | finally: | |
363 | subprocess.call(['iw', 'reg', 'set', '00']) | |
364 | dev[0].flush_scan_cache() | |
365 | dev[1].flush_scan_cache() | |
366 | ||
367 | def _test_ibss_5ghz(dev): | |
368 | subprocess.call(['iw', 'reg', 'set', 'US']) | |
369 | for i in range(2): | |
370 | for j in range(5): | |
371 | ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) | |
372 | if ev is None: | |
373 | raise Exception("No regdom change event") | |
374 | if "alpha2=US" in ev: | |
375 | break | |
376 | dev[i].dump_monitor() | |
377 | ||
378 | ssid="ibss" | |
379 | id = add_ibss(dev[0], ssid, key_mgmt="NONE", beacon_int="150", freq=5180) | |
380 | connect_ibss_cmd(dev[0], id, freq=5180) | |
381 | bssid0 = wait_ibss_connection(dev[0]) | |
382 | ||
383 | dev[1].scan_for_bss(bssid0, freq=5180) | |
384 | id = add_ibss(dev[1], ssid, key_mgmt="NONE", beacon_int="200", freq=5180) | |
385 | connect_ibss_cmd(dev[1], id, freq=5180) | |
386 | bssid1 = wait_ibss_connection(dev[1]) | |
387 | if bssid0 != bssid1: | |
388 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
389 | ||
390 | dev[0].request("DISCONNECT") | |
391 | dev[1].request("DISCONNECT") | |
392 | dev[0].dump_monitor() | |
393 | dev[1].dump_monitor() | |
8aab5246 | 394 | |
13f6ef9c JM |
395 | def test_ibss_vht_80p80(dev): |
396 | """IBSS on VHT 80+80 MHz channel""" | |
397 | try: | |
398 | _test_ibss_vht_80p80(dev) | |
399 | finally: | |
400 | subprocess.call(['iw', 'reg', 'set', '00']) | |
401 | dev[0].flush_scan_cache() | |
402 | dev[1].flush_scan_cache() | |
403 | ||
404 | def _test_ibss_vht_80p80(dev): | |
405 | subprocess.call(['iw', 'reg', 'set', 'US']) | |
406 | for i in range(2): | |
407 | for j in range(5): | |
408 | ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) | |
409 | if ev is None: | |
410 | raise Exception("No regdom change event") | |
411 | if "alpha2=US" in ev: | |
412 | break | |
413 | dev[i].dump_monitor() | |
414 | ||
415 | ssid="ibss" | |
416 | id = add_ibss(dev[0], ssid, key_mgmt="NONE", freq=5180, chwidth=3) | |
417 | connect_ibss_cmd(dev[0], id, freq=5180) | |
418 | bssid0 = wait_ibss_connection(dev[0]) | |
419 | sig = dev[0].request("SIGNAL_POLL").splitlines() | |
420 | if "FREQUENCY=5180" not in sig: | |
421 | raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig)) | |
422 | if "WIDTH=80+80 MHz" not in sig: | |
423 | raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) | |
424 | if "CENTER_FRQ1=5210" not in sig: | |
425 | raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig)) | |
426 | if "CENTER_FRQ2=5775" not in sig: | |
427 | raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig)) | |
428 | ||
429 | dev[1].scan_for_bss(bssid0, freq=5180) | |
430 | id = add_ibss(dev[1], ssid, key_mgmt="NONE", freq=5180, chwidth=3) | |
431 | connect_ibss_cmd(dev[1], id, freq=5180) | |
432 | bssid1 = wait_ibss_connection(dev[1]) | |
433 | if bssid0 != bssid1: | |
434 | logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1) | |
435 | ||
436 | sig = dev[1].request("SIGNAL_POLL").splitlines() | |
437 | if "FREQUENCY=5180" not in sig: | |
438 | raise Exception("Unexpected SIGNAL_POLL value(1b): " + str(sig)) | |
439 | logger.info("STA1 SIGNAL_POLL: " + str(sig)) | |
440 | # For now, don't report errors on joining STA failing to get 80+80 MHZ | |
441 | # since mac80211 missed functionality for that to work. | |
442 | ||
443 | dev[0].request("DISCONNECT") | |
444 | dev[1].request("DISCONNECT") | |
445 | dev[0].dump_monitor() | |
446 | dev[1].dump_monitor() | |
447 | ||
8aab5246 JM |
448 | def test_ibss_rsn_oom(dev): |
449 | """IBSS RSN OOM during wpa_init""" | |
450 | with alloc_fail(dev[0], 1, "wpa_init"): | |
451 | ssid="ibss-rsn" | |
452 | id = add_ibss_rsn(dev[0], ssid) | |
453 | connect_ibss_cmd(dev[0], id) | |
454 | bssid0 = wait_ibss_connection(dev[0]) |