Omar El Ayach | a8c8d12 | 2020-03-24 12:48:06 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
| 2 | # |
| 3 | # Copyright 2020 - 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 | |
| 17 | from acts import base_test |
| 18 | from acts.metrics.loggers.blackbox import BlackboxMappedMetricLogger |
| 19 | from acts.test_utils.wifi import wifi_performance_test_utils as wputils |
Omar El Ayach | 97dcece | 2020-04-06 12:04:20 -0700 | [diff] [blame] | 20 | from acts.test_utils.wifi import wifi_retail_ap as retail_ap |
Omar El Ayach | a8c8d12 | 2020-03-24 12:48:06 -0700 | [diff] [blame] | 21 | |
| 22 | |
| 23 | class WifiPerformancePreflightTest(base_test.BaseTestClass): |
| 24 | """Class for Wifi performance preflight tests. |
| 25 | |
| 26 | This class implements WiFi performance tests to perform before any other |
| 27 | test suite. Currently, the preflight checklist checks the wifi firmware and |
| 28 | config files, i.e., bdf files for any changes by retrieving their version |
| 29 | number and checksum. |
| 30 | """ |
| 31 | def __init__(self, controllers): |
| 32 | base_test.BaseTestClass.__init__(self, controllers) |
| 33 | self.testcase_metric_logger = ( |
| 34 | BlackboxMappedMetricLogger.for_test_case()) |
| 35 | |
| 36 | def setup_class(self): |
| 37 | self.dut = self.android_devices[-1] |
Omar El Ayach | 97dcece | 2020-04-06 12:04:20 -0700 | [diff] [blame] | 38 | # Initialize AP to ensure that tests can be run in later suites |
| 39 | req_params = ['RetailAccessPoints'] |
| 40 | self.unpack_userparams(req_params) |
| 41 | self.access_point = retail_ap.create(self.RetailAccessPoints)[0] |
Omar El Ayach | a8c8d12 | 2020-03-24 12:48:06 -0700 | [diff] [blame] | 42 | |
| 43 | def test_wifi_sw_signature(self): |
| 44 | sw_signature = wputils.get_sw_signature(self.dut) |
| 45 | self.testcase_metric_logger.add_metric('bdf_signature', |
| 46 | sw_signature['bdf_signature']) |
| 47 | self.testcase_metric_logger.add_metric('fw_signature', |
| 48 | sw_signature['fw_signature']) |