• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 import wifi_test_utils as wutils
17from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
18from WifiNetworkSuggestionTest import WifiNetworkSuggestionTest
19
20WifiEnums = wutils.WifiEnums
21# EAP Macros
22EAP = WifiEnums.Eap
23EapPhase2 = WifiEnums.EapPhase2
24Ent = WifiEnums.Enterprise
25
26
27class WifiNetworkSuggestion11axTest(WifiNetworkSuggestionTest):
28  """Tests for Enterprise network suggestion 11ax.
29
30  Test Bed Requirement:
31    One Android device, 1 Asus AXE11000 Access Point and Radius server
32  """
33
34  def __init__(self, configs):
35    super().__init__(configs)
36    self.tests = (
37        "test_connect_to_wpa_ent_config_ttls_pap_reboot_config_store",
38        "test_connect_to_wpa_ent_config_aka_reboot_config_store",
39    )
40
41  def setup_class(self):
42    WifiBaseTest.setup_class(self)
43
44    self.dut = self.android_devices[0]
45    req_params = [
46        "radius_conf_2g", "wifi6_models", "ca_cert", "eap_identity",
47        "eap_password", "domain_suffix_match"
48    ]
49    self.unpack_userparams(req_params)
50    self.ap = self.access_points[0]
51    self.ap.configure_ap({
52        "2g": {
53            "security": "wpa2",
54            "radius_server_ip": self.radius_conf_2g["radius_server_ip"],
55            "radius_server_port": self.radius_conf_2g["radius_server_port"],
56            "radius_server_secret": self.radius_conf_2g["radius_server_secret"],
57        }
58    })
59    self.ent_network_2g = self.ap.get_wifi_network("2g")
60    self.dut.droid.wifiRemoveNetworkSuggestions([])
61
62  def setup_test(self):
63    WifiBaseTest.setup_test(self)
64
65    self.dut.droid.wakeLockAcquireBright()
66    self.dut.droid.wakeUpNow()
67    self.dut.unlock_screen()
68    self.clear_user_disabled_networks()
69    wutils.wifi_toggle_state(self.dut, True)
70    self.dut.ed.clear_all_events()
71    self.clear_carrier_approved(str(self.dut.droid.telephonyGetSimCarrierId()))
72