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