• 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
16import time
17from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
18from WifiPnoTest import WifiPnoTest
19
20MAX_ATTN = 95
21
22
23class WifiPno11axTest(WifiPnoTest):
24  """Tests for pno for 11ax.
25
26  Test Bed Requirement:
27    1 Android devices, 2 Asus AXE11000 Access Point.
28  """
29
30  def __init__(self, configs):
31    super().__init__(configs)
32    self.tests = (
33        "test_simple_pno_connection_to_2g",
34        "test_simple_pno_connection_to_5g",
35        "test_pno_connection_with_multiple_saved_networks"
36    )
37
38  def setup_class(self):
39    WifiBaseTest.setup_class(self)
40
41    self.dut = self.android_devices[0]
42    req_params = [
43        "attn_vals", "pno_interval", "reference_networks", "wifi6_models"
44    ]
45    self.unpack_userparams(req_param_names=req_params,)
46    self.attn_a = self.attenuators[0]
47    self.attn_b = self.attenuators[2]
48    self.attenuators[1].set_atten(MAX_ATTN)
49    self.attenuators[3].set_atten(MAX_ATTN)
50    time.sleep(self.pno_interval)  # wait for sometime for 5GHz to come up.
51    self.set_attns("default")
52    self.pno_network_a = self.reference_networks[0]["2g"]
53    self.pno_network_b = self.reference_networks[1]["5g"]
54
55  def teardown_class(self):
56    self.attenuators[1].set_atten(0)
57    self.attenuators[3].set_atten(0)
58
59