Revert "Merge sc-d1-dev 6958804 into master."
This reverts commit 3aed9d58ff5cfdbbafc5f8ec8bedd6a6d1ed2221.
Reason for revert: Certain changes were originally not merged from master to sc-d1-dev. By merging sc-d1-dev back to master, those changes would be lost. In addition, sc-d1-dev has never been used for development for platform/tools/test/connectivity.
Bug: 172861149
Change-Id: Ie2d73b100cebfc098a15021c2ed122af165fd869
diff --git a/acts/framework/acts/test_utils/wifi/wifi_test_utils.py b/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
index 5fb2f0a..9fe21eb 100755
--- a/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
+++ b/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
@@ -57,12 +57,12 @@
"AP1_on_AP2_off": [
0,
0,
- 60,
- 60
+ 95,
+ 95
],
"AP1_off_AP2_on": [
- 60,
- 60,
+ 95,
+ 95,
0,
0
],
diff --git a/acts/tests/google/wifi/OWNERS b/acts/tests/google/wifi/OWNERS
deleted file mode 100644
index 7e868cf..0000000
--- a/acts/tests/google/wifi/OWNERS
+++ /dev/null
@@ -1,6 +0,0 @@
-bmahadev@google.com
-etancohen@google.com
-krisr@google.com
-mplass@google.com
-rpius@google.com
-satk@google.com
diff --git a/acts/tests/google/wifi/WifiRoamingTest.py b/acts/tests/google/wifi/WifiRoamingTest.py
deleted file mode 100644
index d7bec90..0000000
--- a/acts/tests/google/wifi/WifiRoamingTest.py
+++ /dev/null
@@ -1,240 +0,0 @@
-#
-# Copyright 2017 - 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 pprint
-import random
-import time
-from acts import context
-from scapy.all import *
-
-from acts import asserts
-from acts import base_test
-from acts import signals
-from acts.test_decorators import test_tracker_info
-from acts.test_utils.wifi import wifi_test_utils as wutils
-from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
-
-WifiEnums = wutils.WifiEnums
-DEF_ATTN = 60
-MAX_ATTN = 95
-ROAM_DBM = -75
-WAIT_AFTER_ATTN = 12
-ATTN_STEP = 5
-
-class WifiRoamingTest(WifiBaseTest):
-
- def setup_class(self):
- """Setup required dependencies from config file and configure
- the required networks for testing roaming.
-
- Returns:
- True if successfully configured the requirements for testing.
- """
- super().setup_class()
-
- self.dut = self.android_devices[0]
- wutils.wifi_test_device_init(self.dut)
- req_params = ["roaming_attn", "roam_interval", "ping_addr",
- "max_bugreports"]
- opt_param = ["open_network", "reference_networks",]
- self.unpack_userparams(
- req_param_names=req_params, opt_param_names=opt_param)
-
- if "AccessPoint" in self.user_params:
- self.legacy_configure_ap_and_start(ap_count=2)
-
- asserts.assert_true(
- len(self.reference_networks) > 1,
- "Need at least two psk networks for roaming.")
- asserts.assert_true(
- len(self.open_network) > 1,
- "Need at least two open networks for roaming")
-
- self.configure_packet_capture()
-
- def teardown_class(self):
- self.dut.ed.clear_all_events()
- if "AccessPoint" in self.user_params:
- del self.user_params["reference_networks"]
- del self.user_params["open_network"]
-
- def setup_test(self):
- self.dut.ed.clear_all_events()
- self.dut.droid.wakeLockAcquireBright()
- self.dut.droid.wakeUpNow()
-
- def teardown_test(self):
- self.dut.droid.wakeLockRelease()
- self.dut.droid.goToSleepNow()
- wutils.reset_wifi(self.dut)
- for a in self.attenuators:
- a.set_atten(0)
-
- def on_fail(self, test_name, begin_time):
- self.dut.cat_adb_log(test_name, begin_time)
- self.dut.take_bug_report(test_name, begin_time)
-
- def roaming_from_AP1_and_AP2(self, AP1_network, AP2_network):
- """Test roaming between two APs.
-
- Args:
- AP1_network: AP-1's network information.
- AP2_network: AP-2's network information.
-
- Steps:
- 1. Make AP1 visible, AP2 not visible.
- 2. Connect to AP1's ssid.
- 3. Make AP1 not visible, AP2 visible.
- 4. Expect DUT to roam to AP2.
- 5. Validate connection information and ping.
- """
- wutils.set_attns(self.attenuators, "AP1_on_AP2_off")
- wutils.connect_to_wifi_network(self.dut, AP1_network)
- self.log.info("Roaming from %s to %s", AP1_network, AP2_network)
- self.trigger_roaming_and_verify_attenuation(AP1_network)
- self.validate_roaming(AP2_network)
-
- def get_rssi(self, pcap_file, expected_bssid):
- """Get signal strength of the wifi network attenuated.
-
- Args:
- pcap_file: PCAP file path.
- expected_bssid: BSSID of the wifi network attenuated.
- """
- packets = []
- try:
- packets = rdpcap(pcap_file)
- except Scapy_Exception:
- self.log.error("Failed to read pcap file")
- if not packets:
- return 0
-
- dbm = -100
- for pkt in packets:
- if pkt and hasattr(pkt, 'type') and pkt.type == 0 and \
- pkt.subtype == 8 and hasattr(pkt, 'info'):
- bssid = pkt.addr3
- if expected_bssid == bssid:
- dbm = int(pkt.dBm_AntSignal)
- self.log.info("RSSI: %s" % dbm)
- return dbm
-
- def trigger_roaming_and_verify_attenuation(self, network):
- """Trigger roaming and verify signal strength is below roaming limit.
-
- Args:
- network: Wifi network that is being attenuated.
- """
- wutils.set_attns_steps(self.attenuators, "AP1_off_AP2_on")
- band = '5G' if network['SSID'].startswith('5g_') else '2G'
- attn = DEF_ATTN + ATTN_STEP
- while attn <= MAX_ATTN:
- self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.test_name)
- time.sleep(WAIT_AFTER_ATTN/3)
- wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
- pcap_file = os.path.join(
- context.get_current_context().get_full_output_path(),
- 'PacketCapture',
- '%s_%s.pcap' % (self.test_name, band))
-
- rssi = self.get_rssi(pcap_file, network["bssid"])
- if rssi == 0:
- self.log.error("Failed to verify signal strength")
- break
- if self.get_rssi(pcap_file, network["bssid"]) < ROAM_DBM:
- break
-
- self.attenuators[0].set_atten(attn)
- self.attenuators[1].set_atten(attn)
- time.sleep(WAIT_AFTER_ATTN) # allow some time for attenuation
- attn += 5
-
- def validate_roaming(self, expected_con):
- """Validate roaming.
-
- Args:
- expected_con: Expected wifi network after roaming.
- """
- expected_con = {
- WifiEnums.SSID_KEY: expected_con[WifiEnums.SSID_KEY],
- WifiEnums.BSSID_KEY: expected_con["bssid"],
- }
- curr_con = self.dut.droid.wifiGetConnectionInfo()
- for key in expected_con:
- if expected_con[key] != curr_con[key]:
- asserts.fail("Expected '%s' to be %s, actual is %s." %
- (key, expected_con[key], curr_con[key]))
- self.log.info("Roamed to %s successfully",
- expected_con[WifiEnums.BSSID_KEY])
- if not wutils.validate_connection(self.dut):
- raise signals.TestFailure("Fail to connect to internet on %s" %
- expected_con[WifiEnums.BSSID_KEY])
-
- """ Tests Begin.
-
- The following tests are designed to test inter-SSID Roaming only.
-
- """
- @test_tracker_info(uuid="db8a46f9-713f-4b98-8d9f-d36319905b0a")
- def test_roaming_between_AP1_to_AP2_open_2g(self):
- AP1_network = self.open_network[0]["2g"]
- AP2_network = self.open_network[1]["2g"]
- self.roaming_from_AP1_and_AP2(AP1_network, AP2_network)
-
- @test_tracker_info(uuid="0db67d9b-6ea9-4f40-acf2-155c4ecf9dc5")
- def test_roaming_between_AP1_to_AP2_open_5g(self):
- AP1_network = self.open_network[0]["5g"]
- AP2_network = self.open_network[1]["5g"]
- self.roaming_from_AP1_and_AP2(AP1_network, AP2_network)
-
- @test_tracker_info(uuid="eabc7319-d962-4bef-b679-725e9ff00420")
- def test_roaming_between_AP1_to_AP2_psk_2g(self):
- AP1_network = self.reference_networks[0]["2g"]
- AP2_network = self.reference_networks[1]["2g"]
- self.roaming_from_AP1_and_AP2(AP1_network, AP2_network)
-
- @test_tracker_info(uuid="1cf9c681-4ff0-45c1-9719-f01629f6a7f7")
- def test_roaming_between_AP1_to_AP2_psk_5g(self):
- AP1_network = self.reference_networks[0]["5g"]
- AP2_network = self.reference_networks[1]["5g"]
- self.roaming_from_AP1_and_AP2(AP1_network, AP2_network)
-
- @test_tracker_info(uuid="3114d625-5cdd-4205-bb46-5a9d057dc80d")
- def test_roaming_fail_psk_2g(self):
- network = {'SSID':'test_roaming_fail', 'password':'roam123456@'}
- # AP2 network with incorrect password.
- network_fail = {'SSID':'test_roaming_fail', 'password':'roam123456@#$%^'}
- # Setup AP1 with the correct password.
- wutils.ap_setup(self, 0, self.access_points[0], network)
- network_bssid = self.access_points[0].get_bssid_from_ssid(
- network["SSID"], '2g')
- # Setup AP2 with the incorrect password.
- wutils.ap_setup(self, 1, self.access_points[1], network_fail)
- network_fail_bssid = self.access_points[1].get_bssid_from_ssid(
- network_fail["SSID"], '2g')
- network['bssid'] = network_bssid
- network_fail['bssid'] = network_fail_bssid
- try:
- # Initiate roaming with AP2 configured with incorrect password.
- self.roaming_from_AP1_and_AP2(network, network_fail)
- except:
- self.log.info("Roaming failed to AP2 with incorrect password.")
- # Re-configure AP2 after roaming failed, with correct password.
- self.log.info("Re-configuring AP2 with correct password.")
- wutils.ap_setup(self, 1, self.access_points[1], network)
- self.roaming_from_AP1_and_AP2(network, network_fail)
-
- """ Tests End """
diff --git a/acts_tests/tests/google/wifi b/acts_tests/tests/google/wifi
deleted file mode 120000
index 48192ea..0000000
--- a/acts_tests/tests/google/wifi
+++ /dev/null
@@ -1 +0,0 @@
-../../../acts/tests/google/wifi
\ No newline at end of file
diff --git a/acts_tests/tests/google/wifi/OWNERS b/acts_tests/tests/google/wifi/OWNERS
new file mode 100644
index 0000000..edb3e3e
--- /dev/null
+++ b/acts_tests/tests/google/wifi/OWNERS
@@ -0,0 +1,6 @@
+bkleung@google.com
+dysu@google.com
+etancohen@google.com
+gmoturu@google.com
+rpius@google.com
+satk@google.com
diff --git a/acts/tests/google/wifi/SetupWifiNetworkTest.py b/acts_tests/tests/google/wifi/SetupWifiNetworkTest.py
similarity index 100%
rename from acts/tests/google/wifi/SetupWifiNetworkTest.py
rename to acts_tests/tests/google/wifi/SetupWifiNetworkTest.py
diff --git a/acts/tests/google/wifi/WifiAutoJoinTest.py b/acts_tests/tests/google/wifi/WifiAutoJoinTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiAutoJoinTest.py
rename to acts_tests/tests/google/wifi/WifiAutoJoinTest.py
diff --git a/acts/tests/google/wifi/WifiAutoUpdateTest.py b/acts_tests/tests/google/wifi/WifiAutoUpdateTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiAutoUpdateTest.py
rename to acts_tests/tests/google/wifi/WifiAutoUpdateTest.py
index 8e20c81..ae69271 100755
--- a/acts/tests/google/wifi/WifiAutoUpdateTest.py
+++ b/acts_tests/tests/google/wifi/WifiAutoUpdateTest.py
@@ -98,17 +98,15 @@
"Failed up apply OTA update. Aborting tests: %s" % e)
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiChannelSwitchStressTest.py b/acts_tests/tests/google/wifi/WifiChannelSwitchStressTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiChannelSwitchStressTest.py
rename to acts_tests/tests/google/wifi/WifiChannelSwitchStressTest.py
index f76331e..bdba6e1 100644
--- a/acts/tests/google/wifi/WifiChannelSwitchStressTest.py
+++ b/acts_tests/tests/google/wifi/WifiChannelSwitchStressTest.py
@@ -59,6 +59,7 @@
wutils.set_wifi_country_code(ad, WifiEnums.CountryCode.US)
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
@@ -78,6 +79,7 @@
WifiEnums.NONE_DFS_5G_FREQUENCIES)
def teardown_test(self):
+ super().teardown_test()
for ad in self.android_devices:
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
@@ -92,9 +94,7 @@
wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
except signals.TestFailure:
pass
- for ad in self.android_devices:
- ad.take_bug_report(test_name, begin_time)
- ad.cat_adb_log(test_name, begin_time)
+ super().on_fail(test_name, begin_time)
def check_cell_data_and_enable(self):
"""Make sure that cell data is enabled if there is a sim present.
diff --git a/acts/tests/google/wifi/WifiChaosTest.py b/acts_tests/tests/google/wifi/WifiChaosTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiChaosTest.py
rename to acts_tests/tests/google/wifi/WifiChaosTest.py
index d0a3722..77a83ec 100755
--- a/acts/tests/google/wifi/WifiChaosTest.py
+++ b/acts_tests/tests/google/wifi/WifiChaosTest.py
@@ -112,6 +112,7 @@
self.randomize_testcases()
def setup_class(self):
+ super().setup_class()
self.dut = self.android_devices[0]
self.admin = 'admin' + str(random.randint(1000001, 12345678))
wutils.wifi_test_device_init(self.dut)
@@ -155,6 +156,7 @@
return True
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
@@ -165,10 +167,10 @@
# Sleep to ensure all failed packets are captured.
time.sleep(5)
wutils.stop_pcap(self.pcap, self.pcap_procs, False)
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
+ super().on_fail(test_name, begin_time)
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
diff --git a/acts/tests/google/wifi/WifiConnectedMacRandomizationTest.py b/acts_tests/tests/google/wifi/WifiConnectedMacRandomizationTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiConnectedMacRandomizationTest.py
rename to acts_tests/tests/google/wifi/WifiConnectedMacRandomizationTest.py
index bd10a8b..14eafab 100644
--- a/acts/tests/google/wifi/WifiConnectedMacRandomizationTest.py
+++ b/acts_tests/tests/google/wifi/WifiConnectedMacRandomizationTest.py
@@ -83,21 +83,19 @@
self.wpapsk_5g = self.reference_networks[0]["5g"]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
wutils.wifi_toggle_state(self.dut_softap, False)
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
wutils.reset_wifi(self.dut_softap)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
wutils.stop_wifi_tethering(self.dut_softap)
self.reset_mac_address_to_factory_mac()
diff --git a/acts/tests/google/wifi/WifiCrashStressTest.py b/acts_tests/tests/google/wifi/WifiCrashStressTest.py
similarity index 90%
rename from acts/tests/google/wifi/WifiCrashStressTest.py
rename to acts_tests/tests/google/wifi/WifiCrashStressTest.py
index 837112a..503583c 100644
--- a/acts/tests/google/wifi/WifiCrashStressTest.py
+++ b/acts_tests/tests/google/wifi/WifiCrashStressTest.py
@@ -33,6 +33,10 @@
* One Wi-Fi network visible to the device.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def setup_class(self):
super().setup_class()
@@ -40,8 +44,6 @@
self.dut_client = self.android_devices[1]
wutils.wifi_test_device_init(self.dut)
wutils.wifi_test_device_init(self.dut_client)
- if not self.dut.is_apk_installed("com.google.mdstest"):
- raise signals.TestAbortClass("mdstest is not installed")
req_params = ["dbs_supported_models", "stress_count"]
opt_param = ["reference_networks"]
self.unpack_userparams(
@@ -59,6 +61,7 @@
self.ap_iface = 'wlan1'
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
@@ -67,6 +70,7 @@
wutils.wifi_toggle_state(self.dut_client, True)
def teardown_test(self):
+ super().teardown_test()
if self.dut.droid.wifiIsApEnabled():
wutils.stop_wifi_tethering(self.dut)
self.dut.droid.wakeLockRelease()
@@ -76,12 +80,6 @@
self.dut_client.droid.goToSleepNow()
wutils.reset_wifi(self.dut_client)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
- self.dut_client.take_bug_report(test_name, begin_time)
- self.dut_client.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
@@ -89,15 +87,8 @@
"""Helper Functions"""
def trigger_wifi_firmware_crash(self, ad, timeout=15):
pre_timestamp = ad.adb.getprop("vendor.debug.ssrdump.timestamp")
- ad.adb.shell(
- "setprop persist.vendor.sys.modem.diag.mdlog false", ignore_status=True)
- # Legacy pixels use persist.sys.modem.diag.mdlog.
- ad.adb.shell(
- "setprop persist.sys.modem.diag.mdlog false", ignore_status=True)
disable_qxdm_logger(ad)
- cmd = ('am instrument -w -e request "4b 25 03 b0 00" '
- '"com.google.mdstest/com.google.mdstest.instrument.'
- 'ModemCommandInstrumentation"')
+ cmd = ('wlanSSR')
ad.log.info("Crash wifi firmware by %s", cmd)
ad.adb.shell(cmd, ignore_status=True)
time.sleep(timeout) # sleep time for firmware restart
diff --git a/acts/tests/google/wifi/WifiCrashTest.py b/acts_tests/tests/google/wifi/WifiCrashTest.py
similarity index 95%
rename from acts/tests/google/wifi/WifiCrashTest.py
rename to acts_tests/tests/google/wifi/WifiCrashTest.py
index e6cbe2e..7f2ad68 100644
--- a/acts/tests/google/wifi/WifiCrashTest.py
+++ b/acts_tests/tests/google/wifi/WifiCrashTest.py
@@ -42,6 +42,9 @@
* One Android device
* One Wi-Fi network visible to the device.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -55,6 +58,8 @@
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start()
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(wpa_network=True)
asserts.assert_true(
len(self.reference_networks) > 0,
@@ -62,19 +67,17 @@
self.network = self.reference_networks[0]["2g"]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiDiagnosticsTest.py b/acts_tests/tests/google/wifi/WifiDiagnosticsTest.py
similarity index 95%
rename from acts/tests/google/wifi/WifiDiagnosticsTest.py
rename to acts_tests/tests/google/wifi/WifiDiagnosticsTest.py
index 8ef24bd..9e5a46f 100644
--- a/acts/tests/google/wifi/WifiDiagnosticsTest.py
+++ b/acts_tests/tests/google/wifi/WifiDiagnosticsTest.py
@@ -60,19 +60,16 @@
self.open_network = self.open_network[0]["2g"]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
-
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["open_network"]
diff --git a/acts/tests/google/wifi/WifiDppTest.py b/acts_tests/tests/google/wifi/WifiDppTest.py
similarity index 99%
rename from acts/tests/google/wifi/WifiDppTest.py
rename to acts_tests/tests/google/wifi/WifiDppTest.py
index 36d265e..64f7f25 100644
--- a/acts/tests/google/wifi/WifiDppTest.py
+++ b/acts_tests/tests/google/wifi/WifiDppTest.py
@@ -77,7 +77,7 @@
Returns:
True is successfully configured the requirements for testing.
"""
-
+ super().setup_class()
# Device 0 is under test. Device 1 performs the responder role
self.dut = self.android_devices[0]
self.helper_dev = self.android_devices[1]
@@ -132,10 +132,6 @@
def teardown_class(self):
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def create_and_save_wifi_network_config(self, security, random_network=False,
r2_auth_error=False):
""" Create a config with random SSID and password.
diff --git a/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py b/acts_tests/tests/google/wifi/WifiEnterpriseRoamingTest.py
similarity index 90%
rename from acts/tests/google/wifi/WifiEnterpriseRoamingTest.py
rename to acts_tests/tests/google/wifi/WifiEnterpriseRoamingTest.py
index 0cebd42..05b3549 100644
--- a/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py
+++ b/acts_tests/tests/google/wifi/WifiEnterpriseRoamingTest.py
@@ -34,6 +34,11 @@
class WifiEnterpriseRoamingTest(WifiBaseTest):
+
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def setup_class(self):
super().setup_class()
@@ -59,13 +64,22 @@
ap_count=2,
radius_conf_2g=self.radius_conf_2g,
radius_conf_5g=self.radius_conf_5g,)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(
+ mirror_ap=True,
+ ent_network=True,
+ ap_count=2,
+ radius_conf_2g=self.radius_conf_2g,
+ radius_conf_5g=self.radius_conf_5g,)
self.ent_network_2g_a = self.ent_networks[0]["2g"]
self.ent_network_2g_b = self.ent_networks[1]["2g"]
- self.bssid_2g_a = self.ent_network_2g_a[WifiEnums.BSSID_KEY.lower()]
- self.bssid_2g_b = self.ent_network_2g_b[WifiEnums.BSSID_KEY.lower()]
self.ent_roaming_ssid = self.ent_network_2g_a[WifiEnums.SSID_KEY]
- self.bssid_a = self.bssid_2g_a
- self.bssid_b = self.bssid_2g_b
+ if "AccessPoint" in self.user_params:
+ self.bssid_a = self.ent_network_2g_a[WifiEnums.BSSID_KEY.lower()]
+ self.bssid_b = self.ent_network_2g_b[WifiEnums.BSSID_KEY.lower()]
+ elif "OpenWrtAP" in self.user_params:
+ self.bssid_a = self.bssid_map[0]["2g"][self.ent_roaming_ssid]
+ self.bssid_b = self.bssid_map[1]["2g"][self.ent_roaming_ssid]
self.config_peap = {
Ent.EAP: int(EAP.PEAP),
@@ -97,6 +111,8 @@
}
self.attn_a = self.attenuators[0]
self.attn_b = self.attenuators[2]
+ if "OpenWrtAP" in self.user_params:
+ self.attn_b = self.attenuators[1]
# Set screen lock password so ConfigStore is unlocked.
self.dut.droid.setDevicePassword(self.device_password)
self.set_attns("default")
@@ -108,6 +124,7 @@
self.set_attns("default")
def setup_test(self):
+ super().setup_test()
self.dut.droid.wifiStartTrackingStateChange()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
@@ -115,15 +132,12 @@
self.dut.ed.clear_all_events()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
self.dut.droid.wifiStopTrackingStateChange()
self.set_attns("default")
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def set_attns(self, attn_val_name):
"""Sets attenuation values on attenuators used in this test.
diff --git a/acts/tests/google/wifi/WifiEnterpriseTest.py b/acts_tests/tests/google/wifi/WifiEnterpriseTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiEnterpriseTest.py
rename to acts_tests/tests/google/wifi/WifiEnterpriseTest.py
index a76f568..aee773c 100644
--- a/acts/tests/google/wifi/WifiEnterpriseTest.py
+++ b/acts_tests/tests/google/wifi/WifiEnterpriseTest.py
@@ -21,8 +21,6 @@
from acts import asserts
from acts import signals
from acts.test_decorators import test_tracker_info
-from acts.test_utils.net.net_test_utils import start_tcpdump
-from acts.test_utils.net.net_test_utils import stop_tcpdump
from acts.test_utils.wifi import wifi_test_utils as wutils
from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
@@ -36,6 +34,11 @@
class WifiEnterpriseTest(WifiBaseTest):
+
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def setup_class(self):
super().setup_class()
@@ -65,6 +68,13 @@
radius_conf_5g=self.radius_conf_5g,
ent_network_pwd=True,
radius_conf_pwd=self.radius_conf_pwd,)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(
+ ent_network=True,
+ radius_conf_2g=self.radius_conf_2g,
+ radius_conf_5g=self.radius_conf_5g,
+ ent_network_pwd=True,
+ radius_conf_pwd=self.radius_conf_pwd,)
self.ent_network_2g = self.ent_networks[0]["2g"]
self.ent_network_5g = self.ent_networks[0]["5g"]
self.ent_network_pwd = self.ent_networks_pwd[0]["2g"]
@@ -144,7 +154,6 @@
del self.config_passpoint_ttls[WifiEnums.SSID_KEY]
# Set screen lock password so ConfigStore is unlocked.
self.dut.droid.setDevicePassword(self.device_password)
- self.tcpdump_pid = None
def teardown_class(self):
wutils.reset_wifi(self.dut)
@@ -152,23 +161,19 @@
self.dut.ed.clear_all_events()
def setup_test(self):
+ super().setup_test()
self.dut.droid.wifiStartTrackingStateChange()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
wutils.reset_wifi(self.dut)
self.dut.ed.clear_all_events()
- self.tcpdump_pid = start_tcpdump(self.dut, self.test_name)
def teardown_test(self):
- stop_tcpdump(self.dut, self.tcpdump_pid, self.test_name)
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
self.dut.droid.wifiStopTrackingStateChange()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
"""Helper Functions"""
def eap_negative_connect_logic(self, config, ad):
diff --git a/acts/tests/google/wifi/WifiHiddenSSIDTest.py b/acts_tests/tests/google/wifi/WifiHiddenSSIDTest.py
similarity index 75%
rename from acts/tests/google/wifi/WifiHiddenSSIDTest.py
rename to acts_tests/tests/google/wifi/WifiHiddenSSIDTest.py
index a68144d..da2c066 100644
--- a/acts/tests/google/wifi/WifiHiddenSSIDTest.py
+++ b/acts_tests/tests/google/wifi/WifiHiddenSSIDTest.py
@@ -14,17 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import itertools
-import pprint
-import queue
-import time
-
-import acts.base_test
import acts.signals
import acts.test_utils.wifi.wifi_test_utils as wutils
-import acts.utils
-from acts import asserts
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
@@ -37,41 +29,40 @@
* Several Wi-Fi networks visible to the device, including an open Wi-Fi
network.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = []
- opt_param = [
- "open_network", "reference_networks"]
- self.unpack_userparams(
- req_param_names=req_params, opt_param_names=opt_param)
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start(hidden=True)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ wpa_network=True,
+ owe_network=True,
+ sae_network=True,
+ hidden=True)
- asserts.assert_true(
- len(self.reference_networks) > 0,
- "Need at least one reference network with psk.")
self.open_hidden_2g = self.open_network[0]["2g"]
self.open_hidden_5g = self.open_network[0]["5g"]
self.wpa_hidden_2g = self.reference_networks[0]["2g"]
self.wpa_hidden_5g = self.reference_networks[0]["5g"]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
wutils.reset_wifi(self.dut)
if "AccessPoint" in self.user_params:
@@ -160,3 +151,23 @@
"""
self.add_hiddenSSID_and_connect(self.open_hidden_5g)
+
+ @test_tracker_info(uuid="62b664df-6397-4360-97bf-a8095c23a878")
+ def test_connect_to_wpa3_owe_hidden_2g(self):
+ """Connect to WPA3 OWE 2G hidden wifi network."""
+ self.add_hiddenSSID_and_connect(self.owe_networks[0]["2g"])
+
+ @test_tracker_info(uuid="dd7b029d-c008-4288-a91c-0820b0b3f29d")
+ def test_connect_to_wpa3_owe_hidden_5g(self):
+ """Connect to WPA3 OWE 5G hidden wifi network."""
+ self.add_hiddenSSID_and_connect(self.owe_networks[0]["5g"])
+
+ @test_tracker_info(uuid="1a9f3ee8-3db0-4f07-a604-66c14a897f94")
+ def test_connect_to_wpa3_sae_hidden_2g(self):
+ """Connect to WPA3 SAE 2G hidden wifi network."""
+ self.add_hiddenSSID_and_connect(self.sae_networks[0]["2g"])
+
+ @test_tracker_info(uuid="6c75618b-9c9b-4eb6-a922-ef1719704a9c")
+ def test_connect_to_wpa3_sae_hidden_5g(self):
+ """Connect to WPA3 SAE 5G hidden wifi network."""
+ self.add_hiddenSSID_and_connect(self.sae_networks[0]["5g"])
diff --git a/acts/tests/google/wifi/WifiIFSTwTest.py b/acts_tests/tests/google/wifi/WifiIFSTwTest.py
similarity index 99%
rename from acts/tests/google/wifi/WifiIFSTwTest.py
rename to acts_tests/tests/google/wifi/WifiIFSTwTest.py
index 5b1603d..ac2022f 100644
--- a/acts/tests/google/wifi/WifiIFSTwTest.py
+++ b/acts_tests/tests/google/wifi/WifiIFSTwTest.py
@@ -87,6 +87,7 @@
utils.set_location_service(self.dut, True)
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.dut.unlock_screen()
@@ -96,6 +97,7 @@
self.dut.ed.clear_all_events()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
diff --git a/acts/tests/google/wifi/WifiIOTTest.py b/acts_tests/tests/google/wifi/WifiIOTTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiIOTTest.py
rename to acts_tests/tests/google/wifi/WifiIOTTest.py
index 1daf346..3ea3b3b 100644
--- a/acts/tests/google/wifi/WifiIOTTest.py
+++ b/acts_tests/tests/google/wifi/WifiIOTTest.py
@@ -67,10 +67,12 @@
self.ssid_map[SSID] = network
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
@@ -79,10 +81,6 @@
if "iperf_server_address" in self.user_params:
self.iperf_server.stop()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
"""Helper Functions"""
def connect_to_wifi_network(self, network):
diff --git a/acts/tests/google/wifi/WifiIOTTwPkg1Test.py b/acts_tests/tests/google/wifi/WifiIOTTwPkg1Test.py
similarity index 98%
rename from acts/tests/google/wifi/WifiIOTTwPkg1Test.py
rename to acts_tests/tests/google/wifi/WifiIOTTwPkg1Test.py
index c6f8c3d..ed0d8d7 100644
--- a/acts/tests/google/wifi/WifiIOTTwPkg1Test.py
+++ b/acts_tests/tests/google/wifi/WifiIOTTwPkg1Test.py
@@ -88,10 +88,12 @@
self.pdu_func()
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
@@ -100,10 +102,6 @@
if "iperf_server_address" in self.user_params:
self.iperf_server.stop()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
"""Helper Functions"""
def connect_to_wifi_network(self, network):
diff --git a/acts/tests/google/wifi/WifiIOTtpeTest.py b/acts_tests/tests/google/wifi/WifiIOTtpeTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiIOTtpeTest.py
rename to acts_tests/tests/google/wifi/WifiIOTtpeTest.py
index fd141ff..3a00d0c 100644
--- a/acts/tests/google/wifi/WifiIOTtpeTest.py
+++ b/acts_tests/tests/google/wifi/WifiIOTtpeTest.py
@@ -67,10 +67,12 @@
self.ssid_map[SSID] = network
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
@@ -79,10 +81,6 @@
if "iperf_server_address" in self.user_params:
self.iperf_server.stop()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
"""Helper Functions"""
def connect_to_wifi_network(self, network):
diff --git a/acts/tests/google/wifi/WifiLinkProbeTest.py b/acts_tests/tests/google/wifi/WifiLinkProbeTest.py
similarity index 96%
rename from acts/tests/google/wifi/WifiLinkProbeTest.py
rename to acts_tests/tests/google/wifi/WifiLinkProbeTest.py
index 7e6d58f..de202b8 100644
--- a/acts/tests/google/wifi/WifiLinkProbeTest.py
+++ b/acts_tests/tests/google/wifi/WifiLinkProbeTest.py
@@ -47,12 +47,15 @@
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start()
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(wpa_network=True)
asserts.assert_true(len(self.reference_networks) > 0,
"Need at least one reference network with psk.")
self.attenuators = wutils.group_attenuators(self.attenuators)
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
@@ -60,14 +63,11 @@
self.attenuators[1].set_atten(0)
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiMacRandomizationTest.py b/acts_tests/tests/google/wifi/WifiMacRandomizationTest.py
similarity index 85%
rename from acts/tests/google/wifi/WifiMacRandomizationTest.py
rename to acts_tests/tests/google/wifi/WifiMacRandomizationTest.py
index 7aa955f..f3b5102 100644
--- a/acts/tests/google/wifi/WifiMacRandomizationTest.py
+++ b/acts_tests/tests/google/wifi/WifiMacRandomizationTest.py
@@ -109,23 +109,21 @@
self.open_5g = self.open_network[0]["5g"]
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
wutils.wifi_toggle_state(ad, True)
def teardown_test(self):
+ super().teardown_test()
for ad in self.android_devices:
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
+ self.dut.droid.wifiRemoveNetworkSuggestions([])
wutils.reset_wifi(self.dut)
wutils.reset_wifi(self.dut_client)
- def on_fail(self, test_name, begin_time):
- self.dut.cat_adb_log(test_name, begin_time)
- self.dut.take_bug_report(test_name, begin_time)
- self.dut_client.take_bug_report(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
@@ -273,6 +271,51 @@
return re.match(".* HWaddr (\S+).*", out, re.S).group(1)
else:
return self.get_sta_mac_address()
+
+ def _add_suggestion_and_verify_mac_randomization(self, network_suggestion):
+ """Add wifi network suggestion and verify MAC randomization.
+
+ Args:
+ network_suggestion: network suggestion to add.
+
+ Returns:
+ Randomized MAC address.
+ """
+ self.log.info("Adding network suggestion")
+ asserts.assert_true(
+ self.dut.droid.wifiAddNetworkSuggestions([network_suggestion]),
+ "Failed to add suggestions")
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, network_suggestion[WifiEnums.SSID_KEY])
+ wutils.wait_for_connect(self.dut, network_suggestion[WifiEnums.SSID_KEY])
+ default_mac = self.get_sta_mac_address()
+ randomized_mac = self.dut.droid.wifiGetConnectionInfo()["mac_address"]
+ self.log.info("Factory MAC = %s\nRandomized MAC = %s\nDefault MAC = %s" %
+ (self.sta_factory_mac, randomized_mac, default_mac))
+ asserts.assert_true(
+ default_mac == randomized_mac,
+ "Connection is not using randomized MAC as the default MAC.")
+ return randomized_mac
+
+ def _remove_suggestion_and_verify_disconnect(self, network_suggestion):
+ """Remove wifi network suggestion and verify device disconnects.
+
+ Args:
+ network_suggestion: network suggestion to remove.
+ """
+ self.dut.log.info("Removing network suggestions")
+ asserts.assert_true(
+ self.dut.droid.wifiRemoveNetworkSuggestions([network_suggestion]),
+ "Failed to remove suggestions")
+ wutils.wait_for_disconnect(self.dut)
+ self.dut.ed.clear_all_events()
+ asserts.assert_false(
+ wutils.wait_for_connect(
+ self.dut,
+ network_suggestion[WifiEnums.SSID_KEY],
+ assert_on_fail=False),
+ "Device should not connect back")
+
"""Tests"""
@@ -568,3 +611,44 @@
hostapd_constants.BAND_2G.upper())
packets = rdpcap(pcap_fname)
self.verify_mac_not_found_in_pcap(self.sta_factory_mac, packets)
+
+ @test_tracker_info(uuid="7714d31f-bb08-4f29-b246-0ce1398a3c03")
+ def test_mac_randomization_for_network_suggestion(self):
+ """Add network suggestion and verify MAC randomization.
+
+ Steps:
+ 1. Add a network suggestion and verify device connects to it.
+ 2. Verify the device uses randomized MAC address for this network.
+ """
+ network_suggestion = self.reference_networks[0]["5g"]
+ self._add_suggestion_and_verify_mac_randomization(network_suggestion)
+
+ @test_tracker_info(uuid="144ad0b4-b79d-4b1d-a8a9-3c612a76c32c")
+ def test_enhanced_mac_randomization_for_network_suggestion(self):
+ """Test enhanced MAC randomization.
+
+ Steps:
+ 1. Add a network suggestion with enhanced mac randomization enabled.
+ 2. Connect to the network and verify the MAC address is random.
+ 3. Remove the suggestion network and add it back.
+ 4. Connect to the network. Verify the MAC address is random and
+ different from the randomized MAC observed in step 2.
+ """
+ network_suggestion = self.reference_networks[0]["5g"]
+ network_suggestion["enhancedMacRandomizationEnabled"] = True
+
+ # add network suggestion with enhanced mac randomization
+ randomized_mac1 = self._add_suggestion_and_verify_mac_randomization(
+ network_suggestion)
+
+ # remove network suggestion and verify no connection
+ self._remove_suggestion_and_verify_disconnect(network_suggestion)
+
+ # add network suggestion and verify device connects back
+ randomized_mac2 = self._add_suggestion_and_verify_mac_randomization(
+ network_suggestion)
+
+ # verify both randomized mac addrs are different
+ asserts.assert_true(randomized_mac1 != randomized_mac2,
+ "Randomized MAC addresses are same.")
+
diff --git a/acts/tests/google/wifi/WifiManagerTest.py b/acts_tests/tests/google/wifi/WifiManagerTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiManagerTest.py
rename to acts_tests/tests/google/wifi/WifiManagerTest.py
index d7107ca..8b4c197 100644
--- a/acts/tests/google/wifi/WifiManagerTest.py
+++ b/acts_tests/tests/google/wifi/WifiManagerTest.py
@@ -47,6 +47,10 @@
network.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def setup_class(self):
super().setup_class()
@@ -70,6 +74,10 @@
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start(wpa_network=True, wep_network=True)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ wpa_network=True,
+ wep_network=True)
asserts.assert_true(
len(self.reference_networks) > 0,
@@ -80,12 +88,14 @@
self.open_network_5g = self.open_network[0]["5g"]
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
def teardown_test(self):
+ super().teardown_test()
for ad in self.android_devices:
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
@@ -96,12 +106,6 @@
if self.dut_client:
wutils.reset_wifi(self.dut_client)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
- if self.dut_client:
- self.dut_client.take_bug_report(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiNativeTest.py b/acts_tests/tests/google/wifi/WifiNativeTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiNativeTest.py
rename to acts_tests/tests/google/wifi/WifiNativeTest.py
diff --git a/acts/tests/google/wifi/WifiNetworkRequestTest.py b/acts_tests/tests/google/wifi/WifiNetworkRequestTest.py
similarity index 96%
rename from acts/tests/google/wifi/WifiNetworkRequestTest.py
rename to acts_tests/tests/google/wifi/WifiNetworkRequestTest.py
index 58e90ca..81aa86d 100644
--- a/acts/tests/google/wifi/WifiNetworkRequestTest.py
+++ b/acts_tests/tests/google/wifi/WifiNetworkRequestTest.py
@@ -45,6 +45,9 @@
* Several Wi-Fi networks visible to the device, including an open Wi-Fi
network.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -61,6 +64,10 @@
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start(wpa_network=True,
wep_network=True)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ wpa_network=True,
+ wep_network=True)
asserts.assert_true(
len(self.reference_networks) > 0,
@@ -71,14 +78,16 @@
self.open_5g = self.open_network[0]["5g"]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.remove_approvals()
- self.clear_deleted_ephemeral_networks()
+ self.clear_user_disabled_networks()
wutils.wifi_toggle_state(self.dut, True)
self.dut.ed.clear_all_events()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
self.dut.droid.wifiReleaseNetworkAll()
@@ -90,10 +99,6 @@
wutils.wifi_toggle_state(self.dut, False)
self.dut.ed.clear_all_events()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
@@ -123,10 +128,10 @@
"cmd wifi network-requests-remove-user-approved-access-points"
+ " " + SL4A_APK_NAME)
- def clear_deleted_ephemeral_networks(self):
- self.dut.log.debug("Clearing deleted ephemeral networks")
+ def clear_user_disabled_networks(self):
+ self.dut.log.debug("Clearing user disabled networks")
self.dut.adb.shell(
- "cmd wifi clear-deleted-ephemeral-networks")
+ "cmd wifi clear-user-disabled-networks")
@test_tracker_info(uuid="d70c8380-61ba-48a3-b76c-a0b55ce4eabf")
def test_connect_to_wpa_psk_2g_with_ssid(self):
diff --git a/acts/tests/google/wifi/WifiNetworkSelectorTest.py b/acts_tests/tests/google/wifi/WifiNetworkSelectorTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiNetworkSelectorTest.py
rename to acts_tests/tests/google/wifi/WifiNetworkSelectorTest.py
index 364a636..7de603c 100644
--- a/acts/tests/google/wifi/WifiNetworkSelectorTest.py
+++ b/acts_tests/tests/google/wifi/WifiNetworkSelectorTest.py
@@ -44,6 +44,9 @@
"""These tests verify the behavior of the Android Wi-Fi Network Selector
feature.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -65,30 +68,22 @@
self.configure_packet_capture()
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.dut.ed.clear_all_events()
- self.pcap_procs = wutils.start_pcap(
- self.packet_capture, 'dual', self.test_name)
for a in self.attenuators:
a.set_atten(MAX_ATTN)
time.sleep(ATTN_SLEEP)
def teardown_test(self):
+ super().teardown_test()
for a in self.attenuators:
a.set_atten(MIN_ATTN)
wutils.reset_wifi(self.dut)
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
- def on_pass(self, test_name, begin_time):
- wutils.stop_pcap(self.packet_capture, self.pcap_procs, True)
-
- def on_fail(self, test_name, begin_time):
- wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiNetworkSuggestionTest.py b/acts_tests/tests/google/wifi/WifiNetworkSuggestionTest.py
similarity index 96%
rename from acts/tests/google/wifi/WifiNetworkSuggestionTest.py
rename to acts_tests/tests/google/wifi/WifiNetworkSuggestionTest.py
index 970b83b..bdca451 100644
--- a/acts/tests/google/wifi/WifiNetworkSuggestionTest.py
+++ b/acts_tests/tests/google/wifi/WifiNetworkSuggestionTest.py
@@ -59,6 +59,9 @@
* Several Wi-Fi networks visible to the device, including an open Wi-Fi
network.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -76,7 +79,9 @@
wpa_network=True, ent_network=True,
radius_conf_2g=self.radius_conf_2g,
radius_conf_5g=self.radius_conf_5g,)
-
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ wpa_network=True,)
if hasattr(self, "reference_networks") and \
isinstance(self.reference_networks, list):
self.wpa_psk_2g = self.reference_networks[0]["2g"]
@@ -84,23 +89,6 @@
if hasattr(self, "open_network") and isinstance(self.open_network,list):
self.open_2g = self.open_network[0]["2g"]
self.open_5g = self.open_network[0]["5g"]
- if hasattr(self, "ent_networks") and isinstance(self.ent_networks,list):
- self.ent_network_2g = self.ent_networks[0]["2g"]
- self.ent_network_5g = self.ent_networks[0]["5g"]
- self.config_aka = {
- Ent.EAP: int(EAP.AKA),
- WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY],
- "carrierId": str(self.dut.droid.telephonyGetSimCarrierId()),
- }
- self.config_ttls = {
- Ent.EAP: int(EAP.TTLS),
- Ent.CA_CERT: self.ca_cert,
- Ent.IDENTITY: self.eap_identity,
- Ent.PASSWORD: self.eap_password,
- Ent.PHASE2: int(EapPhase2.MSCHAPV2),
- WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY],
- Ent.ALTSUBJECT_MATCH: self.altsubject_match,
- }
if hasattr(self, "hidden_networks") and \
isinstance(self.hidden_networks, list):
self.hidden_network = self.hidden_networks[0]
@@ -113,6 +101,7 @@
"pm disable com.google.android.apps.carrier.carrierwifi")
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.dut.unlock_screen()
@@ -120,8 +109,18 @@
wutils.wifi_toggle_state(self.dut, True)
self.dut.ed.clear_all_events()
self.clear_carrier_approved(str(self.dut.droid.telephonyGetSimCarrierId()))
+ if "_ent_" in self.test_name:
+ if "OpenWrtAP" in self.user_params:
+ self.access_points[0].close()
+ self.configure_openwrt_ap_and_start(
+ ent_network=True,
+ radius_conf_2g=self.radius_conf_2g,
+ radius_conf_5g=self.radius_conf_5g,)
+ self.ent_network_2g = self.ent_networks[0]["2g"]
+ self.ent_network_5g = self.ent_networks[0]["5g"]
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
self.dut.droid.wifiRemoveNetworkSuggestions([])
@@ -131,10 +130,6 @@
self.dut.ed.clear_all_events()
self.clear_carrier_approved(str(self.dut.droid.telephonyGetSimCarrierId()))
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
self.dut.adb.shell(
"pm enable com.google.android.apps.carrier.carrierwifi")
@@ -478,6 +473,11 @@
6. Remove suggestions and ensure device doesn't connect back to it.
7. Reboot the device again, ensure user approval is kept
"""
+ self.config_aka = {
+ Ent.EAP: int(EAP.AKA),
+ WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY],
+ "carrierId": str(self.dut.droid.telephonyGetSimCarrierId()),
+ }
if "carrierId" in self.config_aka:
self.set_carrier_approved(self.config_aka["carrierId"], True)
self._test_connect_to_wifi_network_reboot_config_store(
@@ -500,6 +500,15 @@
6. Remove suggestions and ensure device doesn't connect back to it.
7. Reboot the device again, ensure user approval is kept
"""
+ self.config_ttls = {
+ Ent.EAP: int(EAP.TTLS),
+ Ent.CA_CERT: self.ca_cert,
+ Ent.IDENTITY: self.eap_identity,
+ Ent.PASSWORD: self.eap_password,
+ Ent.PHASE2: int(EapPhase2.MSCHAPV2),
+ WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY],
+ Ent.ALTSUBJECT_MATCH: self.altsubject_match,
+ }
config = dict(self.config_ttls)
config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value
diff --git a/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py b/acts_tests/tests/google/wifi/WifiNewSetupAutoJoinTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py
rename to acts_tests/tests/google/wifi/WifiNewSetupAutoJoinTest.py
index b5ba899..59d65e7 100644
--- a/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py
+++ b/acts_tests/tests/google/wifi/WifiNewSetupAutoJoinTest.py
@@ -29,6 +29,11 @@
class WifiNewSetupAutoJoinTest(WifiBaseTest):
+
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def add_network_and_enable(self, network):
"""Add a network and enable it.
@@ -53,7 +58,7 @@
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("atten_val", "ping_addr", "max_bugreports")
+ req_params = ("atten_val", "ping_addr")
opt_param = ["reference_networks"]
self.unpack_userparams(
req_param_names=req_params, opt_param_names=opt_param)
@@ -140,12 +145,6 @@
self.dut.droid.wifiLockRelease()
self.dut.droid.goToSleepNow()
- def on_fail(self, test_name, begin_time):
- if self.max_bugreports > 0:
- self.dut.take_bug_report(test_name, begin_time)
- self.max_bugreports -= 1
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
for ad in self.android_devices:
wutils.reset_wifi(ad)
diff --git a/acts/tests/google/wifi/WifiPasspointTest.py b/acts_tests/tests/google/wifi/WifiPasspointTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiPasspointTest.py
rename to acts_tests/tests/google/wifi/WifiPasspointTest.py
index 8e51eab..4998ac4 100755
--- a/acts/tests/google/wifi/WifiPasspointTest.py
+++ b/acts_tests/tests/google/wifi/WifiPasspointTest.py
@@ -19,10 +19,9 @@
import queue
import time
-import acts.base_test
from acts.test_utils.net import ui_utils as uutils
import acts.test_utils.wifi.wifi_test_utils as wutils
-
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
import WifiManagerTest
from acts import asserts
@@ -54,7 +53,7 @@
PASSPOINT_BUTTON = "Get Passpoint"
BOINGO_UI_TEXT = "Online Sign Up"
-class WifiPasspointTest(acts.base_test.BaseTestClass):
+class WifiPasspointTest(WifiBaseTest):
"""Tests for APIs in Android's WifiManager class.
Test Bed Requirement:
@@ -64,6 +63,7 @@
"""
def setup_class(self):
+ super().setup_class()
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
req_params = ["passpoint_networks",
@@ -78,12 +78,14 @@
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.dut.unlock_screen()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
passpoint_configs = self.dut.droid.getPasspointConfigs()
@@ -92,10 +94,6 @@
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
-
-
"""Helper Functions"""
@@ -214,6 +212,7 @@
"Passpoint Provisioning status %s" % dut_event['data'][
'status'])
if int(dut_event['data']['status']) == 7:
+ time.sleep(DEFAULT_TIMEOUT)
self.ui_automator_boingo()
# Clear all previous events.
self.dut.ed.clear_all_events()
@@ -338,7 +337,7 @@
# Install both Passpoint profiles on the device.
passpoint_ssid = list()
for passpoint_config in self.passpoint_networks[:2]:
- passpoint_ssid.append(passpoint_config[WifiEnums.SSID_KEY])
+ passpoint_ssid.extend(passpoint_config[WifiEnums.SSID_KEY])
self.install_passpoint_profile(passpoint_config)
time.sleep(DEFAULT_TIMEOUT)
@@ -351,12 +350,12 @@
"configured Passpoint networks.")
expected_ssid = self.passpoint_networks[0][WifiEnums.SSID_KEY]
- if current_ssid == expected_ssid:
+ if current_ssid in expected_ssid:
expected_ssid = self.passpoint_networks[1][WifiEnums.SSID_KEY]
# Remove the current Passpoint profile.
for network in self.passpoint_networks[:2]:
- if network[WifiEnums.SSID_KEY] == current_ssid:
+ if current_ssid in network[WifiEnums.SSID_KEY]:
if not wutils.delete_passpoint(self.dut, network["fqdn"]):
raise signals.TestFailure("Failed to delete Passpoint"
" configuration with FQDN = %s" %
@@ -365,7 +364,7 @@
time.sleep(DEFAULT_TIMEOUT)
current_passpoint = self.dut.droid.wifiGetConnectionInfo()
- if current_passpoint[WifiEnums.SSID_KEY] != expected_ssid:
+ if current_passpoint[WifiEnums.SSID_KEY] not in expected_ssid:
raise signals.TestFailure("Device did not failover to the %s"
" passpoint network" % expected_ssid)
diff --git a/acts/tests/google/wifi/WifiPerformancePreflightTest.py b/acts_tests/tests/google/wifi/WifiPerformancePreflightTest.py
similarity index 85%
rename from acts/tests/google/wifi/WifiPerformancePreflightTest.py
rename to acts_tests/tests/google/wifi/WifiPerformancePreflightTest.py
index 35f2966..97d9374 100644
--- a/acts/tests/google/wifi/WifiPerformancePreflightTest.py
+++ b/acts_tests/tests/google/wifi/WifiPerformancePreflightTest.py
@@ -43,15 +43,10 @@
# Load BDF and firmware if needed
if hasattr(self, 'bdf'):
self.log.info('Pushing WiFi BDF to DUT.')
- wputils.push_bdf(self.dut, self.bdf[0])
+ wputils.push_config(self.dut, self.bdf[0])
if hasattr(self, 'firmware'):
self.log.info('Pushing WiFi firmware to DUT.')
- wlanmdsp = [
- file for file in self.firmware if "wlanmdsp.mbn" in file
- ][0]
- data_msc = [file for file in self.firmware
- if "Data.msc" in file][0]
- wputils.push_firmware(self.dut, wlanmdsp, data_msc)
+ wputils.push_firmware(self.dut, self.firmware)
for ad in self.android_devices:
ad.droid.wifiEnableVerboseLogging(1)
@@ -60,8 +55,8 @@
def test_wifi_sw_signature(self):
sw_signature = wputils.get_sw_signature(self.dut)
- self.testcase_metric_logger.add_metric('bdf_signature',
- sw_signature['bdf_signature'])
+ self.testcase_metric_logger.add_metric(
+ 'config_signature', sw_signature['config_signature'])
self.testcase_metric_logger.add_metric('fw_signature',
sw_signature['fw_signature'])
self.testcase_metric_logger.add_metric('serial_hash',
@@ -69,4 +64,4 @@
def teardown_class(self):
# Teardown AP and release its lockfile
- self.access_point.teardown()
\ No newline at end of file
+ self.access_point.teardown()
diff --git a/acts/tests/google/wifi/WifiPingTest.py b/acts_tests/tests/google/wifi/WifiPingTest.py
similarity index 99%
rename from acts/tests/google/wifi/WifiPingTest.py
rename to acts_tests/tests/google/wifi/WifiPingTest.py
index 181d04d..1df52d5 100644
--- a/acts/tests/google/wifi/WifiPingTest.py
+++ b/acts_tests/tests/google/wifi/WifiPingTest.py
@@ -799,4 +799,4 @@
channels=[6, 36, 149],
modes=['VHT20'],
chamber_mode='stepped stirrers',
- positions=list(range(100)))
+ positions=list(range(100)))
\ No newline at end of file
diff --git a/acts/tests/google/wifi/WifiPnoTest.py b/acts_tests/tests/google/wifi/WifiPnoTest.py
similarity index 91%
rename from acts/tests/google/wifi/WifiPnoTest.py
rename to acts_tests/tests/google/wifi/WifiPnoTest.py
index 38ba2bd..879ca0d 100644
--- a/acts/tests/google/wifi/WifiPnoTest.py
+++ b/acts_tests/tests/google/wifi/WifiPnoTest.py
@@ -26,6 +26,10 @@
class WifiPnoTest(WifiBaseTest):
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
+
def setup_class(self):
super().setup_class()
@@ -53,6 +57,7 @@
self.set_attns("default")
def setup_test(self):
+ super().setup_test()
self.dut.droid.wifiStartTrackingStateChange()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
@@ -60,15 +65,12 @@
self.dut.ed.clear_all_events()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wifiStopTrackingStateChange()
wutils.reset_wifi(self.dut)
self.dut.ed.clear_all_events()
self.set_attns("default")
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
@@ -180,20 +182,24 @@
"""Test PNO triggered autoconnect to a network when there are more
than 16 networks saved in the device.
- 16 is the max list size of PNO watch list for most devices. The device
- should automatically pick the 16 latest added networks in the list.
- So add 16 test networks and then add 2 valid networks.
+ 16 is the max list size of PNO watch list for most devices. The device should automatically
+ pick the 16 most recently connected networks. For networks that were never connected, the
+ networks seen in the previous scan result would have higher priority.
Steps:
1. Save 16 test network configurations in the device.
- 2. Run the simple pno test.
+ 2. Add 2 connectable networks and do a normal scan.
+ 3. Trigger PNO scan
"""
self.add_and_enable_test_networks(16)
self.add_network_and_enable(self.pno_network_a)
self.add_network_and_enable(self.pno_network_b)
# Force single scan so that both networks become preferred before PNO.
wutils.start_wifi_connection_scan_and_return_status(self.dut)
+ self.dut.droid.goToSleepNow()
+ wutils.wifi_toggle_state(self.dut, False)
+ wutils.wifi_toggle_state(self.dut, True)
time.sleep(10)
- self.trigger_pno_and_assert_connect("a_on_b_off", self.pno_network_a)
+ self.trigger_pno_and_assert_connect("b_on_a_off", self.pno_network_b)
""" Tests End """
diff --git a/acts/tests/google/wifi/WifiPreFlightTest.py b/acts_tests/tests/google/wifi/WifiPreFlightTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiPreFlightTest.py
rename to acts_tests/tests/google/wifi/WifiPreFlightTest.py
diff --git a/acts/tests/google/wifi/WifiRoamingPerformanceTest.py b/acts_tests/tests/google/wifi/WifiRoamingPerformanceTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiRoamingPerformanceTest.py
rename to acts_tests/tests/google/wifi/WifiRoamingPerformanceTest.py
diff --git a/acts_tests/tests/google/wifi/WifiRoamingTest.py b/acts_tests/tests/google/wifi/WifiRoamingTest.py
new file mode 100644
index 0000000..0ef6bb6
--- /dev/null
+++ b/acts_tests/tests/google/wifi/WifiRoamingTest.py
@@ -0,0 +1,184 @@
+#
+# Copyright 2017 - 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.
+
+from acts import asserts
+from acts.test_decorators import test_tracker_info
+from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
+
+
+class WifiRoamingTest(WifiBaseTest):
+
+ def setup_class(self):
+ """Configure the required networks for testing roaming."""
+ super().setup_class()
+
+ self.dut = self.android_devices[0]
+ wutils.wifi_test_device_init(self.dut)
+ req_params = ["roaming_attn",]
+ self.unpack_userparams(req_param_names=req_params,)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start(ap_count=2)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ wpa_network=True,
+ owe_network=True,
+ sae_network=True,
+ ap_count=2,
+ mirror_ap=True)
+
+ def teardown_class(self):
+ self.dut.ed.clear_all_events()
+ if "AccessPoint" in self.user_params:
+ del self.user_params["reference_networks"]
+ del self.user_params["open_network"]
+
+ def setup_test(self):
+ super().setup_test()
+ self.dut.ed.clear_all_events()
+ self.dut.droid.wakeLockAcquireBright()
+ self.dut.droid.wakeUpNow()
+
+ def teardown_test(self):
+ super().teardown_test()
+ self.dut.droid.wakeLockRelease()
+ self.dut.droid.goToSleepNow()
+ wutils.reset_wifi(self.dut)
+ wutils.set_attns(self.attenuators, "default")
+
+ ### Helper Methods ###
+
+ def roaming_from_AP1_and_AP2(self, AP1_network, AP2_network):
+ """Test roaming between two APs.
+
+ Args:
+ AP1_network: AP-1's network information.
+ AP2_network: AP-2's network information.
+
+ Steps:
+ 1. Make AP1 visible, AP2 not visible.
+ 2. Connect to AP1's ssid.
+ 3. Make AP1 not visible, AP2 visible.
+ 4. Expect DUT to roam to AP2.
+ 5. Validate connection information and ping.
+ """
+ wutils.set_attns(self.attenuators, "AP1_on_AP2_off", self.roaming_attn)
+ wifi_config = AP1_network.copy()
+ wifi_config.pop("bssid")
+ wutils.connect_to_wifi_network(self.dut, wifi_config)
+ self.log.info("Roaming from %s to %s", AP1_network, AP2_network)
+ wutils.trigger_roaming_and_validate(
+ self.dut, self.attenuators, "AP1_off_AP2_on", AP2_network,
+ self.roaming_attn)
+
+ ### Test Cases ###
+
+ @test_tracker_info(uuid="db8a46f9-713f-4b98-8d9f-d36319905b0a")
+ def test_roaming_between_AP1_to_AP2_open_2g(self):
+ ap1_network = self.open_network[0]["2g"]
+ ap2_network = self.open_network[1]["2g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["2g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["2g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="0db67d9b-6ea9-4f40-acf2-155c4ecf9dc5")
+ def test_roaming_between_AP1_to_AP2_open_5g(self):
+ ap1_network = self.open_network[0]["5g"]
+ ap2_network = self.open_network[1]["5g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["5g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["5g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="eabc7319-d962-4bef-b679-725e9ff00420")
+ def test_roaming_between_AP1_to_AP2_psk_2g(self):
+ ap1_network = self.reference_networks[0]["2g"]
+ ap2_network = self.reference_networks[1]["2g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["2g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["2g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="1cf9c681-4ff0-45c1-9719-f01629f6a7f7")
+ def test_roaming_between_AP1_to_AP2_psk_5g(self):
+ ap1_network = self.reference_networks[0]["5g"]
+ ap2_network = self.reference_networks[1]["5g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["5g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["5g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="a28f7d2e-fae4-4e66-b633-7ee59f8b46e0")
+ def test_roaming_between_AP1_to_AP2_owe_2g(self):
+ ap1_network = self.owe_networks[0]["2g"]
+ ap2_network = self.owe_networks[1]["2g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["2g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["2g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="3c39110a-9336-4abd-b885-acbba85dc10d")
+ def test_roaming_between_AP1_to_AP2_owe_5g(self):
+ ap1_network = self.owe_networks[0]["5g"]
+ ap2_network = self.owe_networks[1]["5g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["5g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["5g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="68b2baf6-162a-44f2-a00d-4973e5ac9471")
+ def test_roaming_between_AP1_to_AP2_sae_2g(self):
+ ap1_network = self.sae_networks[0]["2g"]
+ ap2_network = self.sae_networks[1]["2g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["2g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["2g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="20e24ed3-0cd1-46dd-bd26-2183ffb443e6")
+ def test_roaming_between_AP1_to_AP2_sae_5g(self):
+ ap1_network = self.sae_networks[0]["5g"]
+ ap2_network = self.sae_networks[1]["5g"]
+ if "OpenWrtAP" in self.user_params:
+ ap1_network["bssid"] = self.bssid_map[0]["5g"][ap1_network["SSID"]]
+ ap2_network["bssid"] = self.bssid_map[1]["5g"][ap2_network["SSID"]]
+ self.roaming_from_AP1_and_AP2(ap1_network, ap2_network)
+
+ @test_tracker_info(uuid="3114d625-5cdd-4205-bb46-5a9d057dc80d")
+ def test_roaming_fail_psk_2g(self):
+ network = {'SSID':'test_roaming_fail', 'password':'roam123456@'}
+ # AP2 network with incorrect password.
+ network_fail = {'SSID':'test_roaming_fail', 'password':'roam123456@#$%^'}
+ # Setup AP1 with the correct password.
+ wutils.ap_setup(self, 0, self.access_points[0], network)
+ network_bssid = self.access_points[0].get_bssid_from_ssid(
+ network["SSID"], '2g')
+ # Setup AP2 with the incorrect password.
+ wutils.ap_setup(self, 1, self.access_points[1], network_fail)
+ network_fail_bssid = self.access_points[1].get_bssid_from_ssid(
+ network_fail["SSID"], '2g')
+ network['bssid'] = network_bssid
+ network_fail['bssid'] = network_fail_bssid
+ try:
+ # Initiate roaming with AP2 configured with incorrect password.
+ self.roaming_from_AP1_and_AP2(network, network_fail)
+ except:
+ self.log.info("Roaming failed to AP2 with incorrect password.")
+ # Re-configure AP2 after roaming failed, with correct password.
+ self.log.info("Re-configuring AP2 with correct password.")
+ wutils.ap_setup(self, 1, self.access_points[1], network)
+ self.roaming_from_AP1_and_AP2(network, network_fail)
diff --git a/acts/tests/google/wifi/WifiRssiTest.py b/acts_tests/tests/google/wifi/WifiRssiTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiRssiTest.py
rename to acts_tests/tests/google/wifi/WifiRssiTest.py
diff --git a/acts/tests/google/wifi/WifiRttManagerTest.py b/acts_tests/tests/google/wifi/WifiRttManagerTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiRttManagerTest.py
rename to acts_tests/tests/google/wifi/WifiRttManagerTest.py
diff --git a/acts/tests/google/wifi/WifiRvrTest.py b/acts_tests/tests/google/wifi/WifiRvrTest.py
similarity index 96%
rename from acts/tests/google/wifi/WifiRvrTest.py
rename to acts_tests/tests/google/wifi/WifiRvrTest.py
index 637c2f5..979ac76 100644
--- a/acts/tests/google/wifi/WifiRvrTest.py
+++ b/acts_tests/tests/google/wifi/WifiRvrTest.py
@@ -508,10 +508,18 @@
wutils.reset_wifi(self.sta_dut)
wutils.set_wifi_country_code(self.sta_dut,
self.testclass_params['country_code'])
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.start_capture(
+ network={'SSID': testcase_params['test_network']['SSID']},
+ chan=testcase_params['channel'],
+ bw=testcase_params['mode'][3:],
+ duration=180)
wutils.wifi_connect(self.sta_dut,
testcase_params['test_network'],
num_of_tries=5,
check_connectivity=True)
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.stop_capture(tag='connection_setup')
def setup_rvr_test(self, testcase_params):
"""Function that gets devices ready for the test.
@@ -562,6 +570,16 @@
band = self.access_point.band_lookup_by_channel(
testcase_params['channel'])
testcase_params['test_network'] = self.main_network[band]
+ if testcase_params['traffic_type'] == 'TCP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'tcp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'tcp_processes', 1)
+ elif testcase_params['traffic_type'] == 'UDP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'udp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'udp_processes', 1)
if (testcase_params['traffic_direction'] == 'DL'
and not isinstance(self.iperf_server, ipf.IPerfServerOverAdb)
) or (testcase_params['traffic_direction'] == 'UL'
@@ -569,13 +587,17 @@
testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
duration=self.testclass_params['iperf_duration'],
reverse_direction=1,
- traffic_type=testcase_params['traffic_type'])
+ traffic_type=testcase_params['traffic_type'],
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'])
testcase_params['use_client_output'] = True
else:
testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
duration=self.testclass_params['iperf_duration'],
reverse_direction=0,
- traffic_type=testcase_params['traffic_type'])
+ traffic_type=testcase_params['traffic_type'],
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'])
testcase_params['use_client_output'] = False
return testcase_params
@@ -870,4 +892,4 @@
WifiOtaRvrTest.__init__(self, controllers)
self.tests = self.generate_test_cases(
[6, 36, 40, 44, 48, 149, 153, 157, 161],
- ['VHT20', 'VHT40', 'VHT80'], [0], ['TCP'], ['DL', 'UL'])
+ ['VHT20', 'VHT40', 'VHT80'], [0], ['TCP'], ['DL', 'UL'])
\ No newline at end of file
diff --git a/acts/tests/google/wifi/WifiRvrTwTest.py b/acts_tests/tests/google/wifi/WifiRvrTwTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiRvrTwTest.py
rename to acts_tests/tests/google/wifi/WifiRvrTwTest.py
diff --git a/acts/tests/google/wifi/WifiScannerBssidTest.py b/acts_tests/tests/google/wifi/WifiScannerBssidTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiScannerBssidTest.py
rename to acts_tests/tests/google/wifi/WifiScannerBssidTest.py
diff --git a/acts/tests/google/wifi/WifiScannerMultiScanTest.py b/acts_tests/tests/google/wifi/WifiScannerMultiScanTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiScannerMultiScanTest.py
rename to acts_tests/tests/google/wifi/WifiScannerMultiScanTest.py
index aebcaf7..da88012 100755
--- a/acts/tests/google/wifi/WifiScannerMultiScanTest.py
+++ b/acts_tests/tests/google/wifi/WifiScannerMultiScanTest.py
@@ -226,11 +226,11 @@
stime_channels: Dwell time plus 2ms.
dut: Android device(s).
wifi_chs: WiFi channels according to the device model.
- max_bugreports: Max number of bug reports allowed.
"""
- def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
self.tests = (
'test_wifi_two_scans_at_same_interval',
'test_wifi_two_scans_at_different_interval',
@@ -241,11 +241,7 @@
'test_wifi_scans_24GHz_5GHz_full_result',)
def setup_class(self):
- # If running in a setup with attenuators, set attenuation on all
- # channels to zero.
- if getattr(self, "attenuators", []):
- for a in self.attenuators:
- a.set_atten(0)
+ super().setup_class()
self.leeway = 5 # seconds, for event wait time computation
self.stime_channel = 47 #dwell time plus 2ms
self.dut = self.android_devices[0]
@@ -256,22 +252,16 @@
""" Setup the required dependencies and fetch the user params from
config file.
"""
- req_params = ["max_bugreports"]
opt_param = ["reference_networks"]
- self.unpack_userparams(
- req_param_names=req_params, opt_param_names=opt_param)
+ self.unpack_userparams(opt_param_names=opt_param)
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start()
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True)
self.wifi_chs = WifiChannelUS(self.dut.model)
- def on_fail(self, test_name, begin_time):
- if self.max_bugreports > 0:
- self.dut.take_bug_report(test_name, begin_time)
- self.max_bugreports -= 1
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiScannerScanTest.py b/acts_tests/tests/google/wifi/WifiScannerScanTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiScannerScanTest.py
rename to acts_tests/tests/google/wifi/WifiScannerScanTest.py
index a5633ac..f267078 100755
--- a/acts/tests/google/wifi/WifiScannerScanTest.py
+++ b/acts_tests/tests/google/wifi/WifiScannerScanTest.py
@@ -20,7 +20,6 @@
import traceback
from acts import asserts
-from acts import base_test
from acts import utils
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_constants
@@ -45,8 +44,9 @@
class WifiScannerScanTest(WifiBaseTest):
- def __init__(self, controllers):
- WifiBaseTest.__init__(self, controllers)
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
# TODO(angli): Remove this list.
# There are order dependencies among these tests so we'll have to leave
# it here for now. :(
@@ -71,9 +71,10 @@
"test_wifi_scanner_dual_radio_high_accuracy")
def setup_class(self):
+ super().setup_class()
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("run_extended_test", "ping_addr", "max_bugreports", "dbs_supported_models")
+ req_params = ("run_extended_test", "ping_addr", "dbs_supported_models")
opt_param = ["reference_networks"]
self.unpack_userparams(
req_param_names=req_params, opt_param_names=opt_param)
@@ -104,16 +105,10 @@
self.attenuators[1].set_atten(0)
def teardown_test(self):
- base_test.BaseTestClass.teardown_test(self)
+ super().teardown_test()
self.log.debug("Shut down all wifi scanner activities.")
self.dut.droid.wifiScannerShutdown()
- def on_fail(self, test_name, begin_time):
- if self.max_bugreports > 0:
- self.dut.take_bug_report(test_name, begin_time)
- self.max_bugreports -= 1
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
if "AccessPoint" in self.user_params:
del self.user_params["reference_networks"]
diff --git a/acts/tests/google/wifi/WifiScannerTests.config b/acts_tests/tests/google/wifi/WifiScannerTests.config
similarity index 100%
rename from acts/tests/google/wifi/WifiScannerTests.config
rename to acts_tests/tests/google/wifi/WifiScannerTests.config
diff --git a/acts/tests/google/wifi/WifiSensitivityTest.py b/acts_tests/tests/google/wifi/WifiSensitivityTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiSensitivityTest.py
rename to acts_tests/tests/google/wifi/WifiSensitivityTest.py
diff --git a/acts/tests/google/wifi/WifiServiceApiTest.py b/acts_tests/tests/google/wifi/WifiServiceApiTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiServiceApiTest.py
rename to acts_tests/tests/google/wifi/WifiServiceApiTest.py
index b5eed89..afe2a84 100644
--- a/acts/tests/google/wifi/WifiServiceApiTest.py
+++ b/acts_tests/tests/google/wifi/WifiServiceApiTest.py
@@ -19,15 +19,15 @@
import sys
import time
-from acts import base_test
from acts import signals
from acts import utils
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_constants
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
-class WifiServiceApiTest(base_test.BaseTestClass):
+class WifiServiceApiTest(WifiBaseTest):
"""This class tests the API surface of WifiManager in different wifi states.
Attributes:
@@ -48,6 +48,7 @@
Returns:
True is successfully configured the requirements for testig.
"""
+ super().setup_class()
self.dut = self.android_devices[0]
# Do a simple version of init - mainly just sync the time and enable
# verbose logging. We would also like to test with phones in less
@@ -65,9 +66,6 @@
def teardown_class(self):
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
-
def create_and_save_wifi_network_config(self):
""" Create a config with random SSID and password.
diff --git a/acts/tests/google/wifi/WifiSoftApAcsTest.py b/acts_tests/tests/google/wifi/WifiSoftApAcsTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiSoftApAcsTest.py
rename to acts_tests/tests/google/wifi/WifiSoftApAcsTest.py
index dc99381..a3cbdfe 100644
--- a/acts/tests/google/wifi/WifiSoftApAcsTest.py
+++ b/acts_tests/tests/google/wifi/WifiSoftApAcsTest.py
@@ -67,13 +67,14 @@
"Failed to enable WiFi verbose logging on the client dut.")
req_params = []
opt_param = ["iperf_server_address", "reference_networks",
- "iperf_server_port"]
+ "iperf_server_port", "pixel_models"]
self.unpack_userparams(
req_param_names=req_params, opt_param_names=opt_param)
self.chan_map = {v: k for k, v in hostapd_constants.CHANNEL_MAP.items()}
self.pcap_procs = None
def setup_test(self):
+ super().setup_test()
if hasattr(self, 'packet_capture'):
chan = self.test_name.split('_')[-1]
if chan.isnumeric():
@@ -81,17 +82,16 @@
self.packet_capture[0].configure_monitor_mode(band, int(chan))
self.pcap_procs = wutils.start_pcap(
self.packet_capture[0], band, self.test_name)
- wutils.start_cnss_diags(self.android_devices)
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.stop_wifi_tethering(self.dut)
wutils.reset_wifi(self.dut)
wutils.reset_wifi(self.dut_client)
- wutils.stop_cnss_diags(self.android_devices)
if hasattr(self, 'packet_capture') and self.pcap_procs:
wutils.stop_pcap(self.packet_capture[0], self.pcap_procs, False)
self.pcap_procs = None
@@ -103,11 +103,6 @@
pass
self.access_points[0].close()
- def on_fail(self, test_name, begin_time):
- for ad in self.android_devices:
- ad.take_bug_report(test_name, begin_time)
- wutils.get_cnss_diag_log(ad, test_name)
-
"""Helper Functions"""
def run_iperf_client(self, params):
@@ -174,15 +169,20 @@
channel_5g: The channel number to use for 5GHz network.
"""
+ if not channel_2g:
+ channel_2g = hostapd_constants.AP_DEFAULT_CHANNEL_2G
+ if not channel_5g:
+ channel_5g = hostapd_constants.AP_DEFAULT_CHANNEL_5G
if "AccessPoint" in self.user_params:
- if not channel_2g:
- channel_2g = hostapd_constants.AP_DEFAULT_CHANNEL_2G
- if not channel_5g:
- channel_5g = hostapd_constants.AP_DEFAULT_CHANNEL_5G
self.legacy_configure_ap_and_start(wpa_network=True,
wep_network=True,
channel_2g=channel_2g,
channel_5g=channel_5g)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(wpa_network=True,
+ wep_network=True,
+ channel_2g=channel_2g,
+ channel_5g=channel_5g)
def start_traffic_and_softap(self, network, softap_band):
"""Start iPerf traffic on client dut, during softAP bring-up on dut.
diff --git a/acts/tests/google/wifi/WifiSoftApPerformanceTest.py b/acts_tests/tests/google/wifi/WifiSoftApPerformanceTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiSoftApPerformanceTest.py
rename to acts_tests/tests/google/wifi/WifiSoftApPerformanceTest.py
diff --git a/acts/tests/google/wifi/WifiSoftApTest.py b/acts_tests/tests/google/wifi/WifiSoftApTest.py
similarity index 94%
rename from acts/tests/google/wifi/WifiSoftApTest.py
rename to acts_tests/tests/google/wifi/WifiSoftApTest.py
index 8faf1c5..bcaab8d 100644
--- a/acts/tests/google/wifi/WifiSoftApTest.py
+++ b/acts_tests/tests/google/wifi/WifiSoftApTest.py
@@ -22,7 +22,6 @@
from acts import asserts
from acts import utils
from acts.test_decorators import test_tracker_info
-from acts.test_utils.net import arduino_test_utils as dutils
from acts.test_utils.net import socket_test_utils as sutils
from acts.test_utils.tel import tel_defines
from acts.test_utils.tel import tel_test_utils as tel_utils
@@ -44,6 +43,7 @@
Returns:
True if successfully configured the requirements for testing.
"""
+ super().setup_class()
self.dut = self.android_devices[0]
self.dut_client = self.android_devices[1]
req_params = ["dbs_supported_models"]
@@ -52,6 +52,8 @@
req_param_names=req_params, opt_param_names=opt_param)
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start()
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True)
self.open_network = self.open_network[0]["2g"]
# Do a simple version of init - mainly just sync the time and enable
# verbose logging. This test will fail if the DUT has a sim and cell
@@ -94,19 +96,18 @@
del self.user_params["open_network"]
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
wutils.wifi_toggle_state(ad, True)
def teardown_test(self):
+ super().teardown_test()
self.dut.log.debug("Toggling Airplane mode OFF.")
asserts.assert_true(utils.force_airplane_mode(self.dut, False),
"Can not turn off airplane mode: %s" % self.dut.serial)
if self.dut.droid.wifiIsApEnabled():
wutils.stop_wifi_tethering(self.dut)
-
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut_client.take_bug_report(test_name, begin_time)
+ wutils.set_wifi_country_code(self.dut, wutils.WifiEnums.CountryCode.US)
""" Helper Functions """
def create_softap_config(self):
@@ -136,31 +137,6 @@
wutils.start_wifi_connection_scan_and_ensure_network_not_found(
self.dut_client, ap_ssid);
- def validate_traffic_between_softap_clients(self, config):
- """Send traffic between softAp clients.
-
- Connect SoftAp clients to the wifi hotspot; one android
- device and the other arduino wifi controller. Send UDP traffic
- between the clients and verify that expected messages are received.
-
- Args:
- config: wifi network config with SSID, password
- """
- ad = self.dut_client
- wd = self.arduino_wifi_dongles[0]
- wutils.wifi_connect(ad, config, check_connectivity=False)
- dutils.connect_wifi(wd, config)
- local_ip = ad.droid.connectivityGetIPv4Addresses('wlan0')[0]
- remote_ip = wd.ip_address()
- port = random.randint(8000, 9000)
- self.log.info("IP addr on android device: %s" % local_ip)
- self.log.info("IP addr on arduino device: %s" % remote_ip)
-
- socket = sutils.open_datagram_socket(ad, local_ip, port)
- sutils.send_recv_data_datagram_sockets(
- ad, ad, socket, socket, remote_ip, port)
- sutils.close_datagram_socket(ad, socket)
-
def check_cell_data_and_enable(self):
"""Make sure that cell data is enabled if there is a sim present.
@@ -210,8 +186,6 @@
if test_ping:
self.validate_ping_between_softap_and_client(config)
if test_clients:
- if hasattr(self, 'arduino_wifi_dongles'):
- self.validate_traffic_between_softap_clients(config)
if len(self.android_devices) > 2:
self.validate_ping_between_two_clients(config)
wutils.stop_wifi_tethering(self.dut)
@@ -427,24 +401,6 @@
wutils.wifi_toggle_state(self.dut, True)
self.validate_full_tether_startup(WIFI_CONFIG_APBAND_2G)
- @test_tracker_info(uuid="05c6f929-7754-477f-a9cd-f77e850b818b")
- def test_full_tether_startup_2G_multiple_clients(self):
- """Test full startup of wifi tethering in 2G band, connect clients
- to softAp and send traffic between them.
-
- 1. Report current state.
- 2. Switch to AP mode.
- 3. verify SoftAP active.
- 4. Connect clients to softAp.
- 5. Send and recv UDP traffic between them.
- 6. Shutdown wifi tethering.
- 7. verify back to previous mode.
- """
- asserts.skip_if(not hasattr(self, 'arduino_wifi_dongles'),
- "No wifi dongles connected. Skipping test")
- self.validate_full_tether_startup(WIFI_CONFIG_APBAND_2G,
- test_clients=True)
-
@test_tracker_info(uuid="883dd5b1-50c6-4958-a50f-bb4bea77ccaf")
def test_full_tether_startup_2G_one_client_ping_softap(self):
"""(AP) 1 Device can connect to 2G hotspot
@@ -883,6 +839,36 @@
# Unregister callback
self.dut.droid.unregisterSoftApCallback(callbackId)
+
+ @test_tracker_info(uuid="07b4e5b3-48ce-49b9-a83e-3e288bb88e91")
+ def test_softap_5g_preferred_country_code_de(self):
+ """Verify softap works when set to 5G preferred band
+ with country code 'DE'.
+
+ Steps:
+ 1. Set country code to Germany
+ 2. Save a softap configuration set to 5G preferred band.
+ 3. Start softap and verify it works
+ 4. Verify a client device can connect to it.
+ """
+ wutils.set_wifi_country_code(
+ self.dut, wutils.WifiEnums.CountryCode.GERMANY)
+ sap_config = self.create_softap_config()
+ wifi_network = sap_config.copy()
+ sap_config[
+ WifiEnums.AP_BAND_KEY] = WifiEnums.WIFI_CONFIG_SOFTAP_BAND_2G_5G
+ sap_config[WifiEnums.SECURITY] = WifiEnums.SoftApSecurityType.WPA2
+ asserts.assert_true(
+ self.dut.droid.wifiSetWifiApConfiguration(sap_config),
+ "Failed to set WifiAp Configuration")
+ wutils.start_wifi_tethering_saved_config(self.dut)
+ softap_conf = self.dut.droid.wifiGetApConfiguration()
+ self.log.info("softap conf: %s" % softap_conf)
+ sap_band = softap_conf[WifiEnums.AP_BAND_KEY]
+ asserts.assert_true(
+ sap_band == WifiEnums.WIFI_CONFIG_SOFTAP_BAND_2G_5G,
+ "Soft AP didn't start in 5G preferred band")
+ wutils.connect_to_wifi_network(self.dut_client, wifi_network)
""" Tests End """
diff --git a/acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py b/acts_tests/tests/google/wifi/WifiStaApConcurrencyStressTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py
rename to acts_tests/tests/google/wifi/WifiStaApConcurrencyStressTest.py
diff --git a/acts/tests/google/wifi/WifiStaApConcurrencyTest.py b/acts_tests/tests/google/wifi/WifiStaApConcurrencyTest.py
similarity index 91%
rename from acts/tests/google/wifi/WifiStaApConcurrencyTest.py
rename to acts_tests/tests/google/wifi/WifiStaApConcurrencyTest.py
index d44b7dc..035cac3 100644
--- a/acts/tests/google/wifi/WifiStaApConcurrencyTest.py
+++ b/acts_tests/tests/google/wifi/WifiStaApConcurrencyTest.py
@@ -77,12 +77,14 @@
"Device %s does not support dual interfaces." % self.dut.model)
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
self.turn_location_off_and_scan_toggle_off()
def teardown_test(self):
+ super().teardown_test()
# Prevent the stop wifi tethering failure to block ap close
try:
wutils.stop_wifi_tethering(self.dut)
@@ -95,17 +97,13 @@
self.turn_location_on_and_scan_toggle_on()
wutils.wifi_toggle_state(self.dut, True)
self.access_points[0].close()
- try:
- del self.user_params["reference_networks"]
- del self.user_params["open_network"]
- except KeyError as e:
- self.log.warn("There is no 'reference_network' or "
- "'open_network' to delete")
-
- def on_fail(self, test_name, begin_time):
- for ad in self.android_devices:
- ad.take_bug_report(test_name, begin_time)
- ad.cat_adb_log(test_name, begin_time)
+ if "AccessPoint" in self.user_params:
+ try:
+ del self.user_params["reference_networks"]
+ del self.user_params["open_network"]
+ except KeyError as e:
+ self.log.warn("There is no 'reference_network' or "
+ "'open_network' to delete")
### Helper Functions ###
@@ -121,8 +119,13 @@
channel_2g = hostapd_constants.AP_DEFAULT_CHANNEL_2G
if not channel_5g:
channel_5g = hostapd_constants.AP_DEFAULT_CHANNEL_5G
- self.legacy_configure_ap_and_start(channel_2g=channel_2g,
- channel_5g=channel_5g)
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start(channel_2g=channel_2g,
+ channel_5g=channel_5g)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True,
+ channel_2g=channel_2g,
+ channel_5g=channel_5g)
self.open_2g = self.open_network[0]["2g"]
self.open_5g = self.open_network[0]["5g"]
@@ -429,24 +432,3 @@
self.open_2g, WIFI_CONFIG_APBAND_2G)
self.softap_change_band(self.dut)
- @test_tracker_info(uuid="96486473-58fb-407b-8912-eee0a33f311b")
- def test_mobile_data_with_wifi_connection_2G_softap_2G_to_softap_5g(self):
- """Enable Mobile Data then
- test connection to 2G network followed by SoftAp on 2G,
- and switch SoftAp to 5G."""
- self.enable_mobile_data(self.dut)
- self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
- self.connect_to_wifi_network_and_start_softap(
- self.open_2g, WIFI_CONFIG_APBAND_2G)
- self.softap_change_band(self.dut)
-
- @test_tracker_info(uuid="34589851-93f9-4cd4-8cff-5286586a23c2")
- def test_mobile_data_with_wifi_connection_5G_softap_2G_to_softap_5g(self):
- """Enable Mobile Data then
- test connection to 2G network followed by SoftAp on 2G,
- and switch SoftAp to 5G."""
- self.enable_mobile_data(self.dut)
- self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
- self.connect_to_wifi_network_and_start_softap(
- self.open_2g, WIFI_CONFIG_APBAND_2G)
- self.softap_change_band(self.dut)
diff --git a/acts/tests/google/wifi/WifiStressTest.py b/acts_tests/tests/google/wifi/WifiStressTest.py
similarity index 98%
rename from acts/tests/google/wifi/WifiStressTest.py
rename to acts_tests/tests/google/wifi/WifiStressTest.py
index e31adbb..10ba578 100644
--- a/acts/tests/google/wifi/WifiStressTest.py
+++ b/acts_tests/tests/google/wifi/WifiStressTest.py
@@ -46,6 +46,9 @@
* Several Wi-Fi networks visible to the device, including an open Wi-Fi
network.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -79,20 +82,18 @@
self.networks = [self.wpa_2g, self.wpa_5g, self.open_2g, self.open_5g]
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
def teardown_test(self):
+ super().teardown_test()
if self.dut.droid.wifiIsApEnabled():
wutils.stop_wifi_tethering(self.dut)
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def teardown_class(self):
wutils.reset_wifi(self.dut)
if "AccessPoint" in self.user_params:
diff --git a/acts/tests/google/wifi/WifiTeleCoexTest.py b/acts_tests/tests/google/wifi/WifiTeleCoexTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTeleCoexTest.py
rename to acts_tests/tests/google/wifi/WifiTeleCoexTest.py
diff --git a/acts/tests/google/wifi/WifiTethering2GOpenOTATest.py b/acts_tests/tests/google/wifi/WifiTethering2GOpenOTATest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTethering2GOpenOTATest.py
rename to acts_tests/tests/google/wifi/WifiTethering2GOpenOTATest.py
diff --git a/acts/tests/google/wifi/WifiTethering2GPskOTATest.py b/acts_tests/tests/google/wifi/WifiTethering2GPskOTATest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTethering2GPskOTATest.py
rename to acts_tests/tests/google/wifi/WifiTethering2GPskOTATest.py
diff --git a/acts/tests/google/wifi/WifiTethering5GOpenOTATest.py b/acts_tests/tests/google/wifi/WifiTethering5GOpenOTATest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTethering5GOpenOTATest.py
rename to acts_tests/tests/google/wifi/WifiTethering5GOpenOTATest.py
diff --git a/acts/tests/google/wifi/WifiTethering5GPskOTATest.py b/acts_tests/tests/google/wifi/WifiTethering5GPskOTATest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTethering5GPskOTATest.py
rename to acts_tests/tests/google/wifi/WifiTethering5GPskOTATest.py
diff --git a/acts/tests/google/wifi/WifiTetheringPowerTest.py b/acts_tests/tests/google/wifi/WifiTetheringPowerTest.py
similarity index 100%
rename from acts/tests/google/wifi/WifiTetheringPowerTest.py
rename to acts_tests/tests/google/wifi/WifiTetheringPowerTest.py
diff --git a/acts/tests/google/wifi/WifiTetheringTest.py b/acts_tests/tests/google/wifi/WifiTetheringTest.py
similarity index 97%
rename from acts/tests/google/wifi/WifiTetheringTest.py
rename to acts_tests/tests/google/wifi/WifiTetheringTest.py
index b1c92cc..56c6427 100644
--- a/acts/tests/google/wifi/WifiTetheringTest.py
+++ b/acts_tests/tests/google/wifi/WifiTetheringTest.py
@@ -19,7 +19,6 @@
import time
from acts import asserts
-from acts import base_test
from acts import test_runner
from acts import utils
from acts.controllers import adb
@@ -34,15 +33,16 @@
from acts.test_utils.net import arduino_test_utils as dutils
from acts.test_utils.net import net_test_utils as nutils
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
WAIT_TIME = 5
-class WifiTetheringTest(base_test.BaseTestClass):
+class WifiTetheringTest(WifiBaseTest):
""" Tests for Wifi Tethering """
def setup_class(self):
""" Setup devices for tethering and unpack params """
-
+ super().setup_class()
self.hotspot_device = self.android_devices[0]
self.tethered_devices = self.android_devices[1:]
req_params = ("url", "open_network")
@@ -50,36 +50,26 @@
self.network = {"SSID": "hotspot_%s" % utils.rand_ascii_str(6),
"password": "pass_%s" % utils.rand_ascii_str(6)}
self.new_ssid = "hs_%s" % utils.rand_ascii_str(6)
- self.tcpdump_pid=[]
nutils.verify_lte_data_and_tethering_supported(self.hotspot_device)
for ad in self.tethered_devices:
wutils.wifi_test_device_init(ad)
def setup_test(self):
- for ad in self.android_devices:
- self.tcpdump_pid.append(nutils.start_tcpdump(ad, self.test_name))
+ super().setup_test()
self.tethered_devices[0].droid.telephonyToggleDataConnection(False)
def teardown_test(self):
+ super().teardown_test()
if self.hotspot_device.droid.wifiIsApEnabled():
wutils.stop_wifi_tethering(self.hotspot_device)
self.tethered_devices[0].droid.telephonyToggleDataConnection(True)
- for ad, pid in zip(self.android_devices, self.tcpdump_pid):
- nutils.stop_tcpdump(ad, pid, self.test_name)
- self.tcpdump_pid = []
-
def teardown_class(self):
""" Reset devices """
for ad in self.tethered_devices:
wutils.reset_wifi(ad)
- def on_fail(self, test_name, begin_time):
- """ Collect bug report on failure """
- for ad in self.android_devices:
- ad.take_bug_report(test_name, begin_time)
-
""" Helper functions """
def _is_ipaddress_ipv6(self, ip_address):
diff --git a/acts/tests/google/wifi/WifiThroughputStabilityTest.py b/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
similarity index 96%
rename from acts/tests/google/wifi/WifiThroughputStabilityTest.py
rename to acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
index 7e2c3ef..71ed011 100644
--- a/acts/tests/google/wifi/WifiThroughputStabilityTest.py
+++ b/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
@@ -400,6 +400,16 @@
testcase_params['channel'])
testcase_params['test_network'] = self.main_network[band]
+ if testcase_params['traffic_type'] == 'TCP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'tcp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'tcp_processes', 1)
+ elif testcase_params['traffic_type'] == 'UDP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'udp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'udp_processes', 1)
if (testcase_params['traffic_direction'] == 'DL'
and not isinstance(self.iperf_server, ipf.IPerfServerOverAdb)
) or (testcase_params['traffic_direction'] == 'UL'
@@ -407,13 +417,17 @@
testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
duration=self.testclass_params['iperf_duration'],
reverse_direction=1,
- traffic_type=testcase_params['traffic_type'])
+ traffic_type=testcase_params['traffic_type'],
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'])
testcase_params['use_client_output'] = True
else:
testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
duration=self.testclass_params['iperf_duration'],
reverse_direction=0,
- traffic_type=testcase_params['traffic_type'])
+ traffic_type=testcase_params['traffic_type'],
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'])
testcase_params['use_client_output'] = False
return testcase_params
@@ -610,4 +624,4 @@
['TCP'], ['DL', 'UL'],
['high', 'low'],
'stepped stirrers',
- list(range(100)))
+ list(range(100)))
\ No newline at end of file
diff --git a/acts/tests/google/wifi/WifiWakeTest.py b/acts_tests/tests/google/wifi/WifiWakeTest.py
similarity index 92%
rename from acts/tests/google/wifi/WifiWakeTest.py
rename to acts_tests/tests/google/wifi/WifiWakeTest.py
index 82e2419..52ab2fd 100644
--- a/acts/tests/google/wifi/WifiWakeTest.py
+++ b/acts_tests/tests/google/wifi/WifiWakeTest.py
@@ -32,6 +32,7 @@
LAST_DISCONNECT_TIMEOUT_SEC = LAST_DISCONNECT_TIMEOUT_MILLIS / 1000
PRESCAN_DELAY_SEC = 5
WIFI_TOGGLE_DELAY_SEC = 3
+DISCONNECT_TIMEOUT_SEC = 20
class WifiWakeTest(WifiBaseTest):
@@ -42,6 +43,9 @@
* One Android Device
* Two APs that can be turned on and off
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
@@ -57,6 +61,9 @@
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start(mirror_ap=False, ap_count=2)
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(wpa_network=True,
+ ap_count=2)
# use 2G since Wifi Wake does not work if an AP is on a 5G DFS channel
self.ap_a = self.reference_networks[0]["2g"]
@@ -64,34 +71,53 @@
self.ap_a_atten = self.attenuators[0]
self.ap_b_atten = self.attenuators[2]
+ if "OpenWrtAP" in self.user_params:
+ self.ap_b_atten = self.attenuators[1]
# TODO(b/119040540): this method of disabling/re-enabling Wifi on APs is
# hacky, switch to using public methods when they are implemented
def ap_a_off(self):
+ if "OpenWrtAP" in self.user_params:
+ self.access_points[0].stop_ap()
+ self.log.info('Turned AP A off')
+ return
ap_a_hostapd = self.access_points[0]._aps['wlan0'].hostapd
if ap_a_hostapd.is_alive():
ap_a_hostapd.stop()
self.log.info('Turned AP A off')
def ap_a_on(self):
+ if "OpenWrtAP" in self.user_params:
+ self.access_points[0].start_ap()
+ self.log.info('Turned AP A on')
+ return
ap_a_hostapd = self.access_points[0]._aps['wlan0'].hostapd
if not ap_a_hostapd.is_alive():
ap_a_hostapd.start(ap_a_hostapd.config)
self.log.info('Turned AP A on')
def ap_b_off(self):
+ if "OpenWrtAP" in self.user_params:
+ self.access_points[1].stop_ap()
+ self.log.info('Turned AP B off')
+ return
ap_b_hostapd = self.access_points[1]._aps['wlan0'].hostapd
if ap_b_hostapd.is_alive():
ap_b_hostapd.stop()
self.log.info('Turned AP B off')
def ap_b_on(self):
+ if "OpenWrtAP" in self.user_params:
+ self.access_points[1].start_ap()
+ self.log.info('Turned AP B on')
+ return
ap_b_hostapd = self.access_points[1]._aps['wlan0'].hostapd
if not ap_b_hostapd.is_alive():
ap_b_hostapd.start(ap_b_hostapd.config)
self.log.info('Turned AP B on')
def setup_test(self):
+ super().setup_test()
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
self.ap_a_on()
@@ -106,13 +132,10 @@
self.dut.ed.clear_all_events()
def teardown_test(self):
+ super().teardown_test()
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
- def on_fail(self, test_name, begin_time):
- self.dut.take_bug_report(test_name, begin_time)
- self.dut.cat_adb_log(test_name, begin_time)
-
def find_ssid_in_scan_results(self, scan_results_batches, ssid):
scan_results_batch = scan_results_batches[0]
scan_results = scan_results_batch["ScanResults"]
@@ -195,7 +218,7 @@
self.dut.ed.clear_all_events()
self.ap_a_off()
self.ap_b_off()
- wutils.wait_for_disconnect(self.dut)
+ wutils.wait_for_disconnect(self.dut, DISCONNECT_TIMEOUT_SEC)
self.log.info("Wifi Disconnected")
self.do_location_scan(2)
time.sleep(LAST_DISCONNECT_TIMEOUT_SEC * 1.2)
@@ -239,7 +262,7 @@
self.ap_a_off()
self.ap_b_off()
- wutils.wait_for_disconnect(self.dut)
+ wutils.wait_for_disconnect(self.dut, DISCONNECT_TIMEOUT_SEC)
self.log.info("Wifi Disconnected")
self.do_location_scan(2)
time.sleep(LAST_DISCONNECT_TIMEOUT_SEC * 1.2)
@@ -307,7 +330,7 @@
wutils.wifi_connect(self.dut, self.ap_a, num_of_tries=5)
self.dut.ed.clear_all_events()
self.ap_a_off()
- wutils.wait_for_disconnect(self.dut)
+ wutils.wait_for_disconnect(self.dut, DISCONNECT_TIMEOUT_SEC)
self.log.info("Wifi Disconnected")
self.do_location_scan(2)
time.sleep(LAST_DISCONNECT_TIMEOUT_SEC * 1.2)
@@ -375,7 +398,7 @@
self.dut.ed.clear_all_events()
self.ap_a_off()
self.ap_b_off()
- wutils.wait_for_disconnect(self.dut)
+ wutils.wait_for_disconnect(self.dut, DISCONNECT_TIMEOUT_SEC)
self.log.info("Wifi Disconnected")
self.do_location_scan(2)
time.sleep(LAST_DISCONNECT_TIMEOUT_SEC * 1.2)
diff --git a/acts/tests/google/wifi/WifiWpa3EnterpriseTest.py b/acts_tests/tests/google/wifi/WifiWpa3EnterpriseTest.py
similarity index 95%
rename from acts/tests/google/wifi/WifiWpa3EnterpriseTest.py
rename to acts_tests/tests/google/wifi/WifiWpa3EnterpriseTest.py
index 8e1395b..5257766 100644
--- a/acts/tests/google/wifi/WifiWpa3EnterpriseTest.py
+++ b/acts_tests/tests/google/wifi/WifiWpa3EnterpriseTest.py
@@ -42,21 +42,19 @@
self.unpack_userparams(req_param_names=req_params,)
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
wutils.wifi_toggle_state(self.dut, True)
def teardown_test(self):
+ super().teardown_test()
for ad in self.android_devices:
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
- def on_fail(self, test_name, begin_time):
- self.dut.cat_adb_log(test_name, begin_time)
- self.dut.take_bug_report(test_name, begin_time)
-
### Tests ###
@test_tracker_info(uuid="404c6165-6e23-4ec1-bc2c-9dfdd5c7dc87")
diff --git a/acts/tests/google/wifi/WifiWpa3OweTest.py b/acts_tests/tests/google/wifi/WifiWpa3OweTest.py
similarity index 63%
rename from acts/tests/google/wifi/WifiWpa3OweTest.py
rename to acts_tests/tests/google/wifi/WifiWpa3OweTest.py
index ab0f23d..a3c70f3 100644
--- a/acts/tests/google/wifi/WifiWpa3OweTest.py
+++ b/acts_tests/tests/google/wifi/WifiWpa3OweTest.py
@@ -14,22 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import itertools
-import pprint
-import queue
-import time
-
-import acts.base_test
-import acts.signals as signals
import acts.test_utils.wifi.wifi_test_utils as wutils
-import acts.utils
-from acts import asserts
-from acts.controllers.ap_lib import hostapd_constants
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
-WifiEnums = wutils.WifiEnums
class WifiWpa3OweTest(WifiBaseTest):
"""Tests for APIs in Android's WifiManager class.
@@ -38,68 +27,56 @@
* At least one Android device and atleast two Access Points.
* Several Wi-Fi networks visible to the device.
"""
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.enable_packet_log = True
def setup_class(self):
super().setup_class()
self.dut = self.android_devices[0]
- self.dut_client = self.android_devices[1]
wutils.wifi_test_device_init(self.dut)
- wutils.wifi_test_device_init(self.dut_client)
- req_params = ["owe_networks", "wpa3_personal"]
- opt_param = []
- self.unpack_userparams(
- req_param_names=req_params, opt_param_names=opt_param)
+ req_params = ["owe_networks", "sae_networks"]
+ self.unpack_userparams(req_param_names=req_params,)
wutils.wifi_toggle_state(self.dut, True)
- wutils.wifi_toggle_state(self.dut_client, True)
+ if "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(owe_network=True,
+ sae_network=True)
self.owe_2g = self.owe_networks[0]["2g"]
self.owe_5g = self.owe_networks[0]["5g"]
- self.wpa3_personal_2g = self.wpa3_personal[0]["2g"]
- self.wpa3_personal_5g = self.wpa3_personal[0]["5g"]
+ self.wpa3_personal_2g = self.sae_networks[0]["2g"]
+ self.wpa3_personal_5g = self.sae_networks[0]["5g"]
def setup_test(self):
+ super().setup_test()
for ad in self.android_devices:
ad.droid.wakeLockAcquireBright()
ad.droid.wakeUpNow()
wutils.wifi_toggle_state(ad, True)
def teardown_test(self):
+ super().teardown_test()
for ad in self.android_devices:
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
- wutils.reset_wifi(self.dut_client)
- def on_fail(self, test_name, begin_time):
- self.dut.cat_adb_log(test_name, begin_time)
- self.dut.take_bug_report(test_name, begin_time)
-
- """Helper Functions"""
-
- """Tests"""
+ ### Test cases ###
@test_tracker_info(uuid="a7755f1f-5740-4d45-8c29-3711172b1bd7")
def test_connect_to_owe_2g(self):
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.owe_2g[WifiEnums.SSID_KEY])
- wutils.connect_to_wifi_network(self.dut, self.owe_2g )
+ wutils.connect_to_wifi_network(self.dut, self.owe_2g)
@test_tracker_info(uuid="9977765e-03da-4614-ab96-4c1597101118")
def test_connect_to_owe_5g(self):
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.owe_5g[WifiEnums.SSID_KEY])
wutils.connect_to_wifi_network(self.dut, self.owe_5g)
@test_tracker_info(uuid="3670702a-3d78-4184-b5e1-7fcf5fa48fd8")
def test_connect_to_wpa3_personal_2g(self):
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.wpa3_personal_2g[WifiEnums.SSID_KEY])
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
@test_tracker_info(uuid="c4528eaf-7960-4ecd-8f11-d5439bdf1c58")
def test_connect_to_wpa3_personal_5g(self):
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.wpa3_personal_5g[WifiEnums.SSID_KEY])
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_5g)
@test_tracker_info(uuid="a8fb46be-3487-4dc8-a393-5af992b27f45")
@@ -113,10 +90,6 @@
4. Initial connect request fails
Second connect request from framework succeeds.
"""
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.wpa3_personal_2g[WifiEnums.SSID_KEY])
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
wutils.toggle_wifi_off_and_on(self.dut)
- wutils.start_wifi_connection_scan_and_ensure_network_found(self.dut,
- self.wpa3_personal_2g[WifiEnums.SSID_KEY])
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
diff --git a/acts/tests/google/wifi/__init__.py b/acts_tests/tests/google/wifi/__init__.py
similarity index 100%
rename from acts/tests/google/wifi/__init__.py
rename to acts_tests/tests/google/wifi/__init__.py
diff --git a/acts/tests/google/wifi/aware/README.md b/acts_tests/tests/google/wifi/aware/README.md
similarity index 100%
rename from acts/tests/google/wifi/aware/README.md
rename to acts_tests/tests/google/wifi/aware/README.md
diff --git a/acts/tests/google/wifi/aware/config/wifi_aware.json b/acts_tests/tests/google/wifi/aware/config/wifi_aware.json
similarity index 100%
rename from acts/tests/google/wifi/aware/config/wifi_aware.json
rename to acts_tests/tests/google/wifi/aware/config/wifi_aware.json
diff --git a/acts/tests/google/wifi/aware/config/wifi_aware_non_interactive.json b/acts_tests/tests/google/wifi/aware/config/wifi_aware_non_interactive.json
similarity index 100%
rename from acts/tests/google/wifi/aware/config/wifi_aware_non_interactive.json
rename to acts_tests/tests/google/wifi/aware/config/wifi_aware_non_interactive.json
diff --git a/acts/tests/google/wifi/aware/functional/AttachTest.py b/acts_tests/tests/google/wifi/aware/functional/AttachTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/AttachTest.py
rename to acts_tests/tests/google/wifi/aware/functional/AttachTest.py
diff --git a/acts/tests/google/wifi/aware/functional/CapabilitiesTest.py b/acts_tests/tests/google/wifi/aware/functional/CapabilitiesTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/CapabilitiesTest.py
rename to acts_tests/tests/google/wifi/aware/functional/CapabilitiesTest.py
diff --git a/acts/tests/google/wifi/aware/functional/DataPathTest.py b/acts_tests/tests/google/wifi/aware/functional/DataPathTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/DataPathTest.py
rename to acts_tests/tests/google/wifi/aware/functional/DataPathTest.py
diff --git a/acts/tests/google/wifi/aware/functional/DiscoveryTest.py b/acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/DiscoveryTest.py
rename to acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py
diff --git a/acts/tests/google/wifi/aware/functional/MacRandomNoLeakageTest.py b/acts_tests/tests/google/wifi/aware/functional/MacRandomNoLeakageTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/MacRandomNoLeakageTest.py
rename to acts_tests/tests/google/wifi/aware/functional/MacRandomNoLeakageTest.py
diff --git a/acts/tests/google/wifi/aware/functional/MacRandomTest.py b/acts_tests/tests/google/wifi/aware/functional/MacRandomTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/MacRandomTest.py
rename to acts_tests/tests/google/wifi/aware/functional/MacRandomTest.py
diff --git a/acts/tests/google/wifi/aware/functional/MatchFilterTest.py b/acts_tests/tests/google/wifi/aware/functional/MatchFilterTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/MatchFilterTest.py
rename to acts_tests/tests/google/wifi/aware/functional/MatchFilterTest.py
diff --git a/acts/tests/google/wifi/aware/functional/MessageTest.py b/acts_tests/tests/google/wifi/aware/functional/MessageTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/MessageTest.py
rename to acts_tests/tests/google/wifi/aware/functional/MessageTest.py
diff --git a/acts/tests/google/wifi/aware/functional/NonConcurrencyTest.py b/acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/NonConcurrencyTest.py
rename to acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py
diff --git a/acts/tests/google/wifi/aware/functional/ProtocolsTest.py b/acts_tests/tests/google/wifi/aware/functional/ProtocolsTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/ProtocolsTest.py
rename to acts_tests/tests/google/wifi/aware/functional/ProtocolsTest.py
diff --git a/acts/tests/google/wifi/aware/functional/functional b/acts_tests/tests/google/wifi/aware/functional/functional
similarity index 100%
rename from acts/tests/google/wifi/aware/functional/functional
rename to acts_tests/tests/google/wifi/aware/functional/functional
diff --git a/acts/tests/google/wifi/aware/ota/ServiceIdsTest.py b/acts_tests/tests/google/wifi/aware/ota/ServiceIdsTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/ota/ServiceIdsTest.py
rename to acts_tests/tests/google/wifi/aware/ota/ServiceIdsTest.py
diff --git a/acts/tests/google/wifi/aware/ota/ota b/acts_tests/tests/google/wifi/aware/ota/ota
similarity index 100%
rename from acts/tests/google/wifi/aware/ota/ota
rename to acts_tests/tests/google/wifi/aware/ota/ota
diff --git a/acts/tests/google/wifi/aware/performance/LatencyTest.py b/acts_tests/tests/google/wifi/aware/performance/LatencyTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/performance/LatencyTest.py
rename to acts_tests/tests/google/wifi/aware/performance/LatencyTest.py
diff --git a/acts/tests/google/wifi/aware/performance/ThroughputTest.py b/acts_tests/tests/google/wifi/aware/performance/ThroughputTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/performance/ThroughputTest.py
rename to acts_tests/tests/google/wifi/aware/performance/ThroughputTest.py
diff --git a/acts_tests/tests/google/wifi/aware/performance/WifiAwareRvrTest.py b/acts_tests/tests/google/wifi/aware/performance/WifiAwareRvrTest.py
new file mode 100644
index 0000000..b1e71e1
--- /dev/null
+++ b/acts_tests/tests/google/wifi/aware/performance/WifiAwareRvrTest.py
@@ -0,0 +1,622 @@
+#!/usr/bin/env python3.4
+#
+# Copyright 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 collections
+import json
+import logging
+import os
+from acts import asserts
+from acts import base_test
+from acts import utils
+from acts.controllers import iperf_server as ipf
+from acts.controllers import iperf_client as ipc
+from acts.metrics.loggers.blackbox import BlackboxMappedMetricLogger
+from acts.test_utils.wifi import ota_sniffer
+from acts.test_utils.wifi import wifi_retail_ap as retail_ap
+from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi import wifi_performance_test_utils as wputils
+from acts.test_utils.wifi.aware import aware_const as aconsts
+from acts.test_utils.wifi.aware import aware_test_utils as autils
+from WifiRvrTest import WifiRvrTest
+
+AccessPointTuple = collections.namedtuple(('AccessPointTuple'),
+ ['ap_settings'])
+
+
+class WifiAwareRvrTest(WifiRvrTest):
+
+ # message ID counter to make sure all uses are unique
+ msg_id = 0
+
+ # offset (in seconds) to separate the start-up of multiple devices.
+ # De-synchronizes the start-up time so that they don't start and stop scanning
+ # at the same time - which can lead to very long clustering times.
+ device_startup_offset = 2
+
+ SERVICE_NAME = "GoogleTestServiceXYZ"
+
+ PASSPHRASE = "This is some random passphrase - very very secure!!"
+ PASSPHRASE2 = "This is some random passphrase - very very secure - but diff!!"
+
+ def __init__(self, controllers):
+ base_test.BaseTestClass.__init__(self, controllers)
+ self.testcase_metric_logger = (
+ BlackboxMappedMetricLogger.for_test_case())
+ self.testclass_metric_logger = (
+ BlackboxMappedMetricLogger.for_test_class())
+ self.publish_testcase_metrics = True
+
+ def setup_class(self):
+ """Initializes common test hardware and parameters.
+
+ This function initializes hardwares and compiles parameters that are
+ common to all tests in this class.
+ """
+ req_params = [
+ 'aware_rvr_test_params', 'testbed_params',
+ 'aware_default_power_mode', 'dbs_supported_models'
+ ]
+ opt_params = ['RetailAccessPoints', 'ap_networks', 'OTASniffer']
+ self.unpack_userparams(req_params, opt_params)
+ if hasattr(self, 'RetailAccessPoints'):
+ self.access_points = retail_ap.create(self.RetailAccessPoints)
+ self.access_point = self.access_points[0]
+ else:
+ self.access_point = AccessPointTuple({})
+ self.testclass_params = self.aware_rvr_test_params
+ self.num_atten = self.attenuators[0].instrument.num_atten
+ self.iperf_server = ipf.create([{
+ 'AndroidDevice':
+ self.android_devices[0].serial,
+ 'port':
+ '5201'
+ }])[0]
+ self.iperf_client = ipc.create([{
+ 'AndroidDevice':
+ self.android_devices[1].serial,
+ 'port':
+ '5201'
+ }])[0]
+
+ self.log_path = os.path.join(logging.log_path, 'results')
+ if hasattr(self,
+ 'OTASniffer') and self.testbed_params['sniffer_enable']:
+ self.sniffer = ota_sniffer.create(self.OTASniffer)[0]
+ os.makedirs(self.log_path, exist_ok=True)
+ if not hasattr(self, 'golden_files_list'):
+ if 'golden_results_path' in self.testbed_params:
+ self.golden_files_list = [
+ os.path.join(self.testbed_params['golden_results_path'],
+ file) for file in
+ os.listdir(self.testbed_params['golden_results_path'])
+ ]
+ else:
+ self.log.warning('No golden files found.')
+ self.golden_files_list = []
+
+ self.testclass_results = []
+
+ # Turn WiFi ON
+ if self.testclass_params.get('airplane_mode', 1):
+ self.log.info('Turning on airplane mode.')
+ for ad in self.android_devices:
+ asserts.assert_true(utils.force_airplane_mode(ad, True),
+ "Can not turn on airplane mode.")
+ for ad in self.android_devices:
+ wutils.wifi_toggle_state(ad, True)
+
+ def teardown_class(self):
+ # Turn WiFi OFF
+ for dev in self.android_devices:
+ wutils.wifi_toggle_state(dev, False)
+ self.process_testclass_results()
+ # Teardown AP and release its lockfile
+ self.access_point.teardown()
+
+ def teardown_test(self):
+ self.iperf_server.stop()
+ for ad in self.android_devices:
+ if not ad.droid.doesDeviceSupportWifiAwareFeature():
+ return
+ ad.droid.wifiP2pClose()
+ ad.droid.wifiAwareDestroyAll()
+ autils.reset_device_parameters(ad)
+ autils.validate_forbidden_callbacks(ad)
+ wutils.reset_wifi(ad)
+
+ def setup_aps(self, testcase_params):
+ for network in testcase_params['ap_networks']:
+ self.log.info('Setting AP {} {} interface on channel {}'.format(
+ network['ap_id'], network['interface_id'], network['channel']))
+ self.access_points[network['ap_id']].set_channel(
+ network['interface_id'], network['channel'])
+
+ def setup_duts(self, testcase_params):
+ # Check battery level before test
+ for ad in self.android_devices:
+ if not wputils.health_check(ad, 20):
+ asserts.skip('Overheating or Battery low. Skipping test.')
+ ad.go_to_sleep()
+ wutils.reset_wifi(ad)
+ # Turn screen off to preserve battery
+ for network in testcase_params['ap_networks']:
+ for connected_dut in network['connected_dut']:
+ self.log.info("Connecting DUT {} to {}".format(
+ connected_dut, self.ap_networks[network['ap_id']][
+ network['interface_id']]))
+ wutils.wifi_connect(self.android_devices[connected_dut],
+ self.ap_networks[network['ap_id']][
+ network['interface_id']],
+ num_of_tries=5,
+ check_connectivity=True)
+
+ def setup_aware_connection(self, testcase_params):
+ # Basic aware setup
+ for ad in self.android_devices:
+ asserts.skip_if(
+ not ad.droid.doesDeviceSupportWifiAwareFeature(),
+ "Device under test does not support Wi-Fi Aware - skipping test"
+ )
+ aware_avail = ad.droid.wifiIsAwareAvailable()
+ ad.droid.wifiP2pClose()
+ wutils.wifi_toggle_state(ad, True)
+ utils.set_location_service(ad, True)
+ if not aware_avail:
+ self.log.info('Aware not available. Waiting ...')
+ autils.wait_for_event(ad,
+ aconsts.BROADCAST_WIFI_AWARE_AVAILABLE,
+ timeout=30)
+ ad.aware_capabilities = autils.get_aware_capabilities(ad)
+ autils.reset_device_parameters(ad)
+ autils.reset_device_statistics(ad)
+ autils.set_power_mode_parameters(ad, testcase_params['power_mode'])
+ wutils.set_wifi_country_code(ad, wutils.WifiEnums.CountryCode.US)
+ autils.configure_ndp_allow_any_override(ad, True)
+ # set randomization interval to 0 (disable) to reduce likelihood of
+ # interference in tests
+ autils.configure_mac_random_interval(ad, 0)
+ ad.ed.clear_all_events()
+
+ # Establish Aware Connection
+ self.init_dut = self.android_devices[0]
+ self.resp_dut = self.android_devices[1]
+
+ # note: Publisher = Responder, Subscribe = Initiator
+ (resp_req_key, init_req_key, resp_aware_if, init_aware_if, resp_ipv6,
+ init_ipv6) = autils.create_ib_ndp(
+ self.resp_dut, self.init_dut,
+ autils.create_discovery_config(self.SERVICE_NAME,
+ aconsts.PUBLISH_TYPE_UNSOLICITED),
+ autils.create_discovery_config(self.SERVICE_NAME,
+ aconsts.SUBSCRIBE_TYPE_PASSIVE),
+ self.device_startup_offset)
+ testcase_params['aware_config'] = {
+ "init_req_key": init_req_key,
+ "resp_req_key": resp_req_key,
+ "init_aware_if": init_aware_if,
+ "resp_aware_if": resp_aware_if,
+ "init_ipv6": init_ipv6,
+ "resp_ipv6": resp_ipv6
+ }
+ testcase_params['iperf_server_address'] = init_ipv6
+ for ad in self.android_devices:
+ self.log.warning(
+ ad.adb.shell('cmd wifiaware native_cb get_channel_info'))
+ ndp_config = self.android_devices[0].adb.shell(
+ 'cmd wifiaware native_cb get_channel_info')
+ ndp_config = json.loads(ndp_config)
+ ndp_config = ndp_config[list(ndp_config.keys())[0]][0]
+ testcase_params['channel'] = wutils.WifiEnums.freq_to_channel[
+ ndp_config['channelFreq']]
+ if testcase_params['channel'] < 13:
+ testcase_params['mode'] = 'VHT20'
+ else:
+ testcase_params['mode'] = 'VHT80'
+ testcase_params['test_network'] = {'SSID': 'Aware'}
+ self.log.info('Wifi Aware Connection Established on Channel {} {} '
+ '(Interfaces: {},{})'.format(testcase_params['channel'],
+ testcase_params['mode'],
+ init_aware_if,
+ resp_aware_if))
+
+ def setup_aware_rvr_test(self, testcase_params):
+ # Setup the aps
+ self.setup_aps(testcase_params)
+ # Setup the duts
+ self.setup_duts(testcase_params)
+ # Set attenuator to 0 dB
+ for attenuator in self.attenuators:
+ attenuator.set_atten(0, strict=False)
+ # Setup the aware connection
+ self.setup_aware_connection(testcase_params)
+ # Set DUT to monitor RSSI and LLStats on
+ self.monitored_dut = self.android_devices[1]
+
+ def cleanup_aware_rvr_test(self, testcase_params):
+ # clean-up
+ self.resp_dut.droid.connectivityUnregisterNetworkCallback(
+ testcase_params['aware_config']['resp_req_key'])
+ self.init_dut.droid.connectivityUnregisterNetworkCallback(
+ testcase_params['aware_config']['init_req_key'])
+
+ def compile_test_params(self, testcase_params):
+ """Function that completes all test params based on the test name.
+
+ Args:
+ testcase_params: dict containing test-specific parameters
+ """
+ # Compile RvR parameters
+ num_atten_steps = int((self.testclass_params['atten_stop'] -
+ self.testclass_params['atten_start']) /
+ self.testclass_params['atten_step'])
+ testcase_params['atten_range'] = [
+ self.testclass_params['atten_start'] +
+ x * self.testclass_params['atten_step']
+ for x in range(0, num_atten_steps)
+ ]
+
+ # Compile iperf arguments
+ if testcase_params['traffic_type'] == 'TCP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'tcp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'tcp_processes', 1)
+ elif testcase_params['traffic_type'] == 'UDP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'udp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'udp_processes', 1)
+ testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
+ duration=self.testclass_params['iperf_duration'],
+ reverse_direction=(testcase_params['traffic_direction'] == 'DL'),
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'],
+ traffic_type=testcase_params['traffic_type'],
+ ipv6=True)
+ testcase_params['use_client_output'] = (
+ testcase_params['traffic_direction'] == 'DL')
+
+ # Compile AP and infrastructure connection parameters
+ ap_networks = []
+ if testcase_params['dut_connected'][0]:
+ band = testcase_params['dut_connected'][0].split('_')[0]
+ ap_networks.append({
+ 'ap_id':
+ 0,
+ 'interface_id':
+ band if band == '2G' else band + '_1',
+ 'band':
+ band,
+ 'channel':
+ 1 if band == '2G' else 36,
+ 'connected_dut': [0]
+ })
+
+ if testcase_params['dut_connected'][1]:
+ if testcase_params['dut_connected'][0] == testcase_params[
+ 'dut_connected'][1]:
+ # if connected to same network, add it to the above
+ ap_networks[0]['connected_dut'].append(1)
+ else:
+ band = testcase_params['dut_connected'][1].split('_')[0]
+ if not testcase_params['dut_connected'][0]:
+ # if it is the only dut connected, assign it to ap 0
+ ap_id = 0
+ elif band == ap_networks[0]['band']:
+ # if its connected to same band, connect to ap 1
+ ap_id = 1
+ else:
+ # if its on a different band, connect to ap 0 as well
+ ap_id = 1
+ ap_networks.append({
+ 'ap_id':
+ ap_id,
+ 'interface_id':
+ band if band == '2G' else band + '_1',
+ 'band':
+ band,
+ 'channel':
+ 11 if band == '2G' else 149,
+ 'connected_dut': [1]
+ })
+ testcase_params['ap_networks'] = ap_networks
+
+ return testcase_params
+
+ def _test_aware_rvr(self, testcase_params):
+ """ Function that gets called for each test case
+
+ Args:
+ testcase_params: dict containing test-specific parameters
+ """
+ # Compile test parameters from config and test name
+ testcase_params = self.compile_test_params(testcase_params)
+
+ # Prepare devices and run test
+ self.setup_aware_rvr_test(testcase_params)
+ rvr_result = self.run_rvr_test(testcase_params)
+ self.cleanup_aware_rvr_test(testcase_params)
+
+ # Post-process results
+ self.testclass_results.append(rvr_result)
+ self.process_test_results(rvr_result)
+ self.pass_fail_check(rvr_result)
+
+
+class WifiAwareRvr_TCP_Test(WifiAwareRvrTest):
+ #Test cases
+ def test_aware_rvr_TCP_DL_ib_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=[False, False],
+ )
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_DL_ib_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=[False, False],
+ )
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_TCP_UL_ib_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_2'])
+ self._test_aware_rvr(testcase_params)
+
+
+class WifiAwareRvr_UDP_Test(WifiAwareRvrTest):
+ #Test cases
+ def test_aware_rvr_UDP_DL_ib_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=[False, False],
+ )
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_DL_ib_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=[False, False],
+ )
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', False])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '5G_1'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['2G_1', '2G_2'])
+ self._test_aware_rvr(testcase_params)
+
+ def test_aware_rvr_UDP_UL_ib_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ power_mode='INTERACTIVE',
+ dut_connected=['5G_1', '5G_2'])
+ self._test_aware_rvr(testcase_params)
diff --git a/acts/tests/google/wifi/aware/performance/performance b/acts_tests/tests/google/wifi/aware/performance/performance
similarity index 100%
rename from acts/tests/google/wifi/aware/performance/performance
rename to acts_tests/tests/google/wifi/aware/performance/performance
diff --git a/acts/tests/google/wifi/aware/stress/DataPathStressTest.py b/acts_tests/tests/google/wifi/aware/stress/DataPathStressTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/stress/DataPathStressTest.py
rename to acts_tests/tests/google/wifi/aware/stress/DataPathStressTest.py
diff --git a/acts/tests/google/wifi/aware/stress/DiscoveryStressTest.py b/acts_tests/tests/google/wifi/aware/stress/DiscoveryStressTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/stress/DiscoveryStressTest.py
rename to acts_tests/tests/google/wifi/aware/stress/DiscoveryStressTest.py
diff --git a/acts/tests/google/wifi/aware/stress/InfraAssociationStressTest.py b/acts_tests/tests/google/wifi/aware/stress/InfraAssociationStressTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/stress/InfraAssociationStressTest.py
rename to acts_tests/tests/google/wifi/aware/stress/InfraAssociationStressTest.py
diff --git a/acts/tests/google/wifi/aware/stress/MessagesStressTest.py b/acts_tests/tests/google/wifi/aware/stress/MessagesStressTest.py
similarity index 100%
rename from acts/tests/google/wifi/aware/stress/MessagesStressTest.py
rename to acts_tests/tests/google/wifi/aware/stress/MessagesStressTest.py
diff --git a/acts/tests/google/wifi/aware/stress/stress b/acts_tests/tests/google/wifi/aware/stress/stress
similarity index 100%
rename from acts/tests/google/wifi/aware/stress/stress
rename to acts_tests/tests/google/wifi/aware/stress/stress
diff --git a/acts/tests/google/wifi/example_config_iot.json b/acts_tests/tests/google/wifi/example_config_iot.json
similarity index 100%
rename from acts/tests/google/wifi/example_config_iot.json
rename to acts_tests/tests/google/wifi/example_config_iot.json
diff --git a/acts/tests/google/wifi/example_config_sanity.json b/acts_tests/tests/google/wifi/example_config_sanity.json
similarity index 100%
rename from acts/tests/google/wifi/example_config_sanity.json
rename to acts_tests/tests/google/wifi/example_config_sanity.json
diff --git a/acts/tests/google/wifi/example_connectivity_performance_ap_sta.json b/acts_tests/tests/google/wifi/example_connectivity_performance_ap_sta.json
similarity index 100%
rename from acts/tests/google/wifi/example_connectivity_performance_ap_sta.json
rename to acts_tests/tests/google/wifi/example_connectivity_performance_ap_sta.json
diff --git a/acts/tests/google/wifi/p2p/config/wifi_p2p.json b/acts_tests/tests/google/wifi/p2p/config/wifi_p2p.json
similarity index 100%
rename from acts/tests/google/wifi/p2p/config/wifi_p2p.json
rename to acts_tests/tests/google/wifi/p2p/config/wifi_p2p.json
diff --git a/acts/tests/google/wifi/p2p/config/wifi_p2p_group.json b/acts_tests/tests/google/wifi/p2p/config/wifi_p2p_group.json
similarity index 100%
rename from acts/tests/google/wifi/p2p/config/wifi_p2p_group.json
rename to acts_tests/tests/google/wifi/p2p/config/wifi_p2p_group.json
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pGroupTest.py b/acts_tests/tests/google/wifi/p2p/functional/WifiP2pGroupTest.py
similarity index 100%
rename from acts/tests/google/wifi/p2p/functional/WifiP2pGroupTest.py
rename to acts_tests/tests/google/wifi/p2p/functional/WifiP2pGroupTest.py
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pLocalServiceTest.py b/acts_tests/tests/google/wifi/p2p/functional/WifiP2pLocalServiceTest.py
similarity index 100%
rename from acts/tests/google/wifi/p2p/functional/WifiP2pLocalServiceTest.py
rename to acts_tests/tests/google/wifi/p2p/functional/WifiP2pLocalServiceTest.py
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py b/acts_tests/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
similarity index 100%
rename from acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
rename to acts_tests/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pMultiPeersTest.py b/acts_tests/tests/google/wifi/p2p/functional/WifiP2pMultiPeersTest.py
similarity index 100%
rename from acts/tests/google/wifi/p2p/functional/WifiP2pMultiPeersTest.py
rename to acts_tests/tests/google/wifi/p2p/functional/WifiP2pMultiPeersTest.py
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py b/acts_tests/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
similarity index 100%
rename from acts/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
rename to acts_tests/tests/google/wifi/p2p/functional/WifiP2pSnifferTest.py
diff --git a/acts_tests/tests/google/wifi/p2p/performance/WifiP2pRvrTest.py b/acts_tests/tests/google/wifi/p2p/performance/WifiP2pRvrTest.py
new file mode 100644
index 0000000..85b9a0d
--- /dev/null
+++ b/acts_tests/tests/google/wifi/p2p/performance/WifiP2pRvrTest.py
@@ -0,0 +1,777 @@
+#!/usr/bin/env python3.4
+#
+# Copyright 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 collections
+import logging
+import os
+import re
+import time
+from acts import asserts
+from acts import base_test
+from acts import utils
+from acts.controllers import iperf_server as ipf
+from acts.controllers import iperf_client as ipc
+from acts.metrics.loggers.blackbox import BlackboxMappedMetricLogger
+from acts.test_utils.wifi import ota_sniffer
+from acts.test_utils.wifi import wifi_retail_ap as retail_ap
+from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi import wifi_performance_test_utils as wputils
+from acts.test_utils.wifi.p2p import wifi_p2p_const as p2pconsts
+from acts.test_utils.wifi.p2p import wifi_p2p_test_utils as wp2putils
+from WifiRvrTest import WifiRvrTest
+
+AccessPointTuple = collections.namedtuple(('AccessPointTuple'),
+ ['ap_settings'])
+
+
+class WifiP2pRvrTest(WifiRvrTest):
+ def __init__(self, controllers):
+ base_test.BaseTestClass.__init__(self, controllers)
+ self.testcase_metric_logger = (
+ BlackboxMappedMetricLogger.for_test_case())
+ self.testclass_metric_logger = (
+ BlackboxMappedMetricLogger.for_test_class())
+ self.publish_testcase_metrics = True
+
+ def setup_class(self):
+ """Initializes common test hardware and parameters.
+
+ This function initializes hardwares and compiles parameters that are
+ common to all tests in this class.
+ """
+ req_params = ['p2p_rvr_test_params', 'testbed_params']
+ opt_params = ['RetailAccessPoints', 'ap_networks', 'OTASniffer']
+ self.unpack_userparams(req_params, opt_params)
+ if hasattr(self, 'RetailAccessPoints'):
+ self.access_points = retail_ap.create(self.RetailAccessPoints)
+ self.access_point = self.access_points[0]
+ else:
+ self.access_point = AccessPointTuple({})
+ self.testclass_params = self.p2p_rvr_test_params
+ self.num_atten = self.attenuators[0].instrument.num_atten
+ self.iperf_server = ipf.create([{
+ 'AndroidDevice':
+ self.android_devices[0].serial,
+ 'port':
+ '5201'
+ }])[0]
+ self.iperf_client = ipc.create([{
+ 'AndroidDevice':
+ self.android_devices[1].serial,
+ 'port':
+ '5201'
+ }])[0]
+ if hasattr(self,
+ 'OTASniffer') and self.testbed_params['sniffer_enable']:
+ self.sniffer = ota_sniffer.create(self.OTASniffer)[0]
+ self.log_path = os.path.join(logging.log_path, 'results')
+ os.makedirs(self.log_path, exist_ok=True)
+ if not hasattr(self, 'golden_files_list'):
+ if 'golden_results_path' in self.testbed_params:
+ self.golden_files_list = [
+ os.path.join(self.testbed_params['golden_results_path'],
+ file) for file in
+ os.listdir(self.testbed_params['golden_results_path'])
+ ]
+ else:
+ self.log.warning('No golden files found.')
+ self.golden_files_list = []
+
+ self.testclass_results = []
+
+ # Turn WiFi ON
+ for ad in self.android_devices:
+ self.init_device(ad)
+
+ # Configure test retries
+ self.user_params['retry_tests'] = [self.__class__.__name__]
+
+ def init_device(self, ad):
+ asserts.assert_true(utils.force_airplane_mode(ad, False),
+ "Can not turn off airplane mode.")
+ utils.set_location_service(ad, True)
+ ad.droid.wifiScannerToggleAlwaysAvailable(False)
+ asserts.assert_true(not ad.droid.wifiScannerIsAlwaysAvailable(),
+ "Failed to turn off location service's scan.")
+ wutils.reset_wifi(ad)
+ utils.sync_device_time(ad)
+ ad.droid.telephonyToggleDataConnection(False)
+ country_code = self.testclass_params.get('country_code', 'US')
+ wutils.set_wifi_country_code(ad, country_code)
+ ad.droid.wifiP2pInitialize()
+ time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
+ asserts.assert_true(
+ ad.droid.wifiP2pIsEnabled(),
+ "{} p2p was not properly initialized".format(ad.serial))
+ ad.name = "Android_" + ad.serial
+ ad.droid.wifiP2pSetDeviceName(ad.name)
+
+ def teardown_class(self):
+ # Turn WiFi OFF
+ for ad in self.android_devices:
+ ad.droid.wifiP2pClose()
+ utils.set_location_service(ad, False)
+ #wutils.wifi_toggle_state(ad, False)
+ self.process_testclass_results()
+ # Teardown AP and release its lockfile
+ self.access_point.teardown()
+
+ def setup_test(self):
+ for ad in self.android_devices:
+ ad.droid.wakeLockAcquireBright()
+ ad.droid.wakeUpNow()
+ ad.ed.clear_all_events()
+ ad.droid.wifiP2pRemoveGroup()
+ time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
+
+ def teardown_test(self):
+ self.iperf_server.stop()
+ for ad in self.android_devices:
+ ad.droid.wifiP2pRemoveGroup()
+ time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
+ for ad in self.android_devices:
+ # Clear p2p group info
+ ad.droid.wifiP2pRequestPersistentGroupInfo()
+ event = ad.ed.pop_event("WifiP2pOnPersistentGroupInfoAvailable",
+ p2pconsts.DEFAULT_TIMEOUT)
+ for network in event['data']:
+ ad.droid.wifiP2pDeletePersistentGroup(network['NetworkId'])
+ # Clear p2p local service
+ ad.droid.wifiP2pClearLocalServices()
+ ad.droid.wakeLockRelease()
+ ad.droid.goToSleepNow()
+
+ def setup_aps(self, testcase_params):
+ for network in testcase_params['ap_networks']:
+ self.log.info('Setting AP {} {} interface on channel {}'.format(
+ network['ap_id'], network['interface_id'], network['channel']))
+ self.access_points[network['ap_id']].set_channel(
+ network['interface_id'], network['channel'])
+
+ def setup_duts(self, testcase_params):
+ # Check battery level before test
+ for ad in self.android_devices:
+ if not wputils.health_check(ad, 20):
+ asserts.skip('Overheating or Battery low. Skipping test.')
+ ad.go_to_sleep()
+ wutils.reset_wifi(ad)
+ # Turn BT on or off
+ bt_status = self.testclass_params.get('bluetooth_enabled', 1)
+ self.log.info('Setting Bluetooth status to {}.'.format(bt_status))
+ for ad in self.android_devices:
+ ad.droid.bluetoothToggleState(bt_status)
+ # Turn screen off to preserve battery
+ for network in testcase_params['ap_networks']:
+ for connected_dut in network['connected_dut']:
+ self.log.info("Connecting DUT {} to {}".format(
+ connected_dut, self.ap_networks[network['ap_id']][
+ network['interface_id']]))
+ wutils.wifi_connect(self.android_devices[connected_dut],
+ self.ap_networks[network['ap_id']][
+ network['interface_id']],
+ num_of_tries=5,
+ check_connectivity=True)
+
+ def get_p2p_mac_address(self, ad):
+ """Gets the current MAC address being used for Wi-Fi Direct."""
+ out = ad.adb.shell("ifconfig p2p0")
+ return re.match(".* HWaddr (\S+).*", out, re.S).group(1)
+
+ def _setup_p2p_connection_join_group(self, testcase_params):
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.start_capture(network={'SSID': 'dummy'},
+ chan=11,
+ bw=20,
+ duration=180)
+ # Create a group
+ self.go_dut = self.android_devices[0]
+ self.gc_dut = self.android_devices[1]
+ wp2putils.p2p_create_group(self.go_dut)
+ self.go_dut.ed.pop_event(p2pconsts.CONNECTED_EVENT,
+ p2pconsts.DEFAULT_TIMEOUT)
+ time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
+ # Request the connection
+ try:
+ wp2putils.p2p_connect(
+ self.gc_dut,
+ self.go_dut,
+ isReconnect=False,
+ p2p_connect_type=p2pconsts.P2P_CONNECT_JOIN,
+ wpsSetup=wp2putils.WifiP2PEnums.WpsInfo.WIFI_WPS_INFO_PBC)
+ except Exception as e:
+ # Stop sniffer
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.stop_capture(tag='connection_setup')
+ raise e
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.stop_capture(tag='connection_setup')
+
+ def _setup_p2p_connection_negotiation(self, testcase_params):
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.start_capture(network={'SSID': 'dummy'},
+ chan=11,
+ bw=20,
+ duration=180)
+ try:
+ wp2putils.p2p_connect(
+ self.android_devices[0],
+ self.android_devices[1],
+ False,
+ wpsSetup=wp2putils.WifiP2PEnums.WpsInfo.WIFI_WPS_INFO_PBC)
+ if wp2putils.is_go(self.android_devices[0]):
+ self.go_dut = self.android_devices[0]
+ self.gc_dut = self.android_devices[1]
+ elif wp2putils.is_go(self.android_devices[1]):
+ self.go_dut = self.android_devices[1]
+ self.gc_dut = self.android_devices[0]
+ except Exception as e:
+ # Stop sniffer
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.stop_capture(tag='connection_setup')
+ raise e
+ if self.testbed_params['sniffer_enable']:
+ self.sniffer.stop_capture(tag='connection_setup')
+
+ def _get_gc_ip(self, subnet_mask='255.255.255.0'):
+ subnet_mask = ['255', '255', '255', '0']
+ go_ip = wp2putils.p2p_go_ip(self.gc_dut)
+ dut_subnet = [
+ int(dut) & int(subnet)
+ for dut, subnet in zip(go_ip.split('.'), subnet_mask)
+ ]
+ ifconfig_out = self.gc_dut.adb.shell('ifconfig')
+ ip_list = re.findall('inet (?:addr:)?(\d+.\d+.\d+.\d+)', ifconfig_out)
+ for current_ip in ip_list:
+ current_subnet = [
+ int(ip) & int(subnet)
+ for ip, subnet in zip(current_ip.split('.'), subnet_mask)
+ ]
+ if current_subnet == dut_subnet:
+ return current_ip
+ logging.error('No IP address found in requested subnet')
+
+ def setup_p2p_connection(self, testcase_params):
+ """Sets up WiFi Direct connection before running RvR."""
+
+ if self.testclass_params['p2p_group_negotiaton']:
+ self._setup_p2p_connection_negotiation(testcase_params)
+ else:
+ self._setup_p2p_connection_join_group(testcase_params)
+
+ # Get iperf server address
+ if wp2putils.is_go(self.android_devices[0]):
+ testcase_params['iperf_server_address'] = wp2putils.p2p_go_ip(
+ self.gc_dut)
+ else:
+ testcase_params['iperf_server_address'] = self._get_gc_ip()
+
+ p2p_interface = wp2putils.p2p_get_current_group(
+ self.gc_dut)['Interface']
+ connection_rssi = wputils.get_connected_rssi(self.gc_dut,
+ interface=p2p_interface)
+ testcase_params['test_network'] = {'SSID': connection_rssi['ssid'][0]}
+ testcase_params['channel'] = wutils.WifiEnums.freq_to_channel[
+ connection_rssi['frequency'][0]]
+ if testcase_params['channel'] < 13:
+ testcase_params['mode'] = 'VHT20'
+ else:
+ testcase_params['mode'] = 'VHT80'
+ self.log.info('Wifi Direct Connection Established on Channel {} {} '
+ '(SSID: {})'.format(
+ testcase_params['channel'], testcase_params['mode'],
+ testcase_params['test_network']['SSID']))
+
+ def setup_p2p_rvr_test(self, testcase_params):
+ # Setup the aps
+ self.setup_aps(testcase_params)
+ # Setup the duts
+ self.setup_duts(testcase_params)
+ # Set attenuator to 0 dB
+ for attenuator in self.attenuators:
+ attenuator.set_atten(0, strict=False)
+ # Setup the p2p connection
+ self.setup_p2p_connection(testcase_params)
+ # Set DUT to monitor RSSI and LLStats on
+ self.monitored_dut = self.gc_dut
+ self.monitored_interface = wp2putils.p2p_get_current_group(
+ self.gc_dut)['Interface']
+
+ def cleanup_p2p_rvr_test(self, testcase_params):
+ # clean-up
+ wp2putils.p2p_disconnect(self.go_dut)
+ wp2putils.check_disconnect(self.gc_dut)
+ time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
+
+ def compile_test_params(self, testcase_params):
+ """Function that completes all test params based on the test name.
+
+ Args:
+ testcase_params: dict containing test-specific parameters
+ """
+ # Compile RvR parameters
+ num_atten_steps = int((self.testclass_params['atten_stop'] -
+ self.testclass_params['atten_start']) /
+ self.testclass_params['atten_step'])
+ testcase_params['atten_range'] = [
+ self.testclass_params['atten_start'] +
+ x * self.testclass_params['atten_step']
+ for x in range(0, num_atten_steps)
+ ]
+
+ # Compile iperf arguments
+ if testcase_params['traffic_type'] == 'TCP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'tcp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'tcp_processes', 1)
+ elif testcase_params['traffic_type'] == 'UDP':
+ testcase_params['iperf_socket_size'] = self.testclass_params.get(
+ 'udp_socket_size', None)
+ testcase_params['iperf_processes'] = self.testclass_params.get(
+ 'udp_processes', 1)
+ testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
+ duration=self.testclass_params['iperf_duration'],
+ reverse_direction=(testcase_params['traffic_direction'] == 'DL'),
+ traffic_type=testcase_params['traffic_type'],
+ socket_size=testcase_params['iperf_socket_size'],
+ num_processes=testcase_params['iperf_processes'],
+ ipv6=False)
+ testcase_params['use_client_output'] = (
+ testcase_params['traffic_direction'] == 'DL')
+
+ # Compile AP and infrastructure connection parameters
+ ap_networks = []
+ if testcase_params['dut_connected'][0]:
+ band = testcase_params['dut_connected'][0].split('_')[0]
+ ap_networks.append({
+ 'ap_id':
+ 0,
+ 'interface_id':
+ band if band == '2G' else band + '_1',
+ 'band':
+ band,
+ 'channel':
+ 1 if band == '2G' else 36,
+ 'connected_dut': [0]
+ })
+
+ if testcase_params['dut_connected'][1]:
+ if testcase_params['dut_connected'][0] == testcase_params[
+ 'dut_connected'][1]:
+ # if connected to same network, add it to the above
+ ap_networks[0]['connected_dut'].append(1)
+ else:
+ band = testcase_params['dut_connected'][1].split('_')[0]
+ if not testcase_params['dut_connected'][0]:
+ # if it is the only dut connected, assign it to ap 0
+ ap_id = 0
+ elif band == ap_networks[0]['band']:
+ # if its connected to same band, connect to ap 1
+ ap_id = 1
+ else:
+ # if its on a different band, connect to ap 0 as well
+ ap_id = 1
+ ap_networks.append({
+ 'ap_id':
+ ap_id,
+ 'interface_id':
+ band if band == '2G' else band + '_1',
+ 'band':
+ band,
+ 'channel':
+ 11 if band == '2G' else 149,
+ 'connected_dut': [1]
+ })
+ testcase_params['ap_networks'] = ap_networks
+
+ return testcase_params
+
+ def _test_p2p_rvr(self, testcase_params):
+ """ Function that gets called for each test case
+
+ Args:
+ testcase_params: dict containing test-specific parameters
+ """
+ # Compile test parameters from config and test name
+ testcase_params = self.compile_test_params(testcase_params)
+
+ # Prepare devices and run test
+ self.setup_p2p_rvr_test(testcase_params)
+ rvr_result = self.run_rvr_test(testcase_params)
+ self.cleanup_p2p_rvr_test(testcase_params)
+
+ # Post-process results
+ self.testclass_results.append(rvr_result)
+ self.process_test_results(rvr_result)
+ self.pass_fail_check(rvr_result)
+
+
+class WifiP2pRvr_TCP_Test(WifiP2pRvrTest):
+ #Test cases
+ def test_p2p_rvr_TCP_DL_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=[False, False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_disconnected_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=[False, '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_disconnected_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=[False, '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_5G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '2G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_DL_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '5G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=[False, False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_disconnected_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=[False, '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_disconnected_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=[False, '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_5G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '2G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_TCP_UL_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='TCP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '5G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+
+class WifiP2pRvr_UDP_Test(WifiP2pRvrTest):
+ #Test cases
+ def test_p2p_rvr_UDP_DL_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=[False, False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_disconnected_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=[False, '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_disconnected_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=[False, '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_5G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['2G_1', '2G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_DL_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='DL',
+ dut_connected=['5G_1', '5G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_disconnected_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=[False, False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_2G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_5G_1_disconnected(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', False],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_disconnected_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=[False, '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_disconnected_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=[False, '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_2G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_5G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_2G_1_connected_5G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '5G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_5G_1_connected_2G_1(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '2G_1'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_2G_1_connected_2G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['2G_1', '2G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
+
+ def test_p2p_rvr_UDP_UL_connected_5G_1_connected_5G_2(self):
+ testcase_params = collections.OrderedDict(
+ traffic_type='UDP',
+ traffic_direction='UL',
+ dut_connected=['5G_1', '5G_2'],
+ )
+ self._test_p2p_rvr(testcase_params)
diff --git a/acts/tests/google/wifi/rtt/README.md b/acts_tests/tests/google/wifi/rtt/README.md
similarity index 100%
rename from acts/tests/google/wifi/rtt/README.md
rename to acts_tests/tests/google/wifi/rtt/README.md
diff --git a/acts/tests/google/wifi/rtt/config/wifi_rtt.json b/acts_tests/tests/google/wifi/rtt/config/wifi_rtt.json
similarity index 100%
rename from acts/tests/google/wifi/rtt/config/wifi_rtt.json
rename to acts_tests/tests/google/wifi/rtt/config/wifi_rtt.json
diff --git a/acts/tests/google/wifi/rtt/functional/AwareDiscoveryWithRangingTest.py b/acts_tests/tests/google/wifi/rtt/functional/AwareDiscoveryWithRangingTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/AwareDiscoveryWithRangingTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/AwareDiscoveryWithRangingTest.py
diff --git a/acts/tests/google/wifi/rtt/functional/RangeApMiscTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeApMiscTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/RangeApMiscTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RangeApMiscTest.py
diff --git a/acts/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py
similarity index 98%
rename from acts/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py
index 1ffbb02..a40647b 100644
--- a/acts/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py
+++ b/acts_tests/tests/google/wifi/rtt/functional/RangeApNonSupporting11McTest.py
@@ -22,7 +22,7 @@
from acts.test_utils.wifi.rtt.RttBaseTest import RttBaseTest
-class RangeApNonSupporting11McTest(WifiBaseTest, RttBaseTest):
+class RangeApNonSupporting11McTest(RttBaseTest, WifiBaseTest):
"""Test class for RTT ranging to Access Points which do not support IEEE
802.11mc
"""
diff --git a/acts/tests/google/wifi/rtt/functional/RangeApSupporting11McTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeApSupporting11McTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/RangeApSupporting11McTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RangeApSupporting11McTest.py
diff --git a/acts/tests/google/wifi/rtt/functional/RangeAwareTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/RangeAwareTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py
diff --git a/acts/tests/google/wifi/rtt/functional/RangeSoftApTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeSoftApTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/RangeSoftApTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RangeSoftApTest.py
diff --git a/acts/tests/google/wifi/rtt/functional/RttDisableTest.py b/acts_tests/tests/google/wifi/rtt/functional/RttDisableTest.py
similarity index 96%
rename from acts/tests/google/wifi/rtt/functional/RttDisableTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RttDisableTest.py
index 635837c..703efac 100644
--- a/acts/tests/google/wifi/rtt/functional/RttDisableTest.py
+++ b/acts_tests/tests/google/wifi/rtt/functional/RttDisableTest.py
@@ -30,10 +30,15 @@
MODE_ENABLE_DOZE = 1
MODE_DISABLE_LOCATIONING = 2
+ def setup_test(self):
+ RttBaseTest.setup_test(self)
+
def setup_class(self):
super().setup_class()
if "AccessPoint" in self.user_params:
self.legacy_configure_ap_and_start()
+ elif "OpenWrtAP" in self.user_params:
+ self.configure_openwrt_ap_and_start(open_network=True)
def run_disable_rtt(self, disable_mode):
"""Validate the RTT disabled flows: whether by disabling Wi-Fi or entering
diff --git a/acts/tests/google/wifi/rtt/functional/RttRequestManagementTest.py b/acts_tests/tests/google/wifi/rtt/functional/RttRequestManagementTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/functional/RttRequestManagementTest.py
rename to acts_tests/tests/google/wifi/rtt/functional/RttRequestManagementTest.py
diff --git a/acts/tests/google/wifi/rtt/stress/StressRangeApTest.py b/acts_tests/tests/google/wifi/rtt/stress/StressRangeApTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/stress/StressRangeApTest.py
rename to acts_tests/tests/google/wifi/rtt/stress/StressRangeApTest.py
diff --git a/acts/tests/google/wifi/rtt/stress/StressRangeAwareTest.py b/acts_tests/tests/google/wifi/rtt/stress/StressRangeAwareTest.py
similarity index 100%
rename from acts/tests/google/wifi/rtt/stress/StressRangeAwareTest.py
rename to acts_tests/tests/google/wifi/rtt/stress/StressRangeAwareTest.py