Merge "Split stop_services to fix reboot failures"
diff --git a/acts/framework/acts/controllers/android_device.py b/acts/framework/acts/controllers/android_device.py
index ca334aa..1a41e75 100755
--- a/acts/framework/acts/controllers/android_device.py
+++ b/acts/framework/acts/controllers/android_device.py
@@ -559,6 +559,17 @@
}
return info
+ def add_device_info(self, name, info):
+ """Add custom device info to the user_added_info section.
+
+ Adding the same info name the second time will override existing info.
+
+ Args:
+ name: string, name of this info.
+ info: serializable, content of the info.
+ """
+ self._user_added_device_info.update({name: info})
+
def sdk_api_level(self):
if self._sdk_api_level is not None:
return self._sdk_api_level
diff --git a/acts/framework/acts/controllers/cellular_lib/AndroidCellularDut.py b/acts/framework/acts/controllers/cellular_lib/AndroidCellularDut.py
index be3056a..035c830 100644
--- a/acts/framework/acts/controllers/cellular_lib/AndroidCellularDut.py
+++ b/acts/framework/acts/controllers/cellular_lib/AndroidCellularDut.py
@@ -36,6 +36,8 @@
"""
self.ad = ad
self.log = logger
+ logger.info('Initializing Android DUT with baseband version {}'.format(
+ ad.adb.getprop('gsm.version.baseband')))
def toggle_airplane_mode(self, new_state=True):
""" Turns airplane mode on / off.
diff --git a/acts/framework/acts/controllers/rohdeschwarz_lib/cmx500.py b/acts/framework/acts/controllers/rohdeschwarz_lib/cmx500.py
index 18c5ab3..cb2f66e 100644
--- a/acts/framework/acts/controllers/rohdeschwarz_lib/cmx500.py
+++ b/acts/framework/acts/controllers/rohdeschwarz_lib/cmx500.py
@@ -143,10 +143,11 @@
TM9 = 9
+# For mimo 1x1, also set_num_crs_antenna_ports to 1
MIMO_MAX_LAYER_MAPPING = {
- MimoModes.MIMO1x1: 1,
+ MimoModes.MIMO1x1: 2,
MimoModes.MIMO2x2: 2,
- MimoModes.MIMO4x4: 3,
+ MimoModes.MIMO4x4: 4,
}
diff --git a/acts_tests/acts_contrib/test_utils/abstract_devices/wlan_device_lib/AbstractDeviceWlanDeviceBaseTest.py b/acts_tests/acts_contrib/test_utils/abstract_devices/wlan_device_lib/AbstractDeviceWlanDeviceBaseTest.py
deleted file mode 100644
index 0546bad..0000000
--- a/acts_tests/acts_contrib/test_utils/abstract_devices/wlan_device_lib/AbstractDeviceWlanDeviceBaseTest.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2020 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import os
-
-from acts import context
-from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-
-from mobly import utils
-from mobly.base_test import STAGE_NAME_TEARDOWN_CLASS
-
-
-class AbstractDeviceWlanDeviceBaseTest(WifiBaseTest):
- def setup_class(self):
- super().setup_class()
-
- def teardown_class(self):
- begin_time = utils.get_current_epoch_time()
- super().teardown_class()
- for device in getattr(self, "android_devices", []):
- device.take_bug_report(STAGE_NAME_TEARDOWN_CLASS, begin_time)
- for device in getattr(self, "fuchsia_devices", []):
- device.take_bug_report(STAGE_NAME_TEARDOWN_CLASS, begin_time)
-
- def on_fail(self, test_name, begin_time):
- """Gets a wlan_device log and calls the generic device fail on DUT."""
- self.dut.get_log(test_name, begin_time)
- self.on_device_fail(self.dut.device, test_name, begin_time)
-
- def on_device_fail(self, device, test_name, begin_time):
- """Gets a generic device DUT bug report.
-
- This method takes a bug report if the generic device does not have a
- 'take_bug_report_on_fail', or if the flag is true. This method also
- power cycles if 'hard_reboot_on_fail' is True.
-
- Args:
- device: Generic device to gather logs from.
- test_name: Name of the test that triggered this function.
- begin_time: Logline format timestamp taken when the test started.
- """
- if (not hasattr(device, "take_bug_report_on_fail")
- or device.take_bug_report_on_fail):
- device.take_bug_report(test_name, begin_time)
-
- if device.hard_reboot_on_fail:
- device.reboot(reboot_type='hard', testbed_pdus=self.pdu_devices)
-
- def download_ap_logs(self):
- """Downloads the DHCP and hostapad logs from the access_point.
-
- Using the current TestClassContext and TestCaseContext this method pulls
- the DHCP and hostapd logs and outputs them to the correct path.
- """
- current_path = context.get_current_context().get_full_output_path()
- dhcp_full_out_path = os.path.join(current_path, "dhcp_log.txt")
-
- dhcp_log = self.access_point.get_dhcp_logs()
- if dhcp_log:
- dhcp_log_file = open(dhcp_full_out_path, 'w')
- dhcp_log_file.write(dhcp_log)
- dhcp_log_file.close()
-
- hostapd_logs = self.access_point.get_hostapd_logs()
- for interface in hostapd_logs:
- out_name = interface + "_hostapd_log.txt"
- hostapd_full_out_path = os.path.join(current_path, out_name)
- hostapd_log_file = open(hostapd_full_out_path, 'w')
- hostapd_log_file.write(hostapd_logs[interface])
- hostapd_log_file.close()
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_ims_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_ims_utils.py
index 4001f9b..ea9423e 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_ims_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_ims_utils.py
@@ -396,6 +396,8 @@
return True
ad.log.info("Set wfc mode to %s for sub ID %s.", wfc_mode, sub_id)
+ ad.root_adb()
+ ad.adb.shell("setprop dbg.force_wfc_activated true")
ad.droid.imsMmTelSetVoWiFiModeSetting(sub_id, wfc_mode)
mode = ad.droid.imsMmTelGetVoWiFiModeSetting(sub_id)
if mode != wfc_mode:
diff --git a/acts_tests/acts_contrib/test_utils/wifi/WifiBaseTest.py b/acts_tests/acts_contrib/test_utils/wifi/WifiBaseTest.py
index 1f80858..d6a6d25 100644
--- a/acts_tests/acts_contrib/test_utils/wifi/WifiBaseTest.py
+++ b/acts_tests/acts_contrib/test_utils/wifi/WifiBaseTest.py
@@ -18,19 +18,14 @@
"""
import copy
-import itertools
import os
import time
-import acts.controllers.access_point as ap
-
from acts import asserts
+from acts import context
from acts import signals
from acts import utils
from acts.base_test import BaseTestClass
-from acts.signals import TestSignal
-from acts.controllers import android_device
-from acts.controllers.access_point import AccessPoint
from acts.controllers.ap_lib import hostapd_ap_preset
from acts.controllers.ap_lib import hostapd_bss_settings
from acts.controllers.ap_lib import hostapd_constants
@@ -39,6 +34,8 @@
from acts_contrib.test_utils.net import net_test_utils as nutils
from acts_contrib.test_utils.wifi import wifi_test_utils as wutils
+from mobly.base_test import STAGE_NAME_TEARDOWN_CLASS
+
AP_1 = 0
AP_2 = 1
MAX_AP_COUNT = 2
@@ -114,6 +111,12 @@
test_status=True)
self.packet_log_pid = {}
+ def teardown_class(self):
+ begin_time = utils.get_current_epoch_time()
+ super().teardown_class()
+ for device in getattr(self, "fuchsia_devices", []):
+ device.take_bug_report(STAGE_NAME_TEARDOWN_CLASS, begin_time)
+
def on_fail(self, test_name, begin_time):
if hasattr(self, "android_devices"):
for ad in self.android_devices:
@@ -134,6 +137,53 @@
test_status=False)
self.packet_log_pid = {}
+ # Gets a wlan_device log and calls the generic device fail on DUT.
+ for device in getattr(self, "fuchsia_devices", []):
+ self.on_device_fail(device, test_name, begin_time)
+
+ def on_device_fail(self, device, test_name, begin_time):
+ """Gets a generic device DUT bug report.
+
+ This method takes a bug report if the device has the
+ 'take_bug_report_on_fail' config value, and if the flag is true. This
+ method also power cycles if 'hard_reboot_on_fail' is True.
+
+ Args:
+ device: Generic device to gather logs from.
+ test_name: Name of the test that triggered this function.
+ begin_time: Logline format timestamp taken when the test started.
+ """
+ if (not hasattr(device, "take_bug_report_on_fail")
+ or device.take_bug_report_on_fail):
+ device.take_bug_report(test_name, begin_time)
+
+ if hasattr(device,
+ "hard_reboot_on_fail") and device.hard_reboot_on_fail:
+ device.reboot(reboot_type='hard', testbed_pdus=self.pdu_devices)
+
+ def download_ap_logs(self):
+ """Downloads the DHCP and hostapad logs from the access_point.
+
+ Using the current TestClassContext and TestCaseContext this method pulls
+ the DHCP and hostapd logs and outputs them to the correct path.
+ """
+ current_path = context.get_current_context().get_full_output_path()
+ dhcp_full_out_path = os.path.join(current_path, "dhcp_log.txt")
+
+ dhcp_log = self.access_point.get_dhcp_logs()
+ if dhcp_log:
+ dhcp_log_file = open(dhcp_full_out_path, 'w')
+ dhcp_log_file.write(dhcp_log)
+ dhcp_log_file.close()
+
+ hostapd_logs = self.access_point.get_hostapd_logs()
+ for interface in hostapd_logs:
+ out_name = interface + "_hostapd_log.txt"
+ hostapd_full_out_path = os.path.join(current_path, out_name)
+ hostapd_log_file = open(hostapd_full_out_path, 'w')
+ hostapd_log_file.write(hostapd_logs[interface])
+ hostapd_log_file.close()
+
def get_psk_network(
self,
mirror_ap,
@@ -467,10 +517,10 @@
for i in range(ap_count):
network_list = []
if wpa1_network:
- wpa1_dict = self.get_psk_network(mirror_ap,
- self.wpa1_networks,
+ wpa1_dict = self.get_psk_network(mirror_ap, self.wpa1_networks,
hidden, same_ssid,
- ssid_length_2g, ssid_length_5g,
+ ssid_length_2g,
+ ssid_length_5g,
passphrase_length_2g,
passphrase_length_5g)
wpa1_dict[hostapd_constants.BAND_2G]["security"] = "psk"
@@ -543,16 +593,18 @@
sae_dict[hostapd_constants.BAND_5G]["security"] = "sae"
network_list.append(sae_dict)
if saemixed_network:
- saemixed_dict = self.get_psk_network(mirror_ap, self.saemixed_networks,
- hidden, same_ssid,
- hostapd_constants.SAE_KEY_MGMT,
- ssid_length_2g, ssid_length_5g,
- passphrase_length_2g,
- passphrase_length_5g)
- saemixed_dict[hostapd_constants.BAND_2G]["security"] = "sae-mixed"
- saemixed_dict[hostapd_constants.BAND_5G]["security"] = "sae-mixed"
- saemixed_dict[hostapd_constants.BAND_2G]["ieee80211w"] = ieee80211w
- saemixed_dict[hostapd_constants.BAND_5G]["ieee80211w"] = ieee80211w
+ saemixed_dict = self.get_psk_network(
+ mirror_ap, self.saemixed_networks, hidden, same_ssid,
+ hostapd_constants.SAE_KEY_MGMT, ssid_length_2g,
+ ssid_length_5g, passphrase_length_2g, passphrase_length_5g)
+ saemixed_dict[
+ hostapd_constants.BAND_2G]["security"] = "sae-mixed"
+ saemixed_dict[
+ hostapd_constants.BAND_5G]["security"] = "sae-mixed"
+ saemixed_dict[
+ hostapd_constants.BAND_2G]["ieee80211w"] = ieee80211w
+ saemixed_dict[
+ hostapd_constants.BAND_5G]["ieee80211w"] = ieee80211w
network_list.append(saemixed_dict)
self.access_points[i].configure_ap(network_list, channels_2g[i],
channels_5g[i])
@@ -561,8 +613,8 @@
self.access_points[i].get_bssids_for_wifi_networks())
if mirror_ap:
self.access_points[i + 1].configure_ap(network_list,
- channels_2g[i+1],
- channels_5g[i+1])
+ channels_2g[i + 1],
+ channels_5g[i + 1])
self.access_points[i + 1].start_ap()
self.bssid_map.append(
self.access_points[i + 1].get_bssids_for_wifi_networks())
diff --git a/acts_tests/tests/google/fuchsia/dhcp/Dhcpv4InteropTest.py b/acts_tests/tests/google/fuchsia/dhcp/Dhcpv4InteropTest.py
index 1a11658..0104f13 100644
--- a/acts_tests/tests/google/fuchsia/dhcp/Dhcpv4InteropTest.py
+++ b/acts_tests/tests/google/fuchsia/dhcp/Dhcpv4InteropTest.py
@@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import ipaddress
-import itertools
import random
import time
import re
@@ -29,11 +27,10 @@
from acts.controllers.ap_lib.hostapd_utils import generate_random_password
from acts.controllers.utils_lib.commands import ip
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class Dhcpv4InteropFixture(AbstractDeviceWlanDeviceBaseTest):
+class Dhcpv4InteropFixture(WifiBaseTest):
"""Test helpers for validating DHCPv4 Interop
Test Bed Requirement:
@@ -42,9 +39,6 @@
"""
access_point: AccessPoint
- def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
-
def setup_class(self):
super().setup_class()
if 'dut' in self.user_params:
@@ -351,6 +345,7 @@
class Dhcpv4DuplicateAddressTest(Dhcpv4InteropFixture):
+
def setup_test(self):
super().setup_test()
self.extra_addresses = []
diff --git a/acts_tests/tests/google/fuchsia/wlan/compliance/VapeInteropTest.py b/acts_tests/tests/google/fuchsia/wlan/compliance/VapeInteropTest.py
index 962c1bf..24169d9 100644
--- a/acts_tests/tests/google/fuchsia/wlan/compliance/VapeInteropTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/compliance/VapeInteropTest.py
@@ -17,15 +17,13 @@
from acts import asserts
from acts import utils
from acts.controllers.access_point import setup_ap
-from acts.controllers.ap_lib import hostapd_ap_preset
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib.hostapd_security import Security
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class VapeInteropTest(AbstractDeviceWlanDeviceBaseTest):
+class VapeInteropTest(WifiBaseTest):
"""Tests interoperability with mock third party AP profiles.
Test Bed Requirement:
diff --git a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11ACTest.py b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11ACTest.py
index 04adfab..01c1da6 100644
--- a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11ACTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11ACTest.py
@@ -22,9 +22,7 @@
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib.hostapd_security import Security
from acts.controllers.ap_lib import hostapd_constants
-from acts.controllers.ap_lib import hostapd_config
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts.utils import rand_ascii_str
@@ -108,7 +106,7 @@
# 6912 test cases
-class WlanPhyCompliance11ACTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanPhyCompliance11ACTest(WifiBaseTest):
"""Tests for validating 11ac PHYS.
Test Bed Requirement:
@@ -117,7 +115,7 @@
"""
def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ super().__init__(controllers)
self.tests = [
'test_11ac_capabilities_20mhz_open',
'test_11ac_capabilities_40mhz_open',
diff --git a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11NTest.py b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11NTest.py
index ad0800f..deb4ef2 100644
--- a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11NTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyCompliance11NTest.py
@@ -25,7 +25,6 @@
from acts.controllers.ap_lib.hostapd_security import Security
from acts.controllers.ap_lib.hostapd_utils import generate_random_password
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
FREQUENCY_24 = ['2.4GHz']
@@ -63,7 +62,7 @@
settings['security'], ''.join(ret))
-class WlanPhyCompliance11NTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanPhyCompliance11NTest(WifiBaseTest):
"""Tests for validating 11n PHYS.
Test Bed Requirement:
@@ -72,7 +71,7 @@
"""
def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ super().__init__(controllers)
self.tests = [
'test_11n_capabilities_24_HT20',
'test_11n_capabilities_24_HT40_lower',
diff --git a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyComplianceABGTest.py b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyComplianceABGTest.py
index 2d17f4b..fb4099b 100644
--- a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyComplianceABGTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanPhyComplianceABGTest.py
@@ -18,14 +18,12 @@
from acts import utils
from acts.controllers.access_point import setup_ap
-from acts.controllers.ap_lib import hostapd_ap_preset
from acts.controllers.ap_lib import hostapd_constants
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class WlanPhyComplianceABGTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanPhyComplianceABGTest(WifiBaseTest):
"""Tests for validating 11a, 11b, and 11g PHYS.
Test Bed Requirement:
diff --git a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanSecurityComplianceABGTest.py b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanSecurityComplianceABGTest.py
index a32c7c4..971fe8b 100644
--- a/acts_tests/tests/google/fuchsia/wlan/compliance/WlanSecurityComplianceABGTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/compliance/WlanSecurityComplianceABGTest.py
@@ -24,7 +24,7 @@
from acts.controllers.ap_lib.hostapd_security import Security
from acts.controllers.ap_lib.hostapd_utils import generate_random_password
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
AP_11ABG_PROFILE_NAME = 'whirlwind_11ag_legacy'
SSID_LENGTH_DEFAULT = 15
@@ -156,7 +156,7 @@
return security_profile_generator
-class WlanSecurityComplianceABGTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanSecurityComplianceABGTest(WifiBaseTest):
"""Tests for validating 11a, 11b, and 11g PHYS.
Test Bed Requirement:
diff --git a/acts_tests/tests/google/fuchsia/wlan/facade/WlanDeprecatedConfigurationTest.py b/acts_tests/tests/google/fuchsia/wlan/facade/WlanDeprecatedConfigurationTest.py
index 44e6731..9e8a8fa 100644
--- a/acts_tests/tests/google/fuchsia/wlan/facade/WlanDeprecatedConfigurationTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/facade/WlanDeprecatedConfigurationTest.py
@@ -16,7 +16,7 @@
from acts import asserts
from acts import utils
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
AP_ROLE = 'Ap'
@@ -29,8 +29,9 @@
TEST_MAC_ADDR_SECONDARY = 'bc:9a:78:56:34:12'
-class WlanDeprecatedConfigurationTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanDeprecatedConfigurationTest(WifiBaseTest):
"""Tests for WlanDeprecatedConfigurationFacade"""
+
def setup_class(self):
super().setup_class()
self.dut = create_wlan_device(self.fuchsia_devices[0])
diff --git a/acts_tests/tests/google/fuchsia/wlan/facade/WlanFacadeTest.py b/acts_tests/tests/google/fuchsia/wlan/facade/WlanFacadeTest.py
index 9f884b6..585d4ee 100644
--- a/acts_tests/tests/google/fuchsia/wlan/facade/WlanFacadeTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/facade/WlanFacadeTest.py
@@ -20,11 +20,12 @@
import array
from acts import asserts, signals
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-class WlanFacadeTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanFacadeTest(WifiBaseTest):
+
def setup_class(self):
super().setup_class()
if len(self.fuchsia_devices) < 1:
diff --git a/acts_tests/tests/google/fuchsia/wlan/facade/WlanStatusTest.py b/acts_tests/tests/google/fuchsia/wlan/facade/WlanStatusTest.py
index 10344b2..896fd33 100644
--- a/acts_tests/tests/google/fuchsia/wlan/facade/WlanStatusTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/facade/WlanStatusTest.py
@@ -18,15 +18,16 @@
"""
from acts import signals
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class WlanStatusTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanStatusTest(WifiBaseTest):
"""WLAN status test class.
Test Bed Requirements:
* One or more Fuchsia devices with WLAN client capabilities.
"""
+
def setup_class(self):
super().setup_class()
for fd in self.fuchsia_devices:
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/BeaconLossTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/BeaconLossTest.py
index a2a763b..0f33dfa 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/BeaconLossTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/BeaconLossTest.py
@@ -22,8 +22,6 @@
"beacon_loss_test_iterations": "5"
"""
-import os
-import uuid
import time
from acts import asserts
@@ -32,12 +30,12 @@
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts.utils import rand_ascii_str
-class BeaconLossTest(AbstractDeviceWlanDeviceBaseTest):
+class BeaconLossTest(WifiBaseTest):
# Default number of test iterations here.
# Override using parameter in config file.
# Eg: "beacon_loss_test_iterations": "10"
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/ChannelSwitchTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/ChannelSwitchTest.py
index b60184f..572a770 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/ChannelSwitchTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/ChannelSwitchTest.py
@@ -24,12 +24,12 @@
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.utils import rand_ascii_str
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from typing import Sequence
-class ChannelSwitchTest(AbstractDeviceWlanDeviceBaseTest):
+class ChannelSwitchTest(WifiBaseTest):
# Time to wait between issuing channel switches
WAIT_BETWEEN_CHANNEL_SWITCHES_S = 15
@@ -211,8 +211,8 @@
test_with_soft_ap=True)
# TODO(fxbug.dev/84777): This test fails.
- def test_channel_switch_regression_global_operating_class_115(self
- ) -> None:
+ def test_channel_switch_regression_global_operating_class_115(
+ self) -> None:
"""Channel switch into, through, and out of global op. class 115 channels.
Global operating class 115 is described in IEEE 802.11-2016 Table E-4.
@@ -243,8 +243,8 @@
test_with_soft_ap=True)
# TODO(fxbug.dev/84777): This test fails.
- def test_channel_switch_regression_global_operating_class_124(self
- ) -> None:
+ def test_channel_switch_regression_global_operating_class_124(
+ self) -> None:
"""Switch into, through, and out of global op. class 124 channels.
Global operating class 124 is described in IEEE 802.11-2016 Table E-4.
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/ConnectionStressTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/ConnectionStressTest.py
index 64fc144..eb35ccb 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/ConnectionStressTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/ConnectionStressTest.py
@@ -18,22 +18,18 @@
"""
-import os
-import uuid
import time
from acts import signals
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
-from acts_contrib.test_utils.fuchsia import utils
-from acts_contrib.test_utils.tel.tel_test_utils import setup_droid_properties
from acts.utils import rand_ascii_str
-class ConnectionStressTest(AbstractDeviceWlanDeviceBaseTest):
+class ConnectionStressTest(WifiBaseTest):
# Default number of test iterations here.
# Override using parameter in config file.
# Eg: "connection_stress_test_iterations": "50"
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/DownloadStressTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/DownloadStressTest.py
index 5ec6290..021bd7a 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/DownloadStressTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/DownloadStressTest.py
@@ -17,21 +17,18 @@
Script for testing various download stress scenarios.
"""
-import os
import threading
-import uuid
from acts import signals
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.fuchsia import utils
-from acts_contrib.test_utils.tel.tel_test_utils import setup_droid_properties
from acts.utils import rand_ascii_str
-class DownloadStressTest(AbstractDeviceWlanDeviceBaseTest):
+class DownloadStressTest(WifiBaseTest):
# Default number of test iterations here.
# Override using parameter in config file.
# Eg: "download_stress_test_iterations": "10"
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/PingStressTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/PingStressTest.py
index 5f8addc..8584da9 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/PingStressTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/PingStressTest.py
@@ -32,7 +32,8 @@
from acts.utils import rand_ascii_str
-class PingStressTest(AbstractDeviceWlanDeviceBaseTest):
+class PingStressTest(WifiBaseTest):
+
# Timeout for ping thread in seconds
ping_thread_timeout_s = 60 * 5
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/SoftApTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/SoftApTest.py
index ec74992..b03fda2 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/SoftApTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/SoftApTest.py
@@ -27,8 +27,8 @@
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
from acts.controllers.ap_lib.hostapd_utils import generate_random_password
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
CONNECTIVITY_MODE_LOCAL = 'local_only'
CONNECTIVITY_MODE_UNRESTRICTED = 'unrestricted'
@@ -132,7 +132,7 @@
pass
-class SoftApTest(AbstractDeviceWlanDeviceBaseTest):
+class SoftApTest(WifiBaseTest):
"""Tests for Fuchsia SoftAP
Testbed requirement:
@@ -145,6 +145,7 @@
tests), a physical AP (whirlwind) is also required. Those tests will be
skipped if physical AP is not present.
"""
+
def setup_class(self):
self.soft_ap_test_params = self.user_params.get(
'soft_ap_test_params', {})
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/WlanRebootTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/WlanRebootTest.py
index 8d365a7..c18ef76 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/WlanRebootTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/WlanRebootTest.py
@@ -25,7 +25,6 @@
from acts import utils
from acts.controllers import iperf_client
from acts.controllers import iperf_server
-from acts.controllers import pdu
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib.hostapd_security import Security
@@ -35,7 +34,6 @@
from acts.controllers.ap_lib.radvd_config import RadvdConfig
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
# Constants, for readibility
AP = 'ap'
@@ -101,7 +99,7 @@
return settings['test_name']
-class WlanRebootTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanRebootTest(WifiBaseTest):
"""Tests wlan reconnects in different reboot scenarios.
Testbed Requirement:
@@ -109,8 +107,9 @@
* One Whirlwind Access Point (will also serve as iperf server)
* One PduDevice
"""
+
def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ super().__init__(controllers)
def setup_class(self):
super().setup_class()
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/WlanScanTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/WlanScanTest.py
index 6133f0b..41c688a 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/WlanScanTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/WlanScanTest.py
@@ -21,20 +21,15 @@
from datetime import datetime
-import pprint
-import time
-
-import acts_contrib.test_utils.wifi.wifi_test_utils as wutils
-
from acts import signals
from acts.controllers.ap_lib import hostapd_ap_preset
from acts.controllers.ap_lib import hostapd_bss_settings
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class WlanScanTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanScanTest(WifiBaseTest):
"""WLAN scan test class.
Test Bed Requirement:
@@ -42,6 +37,7 @@
* Several Wi-Fi networks visible to the device, including an open Wi-Fi
network or a onHub/GoogleWifi
"""
+
def setup_class(self):
super().setup_class()
diff --git a/acts_tests/tests/google/fuchsia/wlan/functional/WlanTargetSecurityTest.py b/acts_tests/tests/google/fuchsia/wlan/functional/WlanTargetSecurityTest.py
index 2debf65..802fd19 100644
--- a/acts_tests/tests/google/fuchsia/wlan/functional/WlanTargetSecurityTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/functional/WlanTargetSecurityTest.py
@@ -19,19 +19,20 @@
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib.hostapd_security import Security
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
# TODO(fxb/68956): Add security protocol check to mixed mode tests when info is
# available.
-class WlanTargetSecurityTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanTargetSecurityTest(WifiBaseTest):
"""Tests Fuchsia's target security concept and security upgrading
Testbed Requirements:
* One Fuchsia device
* One Whirlwind Access Point
"""
+
def setup_class(self):
if 'dut' in self.user_params and self.user_params[
'dut'] != 'fuchsia_devices':
diff --git a/acts_tests/tests/google/fuchsia/wlan/misc/WlanInterfaceTest.py b/acts_tests/tests/google/fuchsia/wlan/misc/WlanInterfaceTest.py
index 3e2b707..4ded347 100644
--- a/acts_tests/tests/google/fuchsia/wlan/misc/WlanInterfaceTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/misc/WlanInterfaceTest.py
@@ -16,11 +16,12 @@
from acts import signals
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
-class WlanInterfaceTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanInterfaceTest(WifiBaseTest):
+
def setup_class(self):
super().setup_class()
dut = self.user_params.get('dut', None)
diff --git a/acts_tests/tests/google/fuchsia/wlan/misc/WlanMiscScenarioTest.py b/acts_tests/tests/google/fuchsia/wlan/misc/WlanMiscScenarioTest.py
index 950015d..c6c9a33 100644
--- a/acts_tests/tests/google/fuchsia/wlan/misc/WlanMiscScenarioTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/misc/WlanMiscScenarioTest.py
@@ -20,11 +20,11 @@
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib.hostapd_utils import generate_random_password
from acts.controllers.ap_lib.hostapd_security import Security
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
-class WlanMiscScenarioTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanMiscScenarioTest(WifiBaseTest):
"""Random scenario tests, usually to reproduce certain bugs, that do not
fit into a specific test category, but should still be run in CI to catch
regressions.
diff --git a/acts_tests/tests/google/fuchsia/wlan/performance/ChannelSweepTest.py b/acts_tests/tests/google/fuchsia/wlan/performance/ChannelSweepTest.py
index 8ea7891..0fe5674 100644
--- a/acts_tests/tests/google/fuchsia/wlan/performance/ChannelSweepTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/performance/ChannelSweepTest.py
@@ -14,13 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import json
import os
import time
from statistics import pstdev
-from bokeh.models import FixedTicker
from bokeh.plotting import ColumnDataSource
from bokeh.plotting import figure
from bokeh.plotting import output_file
@@ -34,9 +32,8 @@
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib.hostapd_security import Security
from acts.controllers.iperf_server import IPerfResult
-from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
+from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
N_CAPABILITIES_DEFAULT = [
hostapd_constants.N_CAPABILITY_LDPC, hostapd_constants.N_CAPABILITY_SGI20,
@@ -76,7 +73,7 @@
return settings.get('test_name')
-class ChannelSweepTest(AbstractDeviceWlanDeviceBaseTest):
+class ChannelSweepTest(WifiBaseTest):
"""Tests channel performance and regulatory compliance..
Testbed Requirement:
@@ -85,8 +82,9 @@
* One Linux Machine used as IPerfServer if running performance tests
Note: Performance tests should be done in isolated testbed.
"""
+
def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ super().__init__(controllers)
if 'channel_sweep_test_params' in self.user_params:
self.time_to_wait_for_ip_addr = self.user_params[
'channel_sweep_test_params'].get(
diff --git a/acts_tests/tests/google/fuchsia/wlan/performance/WlanRvrTest.py b/acts_tests/tests/google/fuchsia/wlan/performance/WlanRvrTest.py
index 545bbc5..b1c75f3 100644
--- a/acts_tests/tests/google/fuchsia/wlan/performance/WlanRvrTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/performance/WlanRvrTest.py
@@ -26,9 +26,8 @@
from acts.controllers.ap_lib.hostapd_security import Security
from acts.controllers.attenuator import get_attenuators_for_device
from acts.controllers.iperf_server import IPerfResult
-from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
+from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
from acts.utils import rand_ascii_str
from bokeh.plotting import ColumnDataSource
@@ -101,7 +100,7 @@
throughput[csv_loop_counter]))
-class WlanRvrTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanRvrTest(WifiBaseTest):
"""Tests running WLAN RvR.
Test Bed Requirement:
@@ -112,11 +111,11 @@
"""
def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ super().__init__(controllers)
self.rvr_graph_summary = []
def setup_class(self):
- super(WlanRvrTest, self).setup_class()
+ super().setup_class()
if 'dut' in self.user_params:
if self.user_params['dut'] == 'fuchsia_devices':
self.dut = create_wlan_device(self.fuchsia_devices[0])
diff --git a/acts_tests/tests/google/fuchsia/wlan/performance/WlanWmmTest.py b/acts_tests/tests/google/fuchsia/wlan/performance/WlanWmmTest.py
index adbb5f6..b57d555 100644
--- a/acts_tests/tests/google/fuchsia/wlan/performance/WlanWmmTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan/performance/WlanWmmTest.py
@@ -29,8 +29,8 @@
from acts.controllers.ap_lib import hostapd_security
from acts_contrib.test_utils.abstract_devices import wmm_transceiver
from acts_contrib.test_utils.fuchsia import wmm_test_cases
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts_contrib.test_utils.abstract_devices.wlan_device import create_wlan_device
-from acts_contrib.test_utils.abstract_devices.wlan_device_lib.AbstractDeviceWlanDeviceBaseTest import AbstractDeviceWlanDeviceBaseTest
DEFAULT_N_CAPABILITIES_20_MHZ = [
hostapd_constants.N_CAPABILITY_LDPC, hostapd_constants.N_CAPABILITY_SGI20,
@@ -102,7 +102,7 @@
return error <= accepted_error
-class WlanWmmTest(AbstractDeviceWlanDeviceBaseTest):
+class WlanWmmTest(WifiBaseTest):
"""Tests WMM QoS Functionality (Station only)
Testbed Requirements:
@@ -112,6 +112,7 @@
For accurate results, must be performed in an RF isolated environment.
"""
+
def setup_class(self):
super().setup_class()
@@ -659,6 +660,7 @@
# External Traffic Differentiation
"""Single station, STAUT transmits high priority"""
+
def test_external_traffic_diff_staut_VO_ap_VI(self):
self.run_wmm_test(
wmm_test_cases.test_external_traffic_diff_staut_VO_ap_VI)
@@ -770,6 +772,7 @@
# WFA Test Plan Tests
"""Traffic Differentiation in Single BSS (Single Station)"""
+
def test_wfa_traffic_diff_single_station_staut_BE_ap_VI_BE(self):
self.run_wmm_test(
wmm_test_cases.
diff --git a/acts_tests/tests/google/fuchsia/wlan_policy/HiddenNetworksTest.py b/acts_tests/tests/google/fuchsia/wlan_policy/HiddenNetworksTest.py
index 7d294d2..a178520 100644
--- a/acts_tests/tests/google/fuchsia/wlan_policy/HiddenNetworksTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan_policy/HiddenNetworksTest.py
@@ -13,13 +13,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
+import time
+
from acts import signals
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts.utils import rand_ascii_str
-import time
# These tests should have a longer timeout for connecting than normal connect
# tests because the device should probabilistically perform active scans for
diff --git a/acts_tests/tests/google/fuchsia/wlan_policy/PolicyScanTest.py b/acts_tests/tests/google/fuchsia/wlan_policy/PolicyScanTest.py
index efd8729..f55c2bd 100644
--- a/acts_tests/tests/google/fuchsia/wlan_policy/PolicyScanTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan_policy/PolicyScanTest.py
@@ -18,7 +18,7 @@
from datetime import datetime
-from acts import signals, utils
+from acts import signals
from acts.controllers.ap_lib import (hostapd_ap_preset, hostapd_bss_settings,
hostapd_constants, hostapd_security)
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
diff --git a/acts_tests/tests/google/fuchsia/wlan_policy/RegulatoryRecoveryTest.py b/acts_tests/tests/google/fuchsia/wlan_policy/RegulatoryRecoveryTest.py
index 9cfaf84..34b39c9 100644
--- a/acts_tests/tests/google/fuchsia/wlan_policy/RegulatoryRecoveryTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan_policy/RegulatoryRecoveryTest.py
@@ -13,9 +13,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
+
from acts import signals
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-import time
class RegulatoryRecoveryTest(WifiBaseTest):
diff --git a/acts_tests/tests/google/fuchsia/wlan_policy/SavedNetworksTest.py b/acts_tests/tests/google/fuchsia/wlan_policy/SavedNetworksTest.py
index b9d9721..340ca31 100644
--- a/acts_tests/tests/google/fuchsia/wlan_policy/SavedNetworksTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan_policy/SavedNetworksTest.py
@@ -20,14 +20,10 @@
from acts import signals
from acts.controllers.access_point import setup_ap
-from acts.controllers.ap_lib import hostapd_ap_preset
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
-from acts.utils import rand_ascii_str, rand_hex_str, timeout
-import requests
-import time
-import types
+from acts.utils import rand_ascii_str, rand_hex_str
PSK_LEN = 64
TIME_WAIT_FOR_DISCONNECT = 30
diff --git a/acts_tests/tests/google/fuchsia/wlan_policy/StartStopClientConnectionsTest.py b/acts_tests/tests/google/fuchsia/wlan_policy/StartStopClientConnectionsTest.py
index 7643a05..e13425c 100644
--- a/acts_tests/tests/google/fuchsia/wlan_policy/StartStopClientConnectionsTest.py
+++ b/acts_tests/tests/google/fuchsia/wlan_policy/StartStopClientConnectionsTest.py
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import time
+
from acts import signals
from acts.controllers.access_point import setup_ap
from acts.controllers.ap_lib import hostapd_constants
from acts.controllers.ap_lib import hostapd_security
from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
from acts.utils import rand_ascii_str
-import time
DISCONNECTED = "Disconnected"
CONNECTION_STOPPED = "ConnectionStopped"
diff --git a/acts_tests/tests/google/tel/live/TelLiveStressCallTest.py b/acts_tests/tests/google/tel/live/TelLiveStressCallTest.py
index 573ca60..bbdf312 100644
--- a/acts_tests/tests/google/tel/live/TelLiveStressCallTest.py
+++ b/acts_tests/tests/google/tel/live/TelLiveStressCallTest.py
@@ -21,6 +21,7 @@
import time
from acts.test_decorators import test_tracker_info
from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
+from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL
from acts_contrib.test_utils.tel.tel_ims_utils import set_wfc_mode
@@ -72,7 +73,7 @@
def on_fail(self, test_name, begin_time):
pass
- def _setup_wfc(self):
+ def _setup_wfc(self, wfc_mode):
for ad in self.android_devices:
if not ensure_wifi_connected(
ad.log,
@@ -83,7 +84,7 @@
ad.log.error("Phone Wifi connection fails.")
return False
ad.log.info("Phone WIFI is connected successfully.")
- if not set_wfc_mode(self.log, ad, WFC_MODE_WIFI_PREFERRED):
+ if not set_wfc_mode(self.log, ad, wfc_mode):
ad.log.error("Phone failed to enable Wifi-Calling.")
return False
ad.log.info("Phone is set in Wifi-Calling successfully.")
@@ -93,19 +94,19 @@
ad.log.info("Phone is in WFC enabled state.")
return True
- def _setup_wfc_apm(self):
+ def _setup_wfc_apm(self, wfc_mode):
for ad in self.android_devices:
- toggle_airplane_mode(ad.log, ad, True)
if not ensure_wifi_connected(
ad.log,
ad,
self.wifi_network_ssid,
self.wifi_network_pass,
- retries=3):
+ retries=3,
+ apm=True):
ad.log.error("Phone Wifi connection fails.")
return False
ad.log.info("Phone WIFI is connected successfully.")
- if not set_wfc_mode(self.log, ad, WFC_MODE_WIFI_PREFERRED):
+ if not set_wfc_mode(self.log, ad, wfc_mode):
ad.log.error("Phone failed to enable Wifi-Calling.")
return False
ad.log.info("Phone is set in Wifi-Calling successfully.")
@@ -115,7 +116,8 @@
ad.log.info("Phone is in WFC enabled state.")
return True
- def _setup_vt(self):
+ def _setup_vt(self, *args):
+ del args
ads = self.android_devices
tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
(self.log, ads[1]))]
@@ -124,7 +126,8 @@
return False
return True
- def _setup_lte_volte_enabled(self):
+ def _setup_lte_volte_enabled(self, *args):
+ del args
for ad in self.android_devices:
if not phone_setup_volte(self.log, ad):
ad.log.error("Phone failed to enable VoLTE.")
@@ -132,7 +135,8 @@
ad.log.info("Phone VOLTE is enabled successfully.")
return True
- def _setup_lte_volte_disabled(self):
+ def _setup_lte_volte_disabled(self, *args):
+ del args
for ad in self.android_devices:
if not phone_setup_csfb(self.log, ad):
ad.log.error("Phone failed to setup CSFB.")
@@ -140,7 +144,8 @@
ad.log.info("Phone VOLTE is disabled successfully.")
return True
- def _setup_3g(self):
+ def _setup_3g(self, *args):
+ del args
for ad in self.android_devices:
if not phone_setup_voice_3g(self.log, ad):
ad.log.error("Phone failed to setup 3g.")
@@ -148,7 +153,8 @@
ad.log.info("Phone RAT 3G is enabled successfully.")
return True
- def _setup_2g(self):
+ def _setup_2g(self, *args):
+ del args
for ad in self.android_devices:
if not phone_setup_voice_2g(self.log, ad):
ad.log.error("Phone failed to setup 2g.")
@@ -179,6 +185,7 @@
def stress_test(self,
setup_func=None,
+ setup_arg=WFC_MODE_WIFI_PREFERRED,
network_check_func=None,
test_sms=False,
test_video=False):
@@ -186,7 +193,7 @@
#check for sim and service
ensure_phone_subscription(self.log, ad)
- if setup_func and not setup_func():
+ if setup_func and not setup_func(setup_arg):
self.log.error("Test setup %s failed", setup_func.__name__)
return False
fail_count = collections.defaultdict(int)
@@ -363,11 +370,12 @@
@test_tracker_info(uuid="be45c620-b45b-4a06-8424-b17d744d0735")
@TelephonyBaseTest.tel_test_wrap
- def test_call_wifi_calling_stress_apm(self):
+ def test_call_wifi_calling_wifi_preferred_stress_apm(self):
""" Wifi calling in AirPlaneMode call stress test
Steps:
- 1. Make Sure PhoneA and PhoneB in WFC On + APM ON + Wifi Connected
+ 1. Make Sure PhoneA and PhoneB in WFC On(wifi preferred) +
+ APM ON + Wifi Connected
2. Call from PhoneA to PhoneB, hang up on PhoneA.
3, Repeat 2 around N times based on the config setup
@@ -383,6 +391,30 @@
setup_func=self._setup_wfc_apm,
network_check_func=is_phone_in_call_iwlan)
+ @test_tracker_info(uuid="")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_call_wifi_calling_cellular_preferred_stress_apm(self):
+ """ Wifi calling in AirPlaneMode call stress test
+
+ Steps:
+ 1. Make Sure PhoneA and PhoneB in WFC On(cellular preferred) +
+ APM ON + Wifi Connected
+ 2. Call from PhoneA to PhoneB, hang up on PhoneA.
+ 3, Repeat 2 around N times based on the config setup
+
+ Expected Results:
+ 1, Verify phone is at IDLE state
+ 2, Verify the phone is at ACTIVE, if it is in dialing, then we retry
+ 3, Verify the phone is IDLE after hung up
+
+ Returns:
+ True if pass; False if fail.
+ """
+ return self.stress_test(
+ setup_func=self._setup_wfc_apm,
+ setup_arg=WFC_MODE_CELLULAR_PREFERRED,
+ network_check_func=is_phone_in_call_iwlan)
+
@test_tracker_info(uuid="8af0454b-b4db-46d8-b5cc-e13ec5bc59ab")
@TelephonyBaseTest.tel_test_wrap
def test_call_3g_stress(self):
diff --git a/acts_tests/tests/google/tel/live/TelLiveStressTest.py b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
index e04ba6a..906f5e9 100644
--- a/acts_tests/tests/google/tel/live/TelLiveStressTest.py
+++ b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
@@ -602,11 +602,12 @@
self.user_params["gps_log_file"])
for reason in failure_reasons:
self.result_info["Call %s Failure" % reason] += 1
- for ad in ads:
- log_path = os.path.join(self.log_path, test_name,
+ if self.get_binder_logs:
+ for ad in ads:
+ log_path = os.path.join(self.log_path, test_name,
"%s_binder_logs" % ad.serial)
- os.makedirs(log_path, exist_ok=True)
- ad.pull_files(BINDER_LOGS, log_path)
+ os.makedirs(log_path, exist_ok=True)
+ ad.pull_files(BINDER_LOGS, log_path)
try:
self._take_bug_report(test_name, begin_time)
except Exception as e: