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
18from acts.controllers.ap_lib import hostapd_ap_preset
19from acts.controllers.ap_lib import hostapd_constants
20from acts.controllers.ap_lib.hostapd_security import Security
21from acts.test_utils.abstract_devices.wlan_device import create_wlan_device
22from acts.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
23from acts.test_utils.abstract_devices.utils_lib.wlan_utils import validate_setup_ap_and_associate
24from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
25
26
27class VapeInteropTest(AbstractDeviceWlanDeviceBaseTest):
28    """Tests interoperability with mock third party AP profiles.
29
30    Test Bed Requirement:
31    * One Android or Fuchsia Device
32    * One Whirlwind Access Point
33    """
34    def setup_class(self):
35        super().setup_class()
36        if 'dut' in self.user_params:
37            if self.user_params['dut'] == 'fuchsia_devices':
38                self.dut = create_wlan_device(self.fuchsia_devices[0])
39            elif self.user_params['dut'] == 'android_devices':
40                self.dut = create_wlan_device(self.android_devices[0])
41            else:
42                raise ValueError('Invalid DUT specified in config. (%s)' %
43                                 self.user_params['dut'])
44        else:
45            # Default is an android device, just like the other tests
46            self.dut = create_wlan_device(self.android_devices[0])
47
48        self.access_point = self.access_points[0]
49
50        # Same for both 2g and 5g
51        self.ssid = utils.rand_ascii_str(hostapd_constants.AP_SSID_LENGTH_2G)
52        self.password = utils.rand_ascii_str(
53            hostapd_constants.AP_PASSPHRASE_LENGTH_2G)
54        self.security_profile_wpa2 = Security(
55            security_mode=hostapd_constants.WPA2_STRING,
56            password=self.password,
57            wpa2_cipher=hostapd_constants.WPA2_DEFAULT_CIPER)
58
59        self.access_point.stop_all_aps()
60
61    def setup_test(self):
62        if hasattr(self, "android_devices"):
63            for ad in self.android_devices:
64                ad.droid.wakeLockAcquireBright()
65                ad.droid.wakeUpNow()
66        self.dut.wifi_toggle_state(True)
67
68    def teardown_test(self):
69        if hasattr(self, "android_devices"):
70            for ad in self.android_devices:
71                ad.droid.wakeLockRelease()
72                ad.droid.goToSleepNow()
73        self.dut.turn_location_off_and_scan_toggle_off()
74        self.dut.disconnect()
75        self.dut.reset_wifi()
76        self.access_point.stop_all_aps()
77
78    def on_fail(self, test_name, begin_time):
79        super().on_fail(test_name, begin_time)
80        self.access_point.stop_all_aps()
81
82    def test_associate_actiontec_pk5000_24ghz_open(self):
83        validate_setup_ap_and_associate(
84            access_point=self.access_point,
85            client=self.dut,
86            profile_name='actiontec_pk5000',
87            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
88            ssid=self.ssid)
89
90    def test_associate_actiontec_pk5000_24ghz_wpa2(self):
91        validate_setup_ap_and_associate(
92            access_point=self.access_point,
93            client=self.dut,
94            profile_name='actiontec_pk5000',
95            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
96            ssid=self.ssid,
97            security=self.security_profile_wpa2,
98            password=self.password)
99
100    def test_associate_actiontec_mi424wr_24ghz_open(self):
101        validate_setup_ap_and_associate(
102            access_point=self.access_point,
103            client=self.dut,
104            profile_name='actiontec_mi424wr',
105            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
106            ssid=self.ssid)
107
108    def test_associate_actiontec_mi424wr_24ghz_wpa2(self):
109        validate_setup_ap_and_associate(
110            access_point=self.access_point,
111            client=self.dut,
112            profile_name='actiontec_mi424wr',
113            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
114            ssid=self.ssid,
115            security=self.security_profile_wpa2,
116            password=self.password)
117
118    def test_associate_asus_rtac66u_24ghz_open(self):
119        validate_setup_ap_and_associate(
120            access_point=self.access_point,
121            client=self.dut,
122            profile_name='asus_rtac66u',
123            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
124            ssid=self.ssid)
125
126    def test_associate_asus_rtac66u_24ghz_wpa2(self):
127        validate_setup_ap_and_associate(
128            access_point=self.access_point,
129            client=self.dut,
130            profile_name='asus_rtac66u',
131            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
132            ssid=self.ssid,
133            security=self.security_profile_wpa2,
134            password=self.password)
135
136    def test_associate_asus_rtac66u_5ghz_open(self):
137        validate_setup_ap_and_associate(
138            access_point=self.access_point,
139            client=self.dut,
140            profile_name='asus_rtac66u',
141            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
142            ssid=self.ssid)
143
144    def test_associate_asus_rtac66u_5ghz_wpa2(self):
145        validate_setup_ap_and_associate(
146            access_point=self.access_point,
147            client=self.dut,
148            profile_name='asus_rtac66u',
149            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
150            ssid=self.ssid,
151            security=self.security_profile_wpa2,
152            password=self.password)
153
154    def test_associate_asus_rtac86u_24ghz_open(self):
155        validate_setup_ap_and_associate(
156            access_point=self.access_point,
157            client=self.dut,
158            profile_name='asus_rtac86u',
159            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
160            ssid=self.ssid)
161
162    def test_associate_asus_rtac86u_24ghz_wpa2(self):
163        validate_setup_ap_and_associate(
164            access_point=self.access_point,
165            client=self.dut,
166            profile_name='asus_rtac86u',
167            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
168            ssid=self.ssid,
169            security=self.security_profile_wpa2,
170            password=self.password)
171
172    def test_associate_asus_rtac86u_5ghz_open(self):
173        validate_setup_ap_and_associate(
174            access_point=self.access_point,
175            client=self.dut,
176            profile_name='asus_rtac86u',
177            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
178            ssid=self.ssid)
179
180    def test_associate_asus_rtac86u_5ghz_wpa2(self):
181        validate_setup_ap_and_associate(
182            access_point=self.access_point,
183            client=self.dut,
184            profile_name='asus_rtac86u',
185            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
186            ssid=self.ssid,
187            security=self.security_profile_wpa2,
188            password=self.password)
189
190    def test_associate_asus_rtac5300_24ghz_open(self):
191        validate_setup_ap_and_associate(
192            access_point=self.access_point,
193            client=self.dut,
194            profile_name='asus_rtac5300',
195            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
196            ssid=self.ssid)
197
198    def test_associate_asus_rtac5300_24ghz_wpa2(self):
199        validate_setup_ap_and_associate(
200            access_point=self.access_point,
201            client=self.dut,
202            profile_name='asus_rtac5300',
203            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
204            ssid=self.ssid,
205            security=self.security_profile_wpa2,
206            password=self.password)
207
208    def test_associate_asus_rtac5300_5ghz_open(self):
209        validate_setup_ap_and_associate(
210            access_point=self.access_point,
211            client=self.dut,
212            profile_name='asus_rtac5300',
213            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
214            ssid=self.ssid)
215
216    def test_associate_asus_rtac5300_5ghz_wpa2(self):
217        validate_setup_ap_and_associate(
218            access_point=self.access_point,
219            client=self.dut,
220            profile_name='asus_rtac5300',
221            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
222            ssid=self.ssid,
223            security=self.security_profile_wpa2,
224            password=self.password)
225
226    def test_associate_asus_rtn56u_24ghz_open(self):
227        validate_setup_ap_and_associate(
228            access_point=self.access_point,
229            client=self.dut,
230            profile_name='asus_rtn56u',
231            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
232            ssid=self.ssid)
233
234    def test_associate_asus_rtn56u_24ghz_wpa2(self):
235        validate_setup_ap_and_associate(
236            access_point=self.access_point,
237            client=self.dut,
238            profile_name='asus_rtn56u',
239            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
240            ssid=self.ssid,
241            security=self.security_profile_wpa2,
242            password=self.password)
243
244    def test_associate_asus_rtn56u_5ghz_open(self):
245        validate_setup_ap_and_associate(
246            access_point=self.access_point,
247            client=self.dut,
248            profile_name='asus_rtn56u',
249            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
250            ssid=self.ssid)
251
252    def test_associate_asus_rtn56u_5ghz_wpa2(self):
253        validate_setup_ap_and_associate(
254            access_point=self.access_point,
255            client=self.dut,
256            profile_name='asus_rtn56u',
257            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
258            ssid=self.ssid,
259            security=self.security_profile_wpa2,
260            password=self.password)
261
262    def test_associate_asus_rtn66u_24ghz_open(self):
263        validate_setup_ap_and_associate(
264            access_point=self.access_point,
265            client=self.dut,
266            profile_name='asus_rtn66u',
267            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
268            ssid=self.ssid)
269
270    def test_associate_asus_rtn66u_24ghz_wpa2(self):
271        validate_setup_ap_and_associate(
272            access_point=self.access_point,
273            client=self.dut,
274            profile_name='asus_rtn66u',
275            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
276            ssid=self.ssid,
277            security=self.security_profile_wpa2,
278            password=self.password)
279
280    def test_associate_asus_rtn66u_5ghz_open(self):
281        validate_setup_ap_and_associate(
282            access_point=self.access_point,
283            client=self.dut,
284            profile_name='asus_rtn66u',
285            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
286            ssid=self.ssid)
287
288    def test_associate_asus_rtn66u_5ghz_wpa2(self):
289        validate_setup_ap_and_associate(
290            access_point=self.access_point,
291            client=self.dut,
292            profile_name='asus_rtn66u',
293            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
294            ssid=self.ssid,
295            security=self.security_profile_wpa2,
296            password=self.password)
297
298    def test_associate_belkin_f9k1001v5_24ghz_open(self):
299        validate_setup_ap_and_associate(
300            access_point=self.access_point,
301            client=self.dut,
302            profile_name='belkin_f9k1001v5',
303            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
304            ssid=self.ssid)
305
306    def test_associate_belkin_f9k1001v5_24ghz_wpa2(self):
307        validate_setup_ap_and_associate(
308            access_point=self.access_point,
309            client=self.dut,
310            profile_name='belkin_f9k1001v5',
311            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
312            ssid=self.ssid,
313            security=self.security_profile_wpa2,
314            password=self.password)
315
316    def test_associate_linksys_ea4500_24ghz_open(self):
317        validate_setup_ap_and_associate(
318            access_point=self.access_point,
319            client=self.dut,
320            profile_name='linksys_ea4500',
321            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
322            ssid=self.ssid)
323
324    def test_associate_linksys_ea4500_24ghz_wpa2(self):
325        validate_setup_ap_and_associate(
326            access_point=self.access_point,
327            client=self.dut,
328            profile_name='linksys_ea4500',
329            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
330            ssid=self.ssid,
331            security=self.security_profile_wpa2,
332            password=self.password)
333
334    def test_associate_linksys_ea4500_5ghz_open(self):
335        validate_setup_ap_and_associate(
336            access_point=self.access_point,
337            client=self.dut,
338            profile_name='linksys_ea4500',
339            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
340            ssid=self.ssid)
341
342    def test_associate_linksys_ea4500_5ghz_wpa2(self):
343        validate_setup_ap_and_associate(
344            access_point=self.access_point,
345            client=self.dut,
346            profile_name='linksys_ea4500',
347            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
348            ssid=self.ssid,
349            security=self.security_profile_wpa2,
350            password=self.password)
351
352    def test_associate_linksys_ea9500_24ghz_open(self):
353        validate_setup_ap_and_associate(
354            access_point=self.access_point,
355            client=self.dut,
356            profile_name='linksys_ea9500',
357            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
358            ssid=self.ssid)
359
360    def test_associate_linksys_ea9500_24ghz_wpa2(self):
361        validate_setup_ap_and_associate(
362            access_point=self.access_point,
363            client=self.dut,
364            profile_name='linksys_ea9500',
365            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
366            ssid=self.ssid,
367            security=self.security_profile_wpa2,
368            password=self.password)
369
370    def test_associate_linksys_ea9500_5ghz_open(self):
371        validate_setup_ap_and_associate(
372            access_point=self.access_point,
373            client=self.dut,
374            profile_name='linksys_ea9500',
375            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
376            ssid=self.ssid)
377
378    def test_associate_linksys_ea9500_5ghz_wpa2(self):
379        validate_setup_ap_and_associate(
380            access_point=self.access_point,
381            client=self.dut,
382            profile_name='linksys_ea9500',
383            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
384            ssid=self.ssid,
385            security=self.security_profile_wpa2,
386            password=self.password)
387
388    def test_associate_linksys_wrt1900acv2_24ghz_open(self):
389        validate_setup_ap_and_associate(
390            access_point=self.access_point,
391            client=self.dut,
392            profile_name='linksys_wrt1900acv2',
393            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
394            ssid=self.ssid)
395
396    def test_associate_linksys_wrt1900acv2_24ghz_wpa2(self):
397        validate_setup_ap_and_associate(
398            access_point=self.access_point,
399            client=self.dut,
400            profile_name='linksys_wrt1900acv2',
401            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
402            ssid=self.ssid,
403            security=self.security_profile_wpa2,
404            password=self.password)
405
406    def test_associate_linksys_wrt1900acv2_5ghz_open(self):
407        validate_setup_ap_and_associate(
408            access_point=self.access_point,
409            client=self.dut,
410            profile_name='linksys_wrt1900acv2',
411            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
412            ssid=self.ssid)
413
414    def test_associate_linksys_wrt1900acv2_5ghz_wpa2(self):
415        validate_setup_ap_and_associate(
416            access_point=self.access_point,
417            client=self.dut,
418            profile_name='linksys_wrt1900acv2',
419            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
420            ssid=self.ssid,
421            security=self.security_profile_wpa2,
422            password=self.password)
423
424    def test_associate_netgear_r7000_24ghz_open(self):
425        validate_setup_ap_and_associate(
426            access_point=self.access_point,
427            client=self.dut,
428            profile_name='netgear_r7000',
429            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
430            ssid=self.ssid)
431
432    def test_associate_netgear_r7000_24ghz_wpa2(self):
433        validate_setup_ap_and_associate(
434            access_point=self.access_point,
435            client=self.dut,
436            profile_name='netgear_r7000',
437            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
438            ssid=self.ssid,
439            security=self.security_profile_wpa2,
440            password=self.password)
441
442    def test_associate_netgear_r7000_5ghz_open(self):
443        validate_setup_ap_and_associate(
444            access_point=self.access_point,
445            client=self.dut,
446            profile_name='netgear_r7000',
447            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
448            ssid=self.ssid)
449
450    def test_associate_netgear_r7000_5ghz_wpa2(self):
451        validate_setup_ap_and_associate(
452            access_point=self.access_point,
453            client=self.dut,
454            profile_name='netgear_r7000',
455            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
456            ssid=self.ssid,
457            security=self.security_profile_wpa2,
458            password=self.password)
459
460    def test_associate_netgear_wndr3400_24ghz_open(self):
461        validate_setup_ap_and_associate(
462            access_point=self.access_point,
463            client=self.dut,
464            profile_name='netgear_wndr3400',
465            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
466            ssid=self.ssid)
467
468    def test_associate_netgear_wndr3400_24ghz_wpa2(self):
469        validate_setup_ap_and_associate(
470            access_point=self.access_point,
471            client=self.dut,
472            profile_name='netgear_wndr3400',
473            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
474            ssid=self.ssid,
475            security=self.security_profile_wpa2,
476            password=self.password)
477
478    def test_associate_netgear_wndr3400_5ghz_open(self):
479        validate_setup_ap_and_associate(
480            access_point=self.access_point,
481            client=self.dut,
482            profile_name='netgear_wndr3400',
483            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
484            ssid=self.ssid)
485
486    def test_associate_netgear_wndr3400_5ghz_wpa2(self):
487        validate_setup_ap_and_associate(
488            access_point=self.access_point,
489            client=self.dut,
490            profile_name='netgear_wndr3400',
491            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
492            ssid=self.ssid,
493            security=self.security_profile_wpa2,
494            password=self.password)
495
496    def test_associate_securifi_almond_24ghz_open(self):
497        validate_setup_ap_and_associate(
498            access_point=self.access_point,
499            client=self.dut,
500            profile_name='securifi_almond',
501            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
502            ssid=self.ssid)
503
504    def test_associate_securifi_almond_24ghz_wpa2(self):
505        validate_setup_ap_and_associate(
506            access_point=self.access_point,
507            client=self.dut,
508            profile_name='securifi_almond',
509            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
510            ssid=self.ssid,
511            security=self.security_profile_wpa2,
512            password=self.password)
513
514    def test_associate_tplink_archerc5_24ghz_open(self):
515        validate_setup_ap_and_associate(
516            access_point=self.access_point,
517            client=self.dut,
518            profile_name='tplink_archerc5',
519            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
520            ssid=self.ssid)
521
522    def test_associate_tplink_archerc5_24ghz_wpa2(self):
523        validate_setup_ap_and_associate(
524            access_point=self.access_point,
525            client=self.dut,
526            profile_name='tplink_archerc5',
527            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
528            ssid=self.ssid,
529            security=self.security_profile_wpa2,
530            password=self.password)
531
532    def test_associate_tplink_archerc5_5ghz_open(self):
533        validate_setup_ap_and_associate(
534            access_point=self.access_point,
535            client=self.dut,
536            profile_name='tplink_archerc5',
537            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
538            ssid=self.ssid)
539
540    def test_associate_tplink_archerc5_5ghz_wpa2(self):
541        validate_setup_ap_and_associate(
542            access_point=self.access_point,
543            client=self.dut,
544            profile_name='tplink_archerc5',
545            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
546            ssid=self.ssid,
547            security=self.security_profile_wpa2,
548            password=self.password)
549
550    def test_associate_tplink_archerc7_24ghz_open(self):
551        validate_setup_ap_and_associate(
552            access_point=self.access_point,
553            client=self.dut,
554            profile_name='tplink_archerc7',
555            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
556            ssid=self.ssid)
557
558    def test_associate_tplink_archerc7_24ghz_wpa2(self):
559        validate_setup_ap_and_associate(
560            access_point=self.access_point,
561            client=self.dut,
562            profile_name='tplink_archerc7',
563            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
564            ssid=self.ssid,
565            security=self.security_profile_wpa2,
566            password=self.password)
567
568    def test_associate_tplink_archerc7_5ghz_open(self):
569        validate_setup_ap_and_associate(
570            access_point=self.access_point,
571            client=self.dut,
572            profile_name='tplink_archerc7',
573            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
574            ssid=self.ssid)
575
576    def test_associate_tplink_archerc7_5ghz_wpa2(self):
577        validate_setup_ap_and_associate(
578            access_point=self.access_point,
579            client=self.dut,
580            profile_name='tplink_archerc7',
581            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
582            ssid=self.ssid,
583            security=self.security_profile_wpa2,
584            password=self.password)
585
586    def test_associate_tplink_c1200_24ghz_open(self):
587        validate_setup_ap_and_associate(
588            access_point=self.access_point,
589            client=self.dut,
590            profile_name='tplink_c1200',
591            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
592            ssid=self.ssid)
593
594    def test_associate_tplink_c1200_24ghz_wpa2(self):
595        validate_setup_ap_and_associate(
596            access_point=self.access_point,
597            client=self.dut,
598            profile_name='tplink_c1200',
599            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
600            ssid=self.ssid,
601            security=self.security_profile_wpa2,
602            password=self.password)
603
604    def test_associate_tplink_c1200_5ghz_open(self):
605        validate_setup_ap_and_associate(
606            access_point=self.access_point,
607            client=self.dut,
608            profile_name='tplink_c1200',
609            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
610            ssid=self.ssid)
611
612    def test_associate_tplink_c1200_5ghz_wpa2(self):
613        validate_setup_ap_and_associate(
614            access_point=self.access_point,
615            client=self.dut,
616            profile_name='tplink_c1200',
617            channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
618            ssid=self.ssid,
619            security=self.security_profile_wpa2,
620            password=self.password)
621
622    def test_associate_tplink_tlwr940n_24ghz_open(self):
623        validate_setup_ap_and_associate(
624            access_point=self.access_point,
625            client=self.dut,
626            profile_name='tplink_tlwr940n',
627            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
628            ssid=self.ssid)
629
630    def test_associate_tplink_tlwr940n_24ghz_wpa2(self):
631        validate_setup_ap_and_associate(
632            access_point=self.access_point,
633            client=self.dut,
634            profile_name='tplink_tlwr940n',
635            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
636            ssid=self.ssid,
637            security=self.security_profile_wpa2,
638            password=self.password)