1#!/usr/bin/env python3
2#
3#   Copyright 2019 - The Android Open Source Project
4#
5#   Licensed under the Apache License, Version 2.0 (the "License");
6#   you may not use this file except in compliance with the License.
7#   You may obtain a copy of the License at
8#
9#       http://www.apache.org/licenses/LICENSE-2.0
10#
11#   Unless required by applicable law or agreed to in writing, software
12#   distributed under the License is distributed on an "AS IS" BASIS,
13#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14#   See the License for the specific language governing permissions and
15#   limitations under the License.
16
17from acts import asserts
18from acts import utils
19
20from acts.controllers.access_point import setup_ap
21from acts.controllers.ap_lib import hostapd_ap_preset
22from acts.controllers.ap_lib import hostapd_constants
23from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
24from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
25from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
26
27
28class WlanPhyComplianceABGTest(AbstractDeviceWlanDeviceBaseTest):
29    """Tests for validating 11a, 11b, and 11g PHYS.
30
31    Test Bed Requirement:
32    * One Android device or Fuchsia device
33    * One Access Point
34    """
35    def setup_class(self):
36        super().setup_class()
37        if 'dut' in self.user_params:
38            if self.user_params['dut'] == 'fuchsia_devices':
39                self.dut = create_wlan_device(self.fuchsia_devices[0])
40            elif self.user_params['dut'] == 'android_devices':
41                self.dut = create_wlan_device(self.android_devices[0])
42            else:
43                raise ValueError('Invalid DUT specified in config. (%s)' %
44                                 self.user_params['dut'])
45        else:
46            # Default is an android device, just like the other tests
47            self.dut = create_wlan_device(self.android_devices[0])
48
49        self.access_point = self.access_points[0]
50        open_network = self.get_open_network(False, [])
51        open_network_min_len = self.get_open_network(
52            False, [],
53            ssid_length_2g=hostapd_constants.AP_SSID_MIN_LENGTH_2G,
54            ssid_length_5g=hostapd_constants.AP_SSID_MIN_LENGTH_5G)
55        open_network_max_len = self.get_open_network(
56            False, [],
57            ssid_length_2g=hostapd_constants.AP_SSID_MAX_LENGTH_2G,
58            ssid_length_5g=hostapd_constants.AP_SSID_MAX_LENGTH_5G)
59        self.open_network_2g = open_network['2g']
60        self.open_network_5g = open_network['5g']
61        self.open_network_max_len_2g = open_network_max_len['2g']
62        self.open_network_max_len_2g['SSID'] = (
63            self.open_network_max_len_2g['SSID'][3:])
64        self.open_network_max_len_5g = open_network_max_len['5g']
65        self.open_network_max_len_5g['SSID'] = (
66            self.open_network_max_len_5g['SSID'][3:])
67        self.open_network_min_len_2g = open_network_min_len['2g']
68        self.open_network_min_len_2g['SSID'] = (
69            self.open_network_min_len_2g['SSID'][3:])
70        self.open_network_min_len_5g = open_network_min_len['5g']
71        self.open_network_min_len_5g['SSID'] = (
72            self.open_network_min_len_5g['SSID'][3:])
73
74        self.utf8_ssid_2g = '2��_������������'
75        self.utf8_ssid_5g = '5��_������������'
76
77        self.utf8_ssid_2g_french = 'Château du Feÿ'
78        self.utf8_password_2g_french = 'du Feÿ Château'
79
80        self.utf8_ssid_2g_german = 'Rat für Straßenatlas'
81        self.utf8_password_2g_german = 'für Straßenatlas Rat'
82
83        self.utf8_ssid_2g_dutch = 'Die niet óúd, is níéuw!'
84        self.utf8_password_2g_dutch = 'niet óúd, is níéuw! Die'
85
86        self.utf8_ssid_2g_swedish = 'Det är femtioåtta'
87        self.utf8_password_2g_swedish = 'femtioåtta Det är'
88
89        self.utf8_ssid_2g_norwegian = 'Curaçao ØÆ æ å å å'
90        self.utf8_password_2g_norwegian = 'ØÆ Curaçao æ å å å'
91
92        #Danish and Norwegian has the same alphabet
93        self.utf8_ssid_2g_danish = self.utf8_ssid_2g_norwegian
94        self.utf8_password_2g_danish = self.utf8_password_2g_norwegian
95
96        self.utf8_ssid_2g_japanese = 'あなた はお母さん'
97        self.utf8_password_2g_japanese = 'そっくりね。あな'
98
99        self.utf8_ssid_2g_spanish = '¡No á,é,í,ó,ú,ü,ñ,¿,¡'
100        self.utf8_password_2g_spanish = 'á,é,í,ó,ú,ü,ñ,¿,¡ ¡No'
101
102        self.utf8_ssid_2g_italian = 'caffè Pinocchio è italiano?'
103        self.utf8_password_2g_italian = 'Pinocchio è italiano? caffè'
104
105        self.utf8_ssid_2g_korean = 'ㅘㅙㅚㅛㅜㅝㅞㅟㅠ'
106        self.utf8_password_2g_korean = 'ㅜㅝㅞㅟㅠㅘㅙㅚㅛ'
107
108        self.access_point.stop_all_aps()
109
110    def setup_test(self):
111        if hasattr(self, "android_devices"):
112            for ad in self.android_devices:
113                ad.droid.wakeLockAcquireBright()
114                ad.droid.wakeUpNow()
115        self.dut.wifi_toggle_state(True)
116
117    def teardown_test(self):
118        if hasattr(self, "android_devices"):
119            for ad in self.android_devices:
120                ad.droid.wakeLockRelease()
121                ad.droid.goToSleepNow()
122        self.dut.turn_location_off_and_scan_toggle_off()
123        self.dut.disconnect()
124        self.dut.reset_wifi()
125        self.access_point.stop_all_aps()
126
127    def on_fail(self, test_name, begin_time):
128        super().on_fail(test_name, begin_time)
129        self.access_point.stop_all_aps()
130
131    def test_associate_11b_only_long_preamble(self):
132        setup_ap(access_point=self.access_point,
133                 profile_name='whirlwind_11ab_legacy',
134                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
135                 ssid=self.open_network_2g['SSID'],
136                 preamble=False)
137        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
138                            'Failed to associate.')
139
140    def test_associate_11b_only_short_preamble(self):
141        setup_ap(access_point=self.access_point,
142                 profile_name='whirlwind_11ab_legacy',
143                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
144                 ssid=self.open_network_2g['SSID'],
145                 preamble=True)
146        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
147                            'Failed to associate.')
148
149    def test_associate_11b_only_minimal_beacon_interval(self):
150        setup_ap(access_point=self.access_point,
151                 profile_name='whirlwind_11ab_legacy',
152                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
153                 ssid=self.open_network_2g['SSID'],
154                 beacon_interval=15)
155        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
156                            'Failed to associate.')
157
158    def test_associate_11b_only_maximum_beacon_interval(self):
159        setup_ap(access_point=self.access_point,
160                 profile_name='whirlwind_11ab_legacy',
161                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
162                 ssid=self.open_network_2g['SSID'],
163                 beacon_interval=1024)
164        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
165                            'Failed to associate.')
166
167    def test_associate_11b_only_frag_threshold_430(self):
168        setup_ap(access_point=self.access_point,
169                 profile_name='whirlwind_11ab_legacy',
170                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
171                 ssid=self.open_network_2g['SSID'],
172                 frag_threshold=430)
173        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
174                            'Failed to associate.')
175
176    def test_associate_11b_only_rts_threshold_256(self):
177        setup_ap(access_point=self.access_point,
178                 profile_name='whirlwind_11ab_legacy',
179                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
180                 ssid=self.open_network_2g['SSID'],
181                 rts_threshold=256)
182        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
183                            'Failed to associate.')
184
185    def test_associate_11b_only_rts_256_frag_430(self):
186        setup_ap(access_point=self.access_point,
187                 profile_name='whirlwind_11ab_legacy',
188                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
189                 ssid=self.open_network_2g['SSID'],
190                 rts_threshold=256,
191                 frag_threshold=430)
192        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
193                            'Failed to associate.')
194
195    def test_associate_11b_only_high_dtim_low_beacon_interval(self):
196        setup_ap(access_point=self.access_point,
197                 profile_name='whirlwind_11ab_legacy',
198                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
199                 ssid=self.open_network_2g['SSID'],
200                 dtim_period=3,
201                 beacon_interval=100)
202        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
203                            'Failed to associate.')
204
205    def test_associate_11b_only_low_dtim_high_beacon_interval(self):
206        setup_ap(access_point=self.access_point,
207                 profile_name='whirlwind_11ab_legacy',
208                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
209                 ssid=self.open_network_2g['SSID'],
210                 dtim_period=1,
211                 beacon_interval=300)
212        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
213                            'Failed to associate.')
214
215    def test_associate_11b_only_with_WMM_with_default_values(self):
216        setup_ap(
217            access_point=self.access_point,
218            profile_name='whirlwind_11ab_legacy',
219            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
220            ssid=self.open_network_2g['SSID'],
221            force_wmm=True,
222            additional_ap_parameters=hostapd_constants.WMM_11B_DEFAULT_PARAMS)
223        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
224                            'Failed to associate.')
225
226    def test_associate_11b_only_with_WMM_with_non_default_values(self):
227        setup_ap(
228            access_point=self.access_point,
229            profile_name='whirlwind_11ab_legacy',
230            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
231            ssid=self.open_network_2g['SSID'],
232            force_wmm=True,
233            additional_ap_parameters=hostapd_constants.WMM_NON_DEFAULT_PARAMS)
234        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
235                            'Failed to associate.')
236
237    def test_associate_11b_only_with_WMM_ACM_on_BK(self):
238        wmm_acm_bits_enabled = utils.merge_dicts(
239            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
240            hostapd_constants.WMM_ACM_BK)
241        setup_ap(access_point=self.access_point,
242                 profile_name='whirlwind_11ab_legacy',
243                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
244                 ssid=self.open_network_2g['SSID'],
245                 force_wmm=True,
246                 additional_ap_parameters=wmm_acm_bits_enabled)
247        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
248                            'Failed to associate.')
249
250    def test_associate_11b_only_with_WMM_ACM_on_BE(self):
251        wmm_acm_bits_enabled = utils.merge_dicts(
252            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
253            hostapd_constants.WMM_ACM_BE)
254        setup_ap(access_point=self.access_point,
255                 profile_name='whirlwind_11ab_legacy',
256                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
257                 ssid=self.open_network_2g['SSID'],
258                 force_wmm=True,
259                 additional_ap_parameters=wmm_acm_bits_enabled)
260        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
261                            'Failed to associate.')
262
263    def test_associate_11b_only_with_WMM_ACM_on_VI(self):
264        wmm_acm_bits_enabled = utils.merge_dicts(
265            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
266            hostapd_constants.WMM_ACM_VI)
267        setup_ap(access_point=self.access_point,
268                 profile_name='whirlwind_11ab_legacy',
269                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
270                 ssid=self.open_network_2g['SSID'],
271                 force_wmm=True,
272                 additional_ap_parameters=wmm_acm_bits_enabled)
273        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
274                            'Failed to associate.')
275
276    def test_associate_11b_only_with_WMM_ACM_on_VO(self):
277        wmm_acm_bits_enabled = utils.merge_dicts(
278            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
279            hostapd_constants.WMM_ACM_VO)
280        setup_ap(access_point=self.access_point,
281                 profile_name='whirlwind_11ab_legacy',
282                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
283                 ssid=self.open_network_2g['SSID'],
284                 force_wmm=True,
285                 additional_ap_parameters=wmm_acm_bits_enabled)
286        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
287                            'Failed to associate.')
288
289    def test_associate_11b_only_with_WMM_ACM_on_BK_BE_VI(self):
290        wmm_acm_bits_enabled = utils.merge_dicts(
291            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
292            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
293            hostapd_constants.WMM_ACM_VI)
294        setup_ap(access_point=self.access_point,
295                 profile_name='whirlwind_11ab_legacy',
296                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
297                 ssid=self.open_network_2g['SSID'],
298                 force_wmm=True,
299                 additional_ap_parameters=wmm_acm_bits_enabled)
300        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
301                            'Failed to associate.')
302
303    def test_associate_11b_only_with_WMM_ACM_on_BK_BE_VO(self):
304        wmm_acm_bits_enabled = utils.merge_dicts(
305            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
306            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
307            hostapd_constants.WMM_ACM_VO)
308        setup_ap(access_point=self.access_point,
309                 profile_name='whirlwind_11ab_legacy',
310                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
311                 ssid=self.open_network_2g['SSID'],
312                 force_wmm=True,
313                 additional_ap_parameters=wmm_acm_bits_enabled)
314        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
315                            'Failed to associate.')
316
317    def test_associate_11b_only_with_WMM_ACM_on_BK_VI_VO(self):
318        wmm_acm_bits_enabled = utils.merge_dicts(
319            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
320            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_VI,
321            hostapd_constants.WMM_ACM_VO)
322        setup_ap(access_point=self.access_point,
323                 profile_name='whirlwind_11ab_legacy',
324                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
325                 ssid=self.open_network_2g['SSID'],
326                 force_wmm=True,
327                 additional_ap_parameters=wmm_acm_bits_enabled)
328        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
329                            'Failed to associate.')
330
331    def test_associate_11b_only_with_WMM_ACM_on_BE_VI_VO(self):
332        wmm_acm_bits_enabled = utils.merge_dicts(
333            hostapd_constants.WMM_11B_DEFAULT_PARAMS,
334            hostapd_constants.WMM_ACM_BE, hostapd_constants.WMM_ACM_VI,
335            hostapd_constants.WMM_ACM_VO)
336        setup_ap(access_point=self.access_point,
337                 profile_name='whirlwind_11ab_legacy',
338                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
339                 ssid=self.open_network_2g['SSID'],
340                 force_wmm=True,
341                 additional_ap_parameters=wmm_acm_bits_enabled)
342        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
343                            'Failed to associate.')
344
345    def test_associate_11b_only_with_country_code(self):
346        country_info = utils.merge_dicts(
347            hostapd_constants.ENABLE_IEEE80211D,
348            hostapd_constants.COUNTRY_STRING['ALL'],
349            hostapd_constants.COUNTRY_CODE['UNITED_STATES'])
350        setup_ap(access_point=self.access_point,
351                 profile_name='whirlwind_11ab_legacy',
352                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
353                 ssid=self.open_network_2g['SSID'],
354                 additional_ap_parameters=country_info)
355        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
356                            'Failed to associate.')
357
358    def test_associate_11b_only_with_non_country_code(self):
359        country_info = utils.merge_dicts(
360            hostapd_constants.ENABLE_IEEE80211D,
361            hostapd_constants.COUNTRY_STRING['ALL'],
362            hostapd_constants.COUNTRY_CODE['NON_COUNTRY'])
363        setup_ap(access_point=self.access_point,
364                 profile_name='whirlwind_11ab_legacy',
365                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
366                 ssid=self.open_network_2g['SSID'],
367                 additional_ap_parameters=country_info)
368        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
369                            'Failed to associate.')
370
371    def test_associate_11b_only_with_hidden_ssid(self):
372        setup_ap(access_point=self.access_point,
373                 profile_name='whirlwind_11ab_legacy',
374                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
375                 ssid=self.open_network_2g['SSID'],
376                 hidden=True)
377        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
378                            'Failed to associate.')
379
380    def test_associate_11b_only_with_vendor_ie_in_beacon_correct_length(self):
381        setup_ap(access_point=self.access_point,
382                 profile_name='whirlwind_11ab_legacy',
383                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
384                 ssid=self.open_network_2g['SSID'],
385                 additional_ap_parameters=hostapd_constants.
386                 VENDOR_IE['correct_length_beacon'])
387        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
388                            'Failed to associate.')
389
390    def test_associate_11b_only_with_vendor_ie_in_beacon_zero_length(self):
391        setup_ap(access_point=self.access_point,
392                 profile_name='whirlwind_11ab_legacy',
393                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
394                 ssid=self.open_network_2g['SSID'],
395                 additional_ap_parameters=hostapd_constants.
396                 VENDOR_IE['zero_length_beacon_without_data'])
397        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
398                            'Failed to associate.')
399
400    def test_associate_11b_only_with_vendor_ie_in_assoc_correct_length(self):
401        setup_ap(access_point=self.access_point,
402                 profile_name='whirlwind_11ab_legacy',
403                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
404                 ssid=self.open_network_2g['SSID'],
405                 additional_ap_parameters=hostapd_constants.
406                 VENDOR_IE['correct_length_association_response'])
407        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
408                            'Failed to associate.')
409
410    def test_associate_11b_only_with_vendor_ie_in_assoc_zero_length(self):
411        setup_ap(access_point=self.access_point,
412                 profile_name='whirlwind_11ab_legacy',
413                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
414                 ssid=self.open_network_2g['SSID'],
415                 additional_ap_parameters=hostapd_constants.VENDOR_IE[
416                     'zero_length_association_'
417                     'response_without_data'])
418        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
419                            'Failed to associate.')
420
421    def test_associate_11a_only_long_preamble(self):
422        setup_ap(access_point=self.access_point,
423                 profile_name='whirlwind_11ab_legacy',
424                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
425                 ssid=self.open_network_5g['SSID'],
426                 preamble=False)
427        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
428                            'Failed to associate.')
429
430    def test_associate_11a_only_short_preamble(self):
431        setup_ap(access_point=self.access_point,
432                 profile_name='whirlwind_11ab_legacy',
433                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
434                 ssid=self.open_network_5g['SSID'],
435                 preamble=True)
436        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
437                            'Failed to associate.')
438
439    def test_associate_11a_only_minimal_beacon_interval(self):
440        setup_ap(access_point=self.access_point,
441                 profile_name='whirlwind_11ab_legacy',
442                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
443                 ssid=self.open_network_5g['SSID'],
444                 beacon_interval=15)
445        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
446                            'Failed to associate.')
447
448    def test_associate_11a_only_maximum_beacon_interval(self):
449        setup_ap(access_point=self.access_point,
450                 profile_name='whirlwind_11ab_legacy',
451                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
452                 ssid=self.open_network_5g['SSID'],
453                 beacon_interval=1024)
454        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
455                            'Failed to associate.')
456
457    def test_associate_11a_only_frag_threshold_430(self):
458        setup_ap(access_point=self.access_point,
459                 profile_name='whirlwind_11ab_legacy',
460                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
461                 ssid=self.open_network_5g['SSID'],
462                 frag_threshold=430)
463        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
464                            'Failed to associate.')
465
466    def test_associate_11a_only_rts_threshold_256(self):
467        setup_ap(access_point=self.access_point,
468                 profile_name='whirlwind_11ab_legacy',
469                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
470                 ssid=self.open_network_5g['SSID'],
471                 rts_threshold=256)
472        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
473                            'Failed to associate.')
474
475    def test_associate_11a_only_rts_256_frag_430(self):
476        setup_ap(access_point=self.access_point,
477                 profile_name='whirlwind_11ab_legacy',
478                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
479                 ssid=self.open_network_5g['SSID'],
480                 rts_threshold=256,
481                 frag_threshold=430)
482        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
483                            'Failed to associate.')
484
485    def test_associate_11a_only_high_dtim_low_beacon_interval(self):
486        setup_ap(access_point=self.access_point,
487                 profile_name='whirlwind_11ab_legacy',
488                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
489                 ssid=self.open_network_5g['SSID'],
490                 dtim_period=3,
491                 beacon_interval=100)
492        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
493                            'Failed to associate.')
494
495    def test_associate_11a_only_low_dtim_high_beacon_interval(self):
496        setup_ap(access_point=self.access_point,
497                 profile_name='whirlwind_11ab_legacy',
498                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
499                 ssid=self.open_network_5g['SSID'],
500                 dtim_period=1,
501                 beacon_interval=300)
502        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
503                            'Failed to associate.')
504
505    def test_associate_11a_only_with_WMM_with_default_values(self):
506        setup_ap(access_point=self.access_point,
507                 profile_name='whirlwind_11ab_legacy',
508                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
509                 ssid=self.open_network_5g['SSID'],
510                 force_wmm=True,
511                 additional_ap_parameters=hostapd_constants.
512                 WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS)
513        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
514                            'Failed to associate.')
515
516    def test_associate_11a_only_with_WMM_with_non_default_values(self):
517        setup_ap(
518            access_point=self.access_point,
519            profile_name='whirlwind_11ab_legacy',
520            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
521            ssid=self.open_network_5g['SSID'],
522            force_wmm=True,
523            additional_ap_parameters=hostapd_constants.WMM_NON_DEFAULT_PARAMS)
524        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
525                            'Failed to associate.')
526
527    def test_associate_11a_only_with_WMM_ACM_on_BK(self):
528        wmm_acm_bits_enabled = utils.merge_dicts(
529            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
530            hostapd_constants.WMM_ACM_BK)
531        setup_ap(access_point=self.access_point,
532                 profile_name='whirlwind_11ab_legacy',
533                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
534                 ssid=self.open_network_5g['SSID'],
535                 force_wmm=True,
536                 additional_ap_parameters=wmm_acm_bits_enabled)
537        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
538                            'Failed to associate.')
539
540    def test_associate_11a_only_with_WMM_ACM_on_BE(self):
541        wmm_acm_bits_enabled = utils.merge_dicts(
542            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
543            hostapd_constants.WMM_ACM_BE)
544        setup_ap(access_point=self.access_point,
545                 profile_name='whirlwind_11ab_legacy',
546                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
547                 ssid=self.open_network_5g['SSID'],
548                 force_wmm=True,
549                 additional_ap_parameters=wmm_acm_bits_enabled)
550        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
551                            'Failed to associate.')
552
553    def test_associate_11a_only_with_WMM_ACM_on_VI(self):
554        wmm_acm_bits_enabled = utils.merge_dicts(
555            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
556            hostapd_constants.WMM_ACM_VI)
557        setup_ap(access_point=self.access_point,
558                 profile_name='whirlwind_11ab_legacy',
559                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
560                 ssid=self.open_network_5g['SSID'],
561                 force_wmm=True,
562                 additional_ap_parameters=wmm_acm_bits_enabled)
563        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
564                            'Failed to associate.')
565
566    def test_associate_11a_only_with_WMM_ACM_on_VO(self):
567        wmm_acm_bits_enabled = utils.merge_dicts(
568            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
569            hostapd_constants.WMM_ACM_VO)
570        setup_ap(access_point=self.access_point,
571                 profile_name='whirlwind_11ab_legacy',
572                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
573                 ssid=self.open_network_5g['SSID'],
574                 force_wmm=True,
575                 additional_ap_parameters=wmm_acm_bits_enabled)
576        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
577                            'Failed to associate.')
578
579    def test_associate_11a_only_with_WMM_ACM_on_BK_BE_VI(self):
580        wmm_acm_bits_enabled = utils.merge_dicts(
581            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
582            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
583            hostapd_constants.WMM_ACM_VI)
584        setup_ap(access_point=self.access_point,
585                 profile_name='whirlwind_11ab_legacy',
586                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
587                 ssid=self.open_network_5g['SSID'],
588                 force_wmm=True,
589                 additional_ap_parameters=wmm_acm_bits_enabled)
590        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
591                            'Failed to associate.')
592
593    def test_associate_11a_only_with_WMM_ACM_on_BK_BE_VO(self):
594        wmm_acm_bits_enabled = utils.merge_dicts(
595            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
596            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
597            hostapd_constants.WMM_ACM_VO)
598        setup_ap(access_point=self.access_point,
599                 profile_name='whirlwind_11ab_legacy',
600                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
601                 ssid=self.open_network_5g['SSID'],
602                 force_wmm=True,
603                 additional_ap_parameters=wmm_acm_bits_enabled)
604        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
605                            'Failed to associate.')
606
607    def test_associate_11a_only_with_WMM_ACM_on_BK_VI_VO(self):
608        wmm_acm_bits_enabled = utils.merge_dicts(
609            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
610            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_VI,
611            hostapd_constants.WMM_ACM_VO)
612        setup_ap(access_point=self.access_point,
613                 profile_name='whirlwind_11ab_legacy',
614                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
615                 ssid=self.open_network_5g['SSID'],
616                 force_wmm=True,
617                 additional_ap_parameters=wmm_acm_bits_enabled)
618        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
619                            'Failed to associate.')
620
621    def test_associate_11a_only_with_WMM_ACM_on_BE_VI_VO(self):
622        wmm_acm_bits_enabled = utils.merge_dicts(
623            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
624            hostapd_constants.WMM_ACM_BE, hostapd_constants.WMM_ACM_VI,
625            hostapd_constants.WMM_ACM_VO)
626        setup_ap(access_point=self.access_point,
627                 profile_name='whirlwind_11ab_legacy',
628                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
629                 ssid=self.open_network_5g['SSID'],
630                 force_wmm=True,
631                 additional_ap_parameters=wmm_acm_bits_enabled)
632        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
633                            'Failed to associate.')
634
635    def test_associate_11a_only_with_country_code(self):
636        country_info = utils.merge_dicts(
637            hostapd_constants.ENABLE_IEEE80211D,
638            hostapd_constants.COUNTRY_STRING['ALL'],
639            hostapd_constants.COUNTRY_CODE['UNITED_STATES'])
640        setup_ap(access_point=self.access_point,
641                 profile_name='whirlwind_11ab_legacy',
642                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
643                 ssid=self.open_network_5g['SSID'],
644                 additional_ap_parameters=country_info)
645        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
646                            'Failed to associate.')
647
648    def test_associate_11a_only_with_non_country_code(self):
649        country_info = utils.merge_dicts(
650            hostapd_constants.ENABLE_IEEE80211D,
651            hostapd_constants.COUNTRY_STRING['ALL'],
652            hostapd_constants.COUNTRY_CODE['NON_COUNTRY'])
653        setup_ap(access_point=self.access_point,
654                 profile_name='whirlwind_11ab_legacy',
655                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
656                 ssid=self.open_network_5g['SSID'],
657                 additional_ap_parameters=country_info)
658        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
659                            'Failed to associate.')
660
661    def test_associate_11a_only_with_hidden_ssid(self):
662        setup_ap(access_point=self.access_point,
663                 profile_name='whirlwind_11ab_legacy',
664                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
665                 ssid=self.open_network_5g['SSID'],
666                 hidden=True)
667        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
668                            'Failed to associate.')
669
670    def test_associate_11a_only_with_vendor_ie_in_beacon_correct_length(self):
671        setup_ap(access_point=self.access_point,
672                 profile_name='whirlwind_11ab_legacy',
673                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
674                 ssid=self.open_network_5g['SSID'],
675                 additional_ap_parameters=hostapd_constants.
676                 VENDOR_IE['correct_length_beacon'])
677        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
678                            'Failed to associate.')
679
680    def test_associate_11a_only_with_vendor_ie_in_beacon_zero_length(self):
681        setup_ap(access_point=self.access_point,
682                 profile_name='whirlwind_11ab_legacy',
683                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
684                 ssid=self.open_network_5g['SSID'],
685                 additional_ap_parameters=hostapd_constants.
686                 VENDOR_IE['zero_length_beacon_without_data'])
687        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
688                            'Failed to associate.')
689
690    def test_associate_11a_only_with_vendor_ie_in_assoc_correct_length(self):
691        setup_ap(access_point=self.access_point,
692                 profile_name='whirlwind_11ab_legacy',
693                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
694                 ssid=self.open_network_5g['SSID'],
695                 additional_ap_parameters=hostapd_constants.
696                 VENDOR_IE['correct_length_association_response'])
697        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
698                            'Failed to associate.')
699
700    def test_associate_11a_only_with_vendor_ie_in_assoc_zero_length(self):
701        setup_ap(access_point=self.access_point,
702                 profile_name='whirlwind_11ab_legacy',
703                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
704                 ssid=self.open_network_5g['SSID'],
705                 additional_ap_parameters=hostapd_constants.VENDOR_IE[
706                     'zero_length_association_'
707                     'response_without_data'])
708        asserts.assert_true(self.dut.associate(self.open_network_5g['SSID']),
709                            'Failed to associate.')
710
711    def test_associate_11g_only_long_preamble(self):
712        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
713                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
714        setup_ap(access_point=self.access_point,
715                 profile_name='whirlwind_11ag_legacy',
716                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
717                 ssid=self.open_network_2g['SSID'],
718                 preamble=False,
719                 additional_ap_parameters=data_rates)
720        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
721                            'Failed to associate.')
722
723    def test_associate_11g_only_short_preamble(self):
724        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
725                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
726        setup_ap(access_point=self.access_point,
727                 profile_name='whirlwind_11ag_legacy',
728                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
729                 ssid=self.open_network_2g['SSID'],
730                 preamble=True,
731                 additional_ap_parameters=data_rates)
732        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
733                            'Failed to associate.')
734
735    def test_associate_11g_only_minimal_beacon_interval(self):
736        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
737                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
738        setup_ap(access_point=self.access_point,
739                 profile_name='whirlwind_11ag_legacy',
740                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
741                 ssid=self.open_network_2g['SSID'],
742                 beacon_interval=15,
743                 additional_ap_parameters=data_rates)
744        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
745                            'Failed to associate.')
746
747    def test_associate_11g_only_maximum_beacon_interval(self):
748        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
749                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
750        setup_ap(access_point=self.access_point,
751                 profile_name='whirlwind_11ag_legacy',
752                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
753                 ssid=self.open_network_2g['SSID'],
754                 beacon_interval=1024,
755                 additional_ap_parameters=data_rates)
756        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
757                            'Failed to associate.')
758
759    def test_associate_11g_only_frag_threshold_430(self):
760        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
761                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
762        setup_ap(access_point=self.access_point,
763                 profile_name='whirlwind_11ag_legacy',
764                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
765                 ssid=self.open_network_2g['SSID'],
766                 frag_threshold=430,
767                 additional_ap_parameters=data_rates)
768        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
769                            'Failed to associate.')
770
771    def test_associate_11g_only_rts_threshold_256(self):
772        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
773                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
774        setup_ap(access_point=self.access_point,
775                 profile_name='whirlwind_11ag_legacy',
776                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
777                 ssid=self.open_network_2g['SSID'],
778                 rts_threshold=256,
779                 additional_ap_parameters=data_rates)
780        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
781                            'Failed to associate.')
782
783    def test_associate_11g_only_rts_256_frag_430(self):
784        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
785                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
786        setup_ap(access_point=self.access_point,
787                 profile_name='whirlwind_11ag_legacy',
788                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
789                 ssid=self.open_network_2g['SSID'],
790                 rts_threshold=256,
791                 frag_threshold=430,
792                 additional_ap_parameters=data_rates)
793        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
794                            'Failed to associate.')
795
796    def test_associate_11g_only_high_dtim_low_beacon_interval(self):
797        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
798                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
799        setup_ap(access_point=self.access_point,
800                 profile_name='whirlwind_11ag_legacy',
801                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
802                 ssid=self.open_network_2g['SSID'],
803                 dtim_period=3,
804                 beacon_interval=100,
805                 additional_ap_parameters=data_rates)
806        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
807                            'Failed to associate.')
808
809    def test_associate_11g_only_low_dtim_high_beacon_interval(self):
810        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
811                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
812        setup_ap(access_point=self.access_point,
813                 profile_name='whirlwind_11ag_legacy',
814                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
815                 ssid=self.open_network_2g['SSID'],
816                 dtim_period=1,
817                 beacon_interval=300,
818                 additional_ap_parameters=data_rates)
819        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
820                            'Failed to associate.')
821
822    def test_associate_11g_only_with_WMM_with_default_values(self):
823        data_rates = utils.merge_dicts(
824            hostapd_constants.OFDM_DATA_RATES,
825            hostapd_constants.OFDM_ONLY_BASIC_RATES,
826            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS)
827        setup_ap(access_point=self.access_point,
828                 profile_name='whirlwind_11ag_legacy',
829                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
830                 ssid=self.open_network_2g['SSID'],
831                 force_wmm=True,
832                 additional_ap_parameters=data_rates)
833        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
834                            'Failed to associate.')
835
836    def test_associate_11g_only_with_WMM_with_non_default_values(self):
837        data_rates = utils.merge_dicts(
838            hostapd_constants.OFDM_DATA_RATES,
839            hostapd_constants.OFDM_ONLY_BASIC_RATES,
840            hostapd_constants.WMM_NON_DEFAULT_PARAMS)
841        setup_ap(access_point=self.access_point,
842                 profile_name='whirlwind_11ag_legacy',
843                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
844                 ssid=self.open_network_2g['SSID'],
845                 force_wmm=True,
846                 additional_ap_parameters=data_rates)
847        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
848                            'Failed to associate.')
849
850    def test_associate_11g_only_with_WMM_ACM_on_BK(self):
851        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
852                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
853        wmm_acm_bits_enabled = utils.merge_dicts(
854            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
855            hostapd_constants.WMM_ACM_BK, data_rates)
856        setup_ap(access_point=self.access_point,
857                 profile_name='whirlwind_11ag_legacy',
858                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
859                 ssid=self.open_network_2g['SSID'],
860                 force_wmm=True,
861                 additional_ap_parameters=wmm_acm_bits_enabled)
862        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
863                            'Failed to associate.')
864
865    def test_associate_11g_only_with_WMM_ACM_on_BE(self):
866        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
867                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
868        wmm_acm_bits_enabled = utils.merge_dicts(
869            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
870            hostapd_constants.WMM_ACM_BE, data_rates)
871        setup_ap(access_point=self.access_point,
872                 profile_name='whirlwind_11ag_legacy',
873                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
874                 ssid=self.open_network_2g['SSID'],
875                 force_wmm=True,
876                 additional_ap_parameters=wmm_acm_bits_enabled)
877        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
878                            'Failed to associate.')
879
880    def test_associate_11g_only_with_WMM_ACM_on_VI(self):
881        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
882                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
883        wmm_acm_bits_enabled = utils.merge_dicts(
884            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
885            hostapd_constants.WMM_ACM_VI, data_rates)
886        setup_ap(access_point=self.access_point,
887                 profile_name='whirlwind_11ag_legacy',
888                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
889                 ssid=self.open_network_2g['SSID'],
890                 force_wmm=True,
891                 additional_ap_parameters=wmm_acm_bits_enabled)
892        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
893                            'Failed to associate.')
894
895    def test_associate_11g_only_with_WMM_ACM_on_VO(self):
896        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
897                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
898        wmm_acm_bits_enabled = utils.merge_dicts(
899            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
900            hostapd_constants.WMM_ACM_VO, data_rates)
901        setup_ap(access_point=self.access_point,
902                 profile_name='whirlwind_11ag_legacy',
903                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
904                 ssid=self.open_network_2g['SSID'],
905                 force_wmm=True,
906                 additional_ap_parameters=wmm_acm_bits_enabled)
907        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
908                            'Failed to associate.')
909
910    def test_associate_11g_only_with_WMM_ACM_on_BK_BE_VI(self):
911        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
912                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
913        wmm_acm_bits_enabled = utils.merge_dicts(
914            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
915            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
916            hostapd_constants.WMM_ACM_VI, data_rates)
917        setup_ap(access_point=self.access_point,
918                 profile_name='whirlwind_11ag_legacy',
919                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
920                 ssid=self.open_network_2g['SSID'],
921                 force_wmm=True,
922                 additional_ap_parameters=wmm_acm_bits_enabled)
923        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
924                            'Failed to associate.')
925
926    def test_associate_11g_only_with_WMM_ACM_on_BK_BE_VO(self):
927        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
928                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
929        wmm_acm_bits_enabled = utils.merge_dicts(
930            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
931            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
932            hostapd_constants.WMM_ACM_VO, data_rates)
933        setup_ap(access_point=self.access_point,
934                 profile_name='whirlwind_11ag_legacy',
935                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
936                 ssid=self.open_network_2g['SSID'],
937                 force_wmm=True,
938                 additional_ap_parameters=wmm_acm_bits_enabled)
939        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
940                            'Failed to associate.')
941
942    def test_associate_11g_only_with_WMM_ACM_on_BK_VI_VO(self):
943        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
944                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
945        wmm_acm_bits_enabled = utils.merge_dicts(
946            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
947            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_VI,
948            hostapd_constants.WMM_ACM_VO, data_rates)
949        setup_ap(access_point=self.access_point,
950                 profile_name='whirlwind_11ag_legacy',
951                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
952                 ssid=self.open_network_2g['SSID'],
953                 force_wmm=True,
954                 additional_ap_parameters=wmm_acm_bits_enabled)
955        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
956                            'Failed to associate.')
957
958    def test_associate_11g_only_with_WMM_ACM_on_BE_VI_VO(self):
959        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
960                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
961        wmm_acm_bits_enabled = utils.merge_dicts(
962            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
963            hostapd_constants.WMM_ACM_BE, hostapd_constants.WMM_ACM_VI,
964            hostapd_constants.WMM_ACM_VO, data_rates)
965        setup_ap(access_point=self.access_point,
966                 profile_name='whirlwind_11ag_legacy',
967                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
968                 ssid=self.open_network_2g['SSID'],
969                 force_wmm=True,
970                 additional_ap_parameters=wmm_acm_bits_enabled)
971        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
972                            'Failed to associate.')
973
974    def test_associate_11g_only_with_country_code(self):
975        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
976                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
977        country_info = utils.merge_dicts(
978            hostapd_constants.ENABLE_IEEE80211D,
979            hostapd_constants.COUNTRY_STRING['ALL'],
980            hostapd_constants.COUNTRY_CODE['UNITED_STATES'], data_rates)
981        setup_ap(access_point=self.access_point,
982                 profile_name='whirlwind_11ag_legacy',
983                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
984                 ssid=self.open_network_2g['SSID'],
985                 additional_ap_parameters=country_info)
986        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
987                            'Failed to associate.')
988
989    def test_associate_11g_only_with_non_country_code(self):
990        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
991                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
992        country_info = utils.merge_dicts(
993            hostapd_constants.ENABLE_IEEE80211D,
994            hostapd_constants.COUNTRY_STRING['ALL'],
995            hostapd_constants.COUNTRY_CODE['NON_COUNTRY'], data_rates)
996        setup_ap(access_point=self.access_point,
997                 profile_name='whirlwind_11ag_legacy',
998                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
999                 ssid=self.open_network_2g['SSID'],
1000                 additional_ap_parameters=country_info)
1001        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1002                            'Failed to associate.')
1003
1004    def test_associate_11g_only_with_hidden_ssid(self):
1005        data_rates = utils.merge_dicts(hostapd_constants.OFDM_DATA_RATES,
1006                                       hostapd_constants.OFDM_ONLY_BASIC_RATES)
1007        setup_ap(access_point=self.access_point,
1008                 profile_name='whirlwind_11ag_legacy',
1009                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1010                 ssid=self.open_network_2g['SSID'],
1011                 hidden=True,
1012                 additional_ap_parameters=data_rates)
1013        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1014                            'Failed to associate.')
1015
1016    def test_associate_11g_only_with_vendor_ie_in_beacon_correct_length(self):
1017        data_rates = utils.merge_dicts(
1018            hostapd_constants.OFDM_DATA_RATES,
1019            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1020            hostapd_constants.VENDOR_IE['correct_length_beacon'])
1021        setup_ap(access_point=self.access_point,
1022                 profile_name='whirlwind_11ag_legacy',
1023                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1024                 ssid=self.open_network_2g['SSID'],
1025                 additional_ap_parameters=data_rates)
1026        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1027                            'Failed to associate.')
1028
1029    def test_associate_11g_only_with_vendor_ie_in_beacon_zero_length(self):
1030        data_rates = utils.merge_dicts(
1031            hostapd_constants.OFDM_DATA_RATES,
1032            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1033            hostapd_constants.VENDOR_IE['zero_length_beacon_without_data'])
1034        setup_ap(access_point=self.access_point,
1035                 profile_name='whirlwind_11ag_legacy',
1036                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1037                 ssid=self.open_network_2g['SSID'],
1038                 additional_ap_parameters=data_rates)
1039        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1040                            'Failed to associate.')
1041
1042    def test_associate_11g_only_with_vendor_ie_in_assoc_correct_length(self):
1043        data_rates = utils.merge_dicts(
1044            hostapd_constants.OFDM_DATA_RATES,
1045            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1046            hostapd_constants.VENDOR_IE['correct_length_association_response'])
1047        setup_ap(access_point=self.access_point,
1048                 profile_name='whirlwind_11ag_legacy',
1049                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1050                 ssid=self.open_network_2g['SSID'],
1051                 additional_ap_parameters=data_rates)
1052        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1053                            'Failed to associate.')
1054
1055    def test_associate_11g_only_with_vendor_ie_in_assoc_zero_length(self):
1056        data_rates = utils.merge_dicts(
1057            hostapd_constants.OFDM_DATA_RATES,
1058            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1059            hostapd_constants.VENDOR_IE['correct_length_association_response'],
1060            hostapd_constants.VENDOR_IE['zero_length_association_'
1061                                        'response_without_data'])
1062        setup_ap(access_point=self.access_point,
1063                 profile_name='whirlwind_11ag_legacy',
1064                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1065                 ssid=self.open_network_2g['SSID'],
1066                 additional_ap_parameters=data_rates)
1067        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1068                            'Failed to associate.')
1069
1070    def test_associate_11bg_only_long_preamble(self):
1071        setup_ap(access_point=self.access_point,
1072                 profile_name='whirlwind_11ag_legacy',
1073                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1074                 ssid=self.open_network_2g['SSID'],
1075                 preamble=False)
1076        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1077                            'Failed to associate.')
1078
1079    def test_associate_11bg_short_preamble(self):
1080        setup_ap(access_point=self.access_point,
1081                 profile_name='whirlwind_11ag_legacy',
1082                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1083                 ssid=self.open_network_2g['SSID'],
1084                 preamble=True)
1085        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1086                            'Failed to associate.')
1087
1088    def test_associate_11bg_minimal_beacon_interval(self):
1089        setup_ap(access_point=self.access_point,
1090                 profile_name='whirlwind_11ag_legacy',
1091                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1092                 ssid=self.open_network_2g['SSID'],
1093                 beacon_interval=15)
1094        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1095                            'Failed to associate.')
1096
1097    def test_associate_11bg_maximum_beacon_interval(self):
1098        setup_ap(access_point=self.access_point,
1099                 profile_name='whirlwind_11ag_legacy',
1100                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1101                 ssid=self.open_network_2g['SSID'],
1102                 beacon_interval=1024)
1103        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1104                            'Failed to associate.')
1105
1106    def test_associate_11bg_frag_threshold_430(self):
1107        setup_ap(access_point=self.access_point,
1108                 profile_name='whirlwind_11ag_legacy',
1109                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1110                 ssid=self.open_network_2g['SSID'],
1111                 frag_threshold=430)
1112        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1113                            'Failed to associate.')
1114
1115    def test_associate_11bg_rts_threshold_256(self):
1116        setup_ap(access_point=self.access_point,
1117                 profile_name='whirlwind_11ag_legacy',
1118                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1119                 ssid=self.open_network_2g['SSID'],
1120                 rts_threshold=256)
1121        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1122                            'Failed to associate.')
1123
1124    def test_associate_11bg_rts_256_frag_430(self):
1125        setup_ap(access_point=self.access_point,
1126                 profile_name='whirlwind_11ag_legacy',
1127                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1128                 ssid=self.open_network_2g['SSID'],
1129                 rts_threshold=256,
1130                 frag_threshold=430)
1131        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1132                            'Failed to associate.')
1133
1134    def test_associate_11bg_high_dtim_low_beacon_interval(self):
1135        setup_ap(access_point=self.access_point,
1136                 profile_name='whirlwind_11ag_legacy',
1137                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1138                 ssid=self.open_network_2g['SSID'],
1139                 dtim_period=3,
1140                 beacon_interval=100)
1141        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1142                            'Failed to associate.')
1143
1144    def test_associate_11bg_low_dtim_high_beacon_interval(self):
1145        setup_ap(access_point=self.access_point,
1146                 profile_name='whirlwind_11ag_legacy',
1147                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1148                 ssid=self.open_network_2g['SSID'],
1149                 dtim_period=1,
1150                 beacon_interval=300)
1151        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1152                            'Failed to associate.')
1153
1154    def test_associate_11bg_with_WMM_with_default_values(self):
1155        setup_ap(access_point=self.access_point,
1156                 profile_name='whirlwind_11ag_legacy',
1157                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1158                 ssid=self.open_network_2g['SSID'],
1159                 force_wmm=True,
1160                 additional_ap_parameters=hostapd_constants.
1161                 WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS)
1162        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1163                            'Failed to associate.')
1164
1165    def test_associate_11bg_with_WMM_with_non_default_values(self):
1166        setup_ap(
1167            access_point=self.access_point,
1168            profile_name='whirlwind_11ag_legacy',
1169            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1170            ssid=self.open_network_2g['SSID'],
1171            force_wmm=True,
1172            additional_ap_parameters=hostapd_constants.WMM_NON_DEFAULT_PARAMS)
1173        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1174                            'Failed to associate.')
1175
1176    def test_associate_11bg_with_WMM_ACM_on_BK(self):
1177        wmm_acm_bits_enabled = utils.merge_dicts(
1178            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1179            hostapd_constants.WMM_ACM_BK)
1180        setup_ap(access_point=self.access_point,
1181                 profile_name='whirlwind_11ag_legacy',
1182                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1183                 ssid=self.open_network_2g['SSID'],
1184                 force_wmm=True,
1185                 additional_ap_parameters=wmm_acm_bits_enabled)
1186        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1187                            'Failed to associate.')
1188
1189    def test_associate_11bg_with_WMM_ACM_on_BE(self):
1190        wmm_acm_bits_enabled = utils.merge_dicts(
1191            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1192            hostapd_constants.WMM_ACM_BE)
1193        setup_ap(access_point=self.access_point,
1194                 profile_name='whirlwind_11ag_legacy',
1195                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1196                 ssid=self.open_network_2g['SSID'],
1197                 force_wmm=True,
1198                 additional_ap_parameters=wmm_acm_bits_enabled)
1199        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1200                            'Failed to associate.')
1201
1202    def test_associate_11bg_with_WMM_ACM_on_VI(self):
1203        wmm_acm_bits_enabled = utils.merge_dicts(
1204            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1205            hostapd_constants.WMM_ACM_VI)
1206        setup_ap(access_point=self.access_point,
1207                 profile_name='whirlwind_11ag_legacy',
1208                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1209                 ssid=self.open_network_2g['SSID'],
1210                 force_wmm=True,
1211                 additional_ap_parameters=wmm_acm_bits_enabled)
1212        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1213                            'Failed to associate.')
1214
1215    def test_associate_11bg_with_WMM_ACM_on_VO(self):
1216        wmm_acm_bits_enabled = utils.merge_dicts(
1217            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1218            hostapd_constants.WMM_ACM_VO)
1219        setup_ap(access_point=self.access_point,
1220                 profile_name='whirlwind_11ag_legacy',
1221                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1222                 ssid=self.open_network_2g['SSID'],
1223                 force_wmm=True,
1224                 additional_ap_parameters=wmm_acm_bits_enabled)
1225        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1226                            'Failed to associate.')
1227
1228    def test_associate_11bg_with_WMM_ACM_on_BK_BE_VI(self):
1229        wmm_acm_bits_enabled = utils.merge_dicts(
1230            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1231            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
1232            hostapd_constants.WMM_ACM_VI)
1233        setup_ap(access_point=self.access_point,
1234                 profile_name='whirlwind_11ag_legacy',
1235                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1236                 ssid=self.open_network_2g['SSID'],
1237                 force_wmm=True,
1238                 additional_ap_parameters=wmm_acm_bits_enabled)
1239        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1240                            'Failed to associate.')
1241
1242    def test_associate_11bg_with_WMM_ACM_on_BK_BE_VO(self):
1243        wmm_acm_bits_enabled = utils.merge_dicts(
1244            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1245            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_BE,
1246            hostapd_constants.WMM_ACM_VO)
1247        setup_ap(access_point=self.access_point,
1248                 profile_name='whirlwind_11ag_legacy',
1249                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1250                 ssid=self.open_network_2g['SSID'],
1251                 force_wmm=True,
1252                 additional_ap_parameters=wmm_acm_bits_enabled)
1253        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1254                            'Failed to associate.')
1255
1256    def test_associate_11bg_with_WMM_ACM_on_BK_VI_VO(self):
1257        wmm_acm_bits_enabled = utils.merge_dicts(
1258            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1259            hostapd_constants.WMM_ACM_BK, hostapd_constants.WMM_ACM_VI,
1260            hostapd_constants.WMM_ACM_VO)
1261        setup_ap(access_point=self.access_point,
1262                 profile_name='whirlwind_11ag_legacy',
1263                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1264                 ssid=self.open_network_2g['SSID'],
1265                 force_wmm=True,
1266                 additional_ap_parameters=wmm_acm_bits_enabled)
1267        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1268                            'Failed to associate.')
1269
1270    def test_associate_11bg_with_WMM_ACM_on_BE_VI_VO(self):
1271        wmm_acm_bits_enabled = utils.merge_dicts(
1272            hostapd_constants.WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS,
1273            hostapd_constants.WMM_ACM_BE, hostapd_constants.WMM_ACM_VI,
1274            hostapd_constants.WMM_ACM_VO)
1275        setup_ap(access_point=self.access_point,
1276                 profile_name='whirlwind_11ag_legacy',
1277                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1278                 ssid=self.open_network_2g['SSID'],
1279                 force_wmm=True,
1280                 additional_ap_parameters=wmm_acm_bits_enabled)
1281        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1282                            'Failed to associate.')
1283
1284    def test_associate_11bg_with_country_code(self):
1285        country_info = utils.merge_dicts(
1286            hostapd_constants.ENABLE_IEEE80211D,
1287            hostapd_constants.COUNTRY_STRING['ALL'],
1288            hostapd_constants.COUNTRY_CODE['UNITED_STATES'])
1289        setup_ap(access_point=self.access_point,
1290                 profile_name='whirlwind_11ag_legacy',
1291                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1292                 ssid=self.open_network_2g['SSID'],
1293                 additional_ap_parameters=country_info)
1294        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1295                            'Failed to associate.')
1296
1297    def test_associate_11bg_with_non_country_code(self):
1298        country_info = utils.merge_dicts(
1299            hostapd_constants.ENABLE_IEEE80211D,
1300            hostapd_constants.COUNTRY_STRING['ALL'],
1301            hostapd_constants.COUNTRY_CODE['NON_COUNTRY'])
1302        setup_ap(access_point=self.access_point,
1303                 profile_name='whirlwind_11ag_legacy',
1304                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1305                 ssid=self.open_network_2g['SSID'],
1306                 additional_ap_parameters=country_info)
1307        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1308                            'Failed to associate.')
1309
1310    def test_associate_11bg_only_with_hidden_ssid(self):
1311        setup_ap(access_point=self.access_point,
1312                 profile_name='whirlwind_11ag_legacy',
1313                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1314                 ssid=self.open_network_2g['SSID'],
1315                 hidden=True)
1316        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1317                            'Failed to associate.')
1318
1319    def test_associate_11bg_with_vendor_ie_in_beacon_correct_length(self):
1320        setup_ap(access_point=self.access_point,
1321                 profile_name='whirlwind_11ag_legacy',
1322                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1323                 ssid=self.open_network_2g['SSID'],
1324                 additional_ap_parameters=hostapd_constants.
1325                 VENDOR_IE['correct_length_beacon'])
1326        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1327                            'Failed to associate.')
1328
1329    def test_associate_11bg_with_vendor_ie_in_beacon_zero_length(self):
1330        setup_ap(access_point=self.access_point,
1331                 profile_name='whirlwind_11ag_legacy',
1332                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1333                 ssid=self.open_network_2g['SSID'],
1334                 additional_ap_parameters=hostapd_constants.
1335                 VENDOR_IE['zero_length_beacon_without_data'])
1336        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1337                            'Failed to associate.')
1338
1339    def test_associate_11g_only_with_vendor_ie_in_assoc_correct_length(self):
1340        data_rates = utils.merge_dicts(
1341            hostapd_constants.OFDM_DATA_RATES,
1342            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1343            hostapd_constants.VENDOR_IE['correct_length_association_response'])
1344        setup_ap(access_point=self.access_point,
1345                 profile_name='whirlwind_11ag_legacy',
1346                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1347                 ssid=self.open_network_2g['SSID'],
1348                 additional_ap_parameters=data_rates)
1349        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1350                            'Failed to associate.')
1351
1352    def test_associate_11g_only_with_vendor_ie_in_assoc_zero_length(self):
1353        data_rates = utils.merge_dicts(
1354            hostapd_constants.OFDM_DATA_RATES,
1355            hostapd_constants.OFDM_ONLY_BASIC_RATES,
1356            hostapd_constants.VENDOR_IE['correct_length_association_response'],
1357            hostapd_constants.VENDOR_IE['zero_length_association_'
1358                                        'response_without_data'])
1359        setup_ap(access_point=self.access_point,
1360                 profile_name='whirlwind_11ag_legacy',
1361                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1362                 ssid=self.open_network_2g['SSID'],
1363                 additional_ap_parameters=data_rates)
1364        asserts.assert_true(self.dut.associate(self.open_network_2g['SSID']),
1365                            'Failed to associate.')
1366
1367    def test_minimum_ssid_length_2g_11n_20mhz(self):
1368        setup_ap(access_point=self.access_point,
1369                 profile_name='whirlwind_11ab_legacy',
1370                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1371                 ssid=self.open_network_min_len_2g['SSID'])
1372        asserts.assert_true(
1373            self.dut.associate(self.open_network_min_len_2g['SSID']),
1374            'Failed to associate.')
1375
1376    def test_minimum_ssid_length_5g_11ac_80mhz(self):
1377        setup_ap(access_point=self.access_point,
1378                 profile_name='whirlwind_11ab_legacy',
1379                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
1380                 ssid=self.open_network_min_len_5g['SSID'])
1381        asserts.assert_true(
1382            self.dut.associate(self.open_network_min_len_5g['SSID']),
1383            'Failed to associate.')
1384
1385    def test_maximum_ssid_length_2g_11n_20mhz(self):
1386        setup_ap(access_point=self.access_point,
1387                 profile_name='whirlwind_11ab_legacy',
1388                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1389                 ssid=self.open_network_max_len_2g['SSID'])
1390        asserts.assert_true(
1391            self.dut.associate(self.open_network_max_len_2g['SSID']),
1392            'Failed to associate.')
1393
1394    def test_maximum_ssid_length_5g_11ac_80mhz(self):
1395        setup_ap(access_point=self.access_point,
1396                 profile_name='whirlwind_11ab_legacy',
1397                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
1398                 ssid=self.open_network_max_len_5g['SSID'])
1399        asserts.assert_true(
1400            self.dut.associate(self.open_network_max_len_5g['SSID']),
1401            'Failed to associate.')
1402
1403    def test_ssid_with_UTF8_characters_2g_11n_20mhz(self):
1404        setup_ap(access_point=self.access_point,
1405                 profile_name='whirlwind_11ab_legacy',
1406                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1407                 ssid=self.utf8_ssid_2g)
1408        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g),
1409                            'Failed to associate.')
1410
1411    def test_ssid_with_UTF8_characters_5g_11ac_80mhz(self):
1412        setup_ap(access_point=self.access_point,
1413                 profile_name='whirlwind_11ab_legacy',
1414                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
1415                 ssid=self.utf8_ssid_5g)
1416        asserts.assert_true(self.dut.associate(self.utf8_ssid_5g),
1417                            'Failed to associate.')
1418
1419    def test_ssid_with_UTF8_characters_french_2g_11n_20mhz(self):
1420        setup_ap(access_point=self.access_point,
1421                 profile_name='whirlwind_11ab_legacy',
1422                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1423                 ssid=self.utf8_ssid_2g_french)
1424        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_french),
1425                            'Failed to associate.')
1426
1427    def test_ssid_with_UTF8_characters_german_2g_11n_20mhz(self):
1428        setup_ap(access_point=self.access_point,
1429                 profile_name='whirlwind_11ab_legacy',
1430                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1431                 ssid=self.utf8_ssid_2g_german)
1432        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_german),
1433                            'Failed to associate.')
1434
1435    def test_ssid_with_UTF8_characters_dutch_2g_11n_20mhz(self):
1436        setup_ap(access_point=self.access_point,
1437                 profile_name='whirlwind_11ab_legacy',
1438                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1439                 ssid=self.utf8_ssid_2g_dutch)
1440        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_dutch),
1441                            'Failed to associate.')
1442
1443    def test_ssid_with_UTF8_characters_swedish_2g_11n_20mhz(self):
1444        setup_ap(access_point=self.access_point,
1445                 profile_name='whirlwind_11ab_legacy',
1446                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1447                 ssid=self.utf8_ssid_2g_swedish)
1448        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_swedish),
1449                            'Failed to associate.')
1450
1451    def test_ssid_with_UTF8_characters_norwegian_2g_11n_20mhz(self):
1452        setup_ap(access_point=self.access_point,
1453                 profile_name='whirlwind_11ab_legacy',
1454                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1455                 ssid=self.utf8_ssid_2g_norwegian)
1456        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_norwegian),
1457                            'Failed to associate.')
1458
1459    def test_ssid_with_UTF8_characters_danish_2g_11n_20mhz(self):
1460        setup_ap(access_point=self.access_point,
1461                 profile_name='whirlwind_11ab_legacy',
1462                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1463                 ssid=self.utf8_ssid_2g_danish)
1464        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_danish),
1465                            'Failed to associate.')
1466
1467    def test_ssid_with_UTF8_characters_japanese_2g_11n_20mhz(self):
1468        setup_ap(access_point=self.access_point,
1469                 profile_name='whirlwind_11ab_legacy',
1470                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1471                 ssid=self.utf8_ssid_2g_japanese)
1472        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_japanese),
1473                            'Failed to associate.')
1474
1475    def test_ssid_with_UTF8_characters_spanish_2g_11n_20mhz(self):
1476        setup_ap(access_point=self.access_point,
1477                 profile_name='whirlwind_11ab_legacy',
1478                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1479                 ssid=self.utf8_ssid_2g_spanish)
1480        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_spanish),
1481                            'Failed to associate.')
1482
1483    def test_ssid_with_UTF8_characters_italian_2g_11n_20mhz(self):
1484        setup_ap(access_point=self.access_point,
1485                 profile_name='whirlwind_11ab_legacy',
1486                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1487                 ssid=self.utf8_ssid_2g_italian)
1488        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_italian),
1489                            'Failed to associate.')
1490
1491    def test_ssid_with_UTF8_characters_korean_2g_11n_20mhz(self):
1492        setup_ap(access_point=self.access_point,
1493                 profile_name='whirlwind_11ab_legacy',
1494                 channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
1495                 ssid=self.utf8_ssid_2g_korean)
1496
1497        asserts.assert_true(self.dut.associate(self.utf8_ssid_2g_korean),
1498                            'Failed to associate.')
1499