1# 2# Copyright 2021 - The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest 17from WifiManagerTest import WifiManagerTest 18 19 20class WifiManager11axTest(WifiManagerTest): 21 """Tests for WifiManager 11ax. 22 23 Test Bed Requirement: 24 One Android device and 2 Asus AXE11000 Access Point. 25 """ 26 27 def __init__(self, configs): 28 super().__init__(configs) 29 self.tests = ( 30 "test_toggle_wifi_state_and_get_startupTime", 31 "test_toggle_with_screen", 32 "test_scan", 33 "test_scan_with_wifi_off_and_location_scan_on", 34 "test_scan_after_reboot_with_wifi_off_and_location_scan_on", 35 "test_scan_with_wifi_off_and_location_scan_off", 36 "test_add_network", 37 "test_forget_network", 38 "test_reconnect_to_previously_connected", 39 "test_reconnect_toggle_wifi", 40 "test_reconnect_toggle_wifi_with_location_scan_on", 41 "test_reconnect_toggle_airplane", 42 "test_reconnect_toggle_airplane_with_location_scan_on", 43 "test_reboot_configstore_reconnect", 44 "test_reboot_configstore_reconnect_with_location_scan_on", 45 "test_toggle_wifi_reboot_configstore_reconnect", 46 "test_toggle_wifi_reboot_configstore_reconnect_with_location_scan_on", 47 "test_toggle_airplane_reboot_configstore_reconnect", 48 "test_toggle_airplane_reboot_configstore_reconnect_with_location_scan_on", 49 "test_reboot_configstore_reconnect_with_screen_lock", 50 "test_connect_to_5g_after_reboot_without_unlock", 51 "test_config_store_with_wpapsk_2g", 52 "test_config_store_with_wpapsk_5g", 53 "test_tdls_supported", 54 "test_energy_info", 55 "test_energy_info_connected", 56 "test_connect_to_wpa_2g", 57 "test_connect_to_wpa_5g", 58 "test_connect_to_2g_can_be_pinged", 59 "test_connect_to_5g_can_be_pinged", 60 "test_wifi_saved_network_reset", 61 "test_reboot_wifi_and_bluetooth_on", 62 "test_scan_result_api", 63 "test_enable_disable_auto_join_saved_network", 64 "test_set_get_coex_unsafe_channels" 65 ) 66 67 def setup_class(self): 68 WifiBaseTest.setup_class(self) 69 70 self.dut = self.android_devices[0] 71 self.dut_client = self.android_devices[1] 72 req_params = [ 73 "reference_networks", "wpa_networks", "iperf_server_address", 74 "iperf_server_port", "coex_unsafe_channels", "coex_restrictions", 75 "wifi6_models" 76 ] 77 self.unpack_userparams(req_param_names=req_params,) 78 self.ap = self.access_points[1] 79 self.ap.configure_ap({"2g": {"security": "open"}, 80 "5g": {"security": "open"}}) 81 self.wpapsk_2g = self.reference_networks[0]["2g"] 82 self.wpapsk_5g = self.reference_networks[0]["5g"] 83 self.open_network_2g = self.ap.get_wifi_network("2g") 84 self.open_network_5g = self.ap.get_wifi_network("5g") 85