diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-06-10 01:12:45 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-06-10 01:12:45 +0000 |
commit | 1bd9bc815f90985b4046ab6849c49aa27f59310c (patch) | |
tree | fff343b9ebc98e164c103e137d0fd28eb5f69a59 | |
parent | f34ebcfe4567f0b9613aab16254d19b19cb4727c (diff) | |
parent | baf15eb636444589fabe6c0901f21e0e7638788d (diff) | |
download | platform_tools_test_connectivity-1bd9bc815f90985b4046ab6849c49aa27f59310c.tar.gz platform_tools_test_connectivity-1bd9bc815f90985b4046ab6849c49aa27f59310c.tar.bz2 platform_tools_test_connectivity-1bd9bc815f90985b4046ab6849c49aa27f59310c.zip |
Snap for 6573866 from baf15eb636444589fabe6c0901f21e0e7638788d to rvc-release
Change-Id: Id4a9e8d7a305172c1115d4575842f784aecc9517
-rwxr-xr-x | acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py | 142 |
1 files changed, 38 insertions, 104 deletions
diff --git a/acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py b/acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py index 6dda5ddae5..f84c06c21e 100755 --- a/acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py +++ b/acts/tests/google/wifi/WifiStaApConcurrencyStressTest.py @@ -59,76 +59,38 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): "test_stress_softap_5G_wifi_connection_2G_with_location_scan_on") def setup_class(self): - 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) - # 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 - # data is disabled. We would also like to test with phones in less - # constrained states (or add variations where we specifically - # constrain). - utils.require_sl4a((self.dut, self.dut_client)) - utils.sync_device_time(self.dut) - utils.sync_device_time(self.dut_client) - # Set country code explicitly to "US". - wutils.set_wifi_country_code(self.dut, wutils.WifiEnums.CountryCode.US) - wutils.set_wifi_country_code(self.dut_client, wutils.WifiEnums.CountryCode.US) - # Enable verbose logging on the duts - self.dut.droid.wifiEnableVerboseLogging(1) - asserts.assert_equal(self.dut.droid.wifiGetVerboseLoggingLevel(), 1, - "Failed to enable WiFi verbose logging on the softap dut.") - self.dut_client.droid.wifiEnableVerboseLogging(1) - asserts.assert_equal(self.dut_client.droid.wifiGetVerboseLoggingLevel(), 1, - "Failed to enable WiFi verbose logging on the client dut.") - - req_params = ["AccessPoint", "dbs_supported_models", "stress_count"] - opt_param = ["iperf_server_address"] - self.unpack_userparams( - req_param_names=req_params, opt_param_names=opt_param) - - if self.dut.model not in self.dbs_supported_models: - asserts.skip( - ("Device %s does not support dual interfaces.") - % self.dut.model) - - if "iperf_server_address" in self.user_params: - self.iperf_server = self.iperf_servers[0] - if hasattr(self, 'iperf_server'): - self.iperf_server.start() - - # Set the client wifi state to on before the test begins. - wutils.wifi_toggle_state(self.dut_client, True) - - # Init extra devices - if len(self.android_devices) > 2: - wutils.wifi_test_device_init(self.android_devices[2]) - utils.sync_device_time(self.android_devices[2]) - wutils.set_wifi_country_code(self.android_devices[2], wutils.WifiEnums.CountryCode.US) - self.android_devices[2].droid.wifiEnableVerboseLogging(1) - asserts.assert_equal(self.android_devices[2].droid.wifiGetVerboseLoggingLevel(), 1, - "Failed to enable WiFi verbose logging on the client dut.") + super().setup_class() + opt_param = ["stress_count"] + self.unpack_userparams(opt_param_names=opt_param) """Helper Functions""" + def connect_to_wifi_network_and_verify(self, params): + """Connection logic for open and psk wifi networks. + Args: + params: A tuple of network info and AndroidDevice object. + """ + network, ad = params + SSID = network[WifiEnums.SSID_KEY] + wutils.reset_wifi(ad) + wutils.connect_to_wifi_network(ad, network) + if len(self.android_devices) > 2: + wutils.reset_wifi(self.android_devices[2]) + wutils.connect_to_wifi_network(self.android_devices[2], network) def verify_wifi_full_on_off(self, network, softap_config): wutils.wifi_toggle_state(self.dut, True) self.connect_to_wifi_network_and_verify((network, self.dut)) - self.run_iperf_client((network, self.dut)) - self.run_iperf_client((softap_config, self.dut_client)) if len(self.android_devices) > 2: self.log.info("Testbed has extra android devices, do more validation") - self.verify_traffic_between_ap_clients( + self.verify_traffic_between_dut_clients( self.dut, self.android_devices[2]) wutils.wifi_toggle_state(self.dut, False) def verify_softap_full_on_off(self, network, softap_band): softap_config = self.start_softap_and_verify(softap_band) - self.run_iperf_client((network, self.dut)) - self.run_iperf_client((softap_config, self.dut_client)) if len(self.android_devices) > 2: self.log.info("Testbed has extra android devices, do more validation") - self.verify_traffic_between_softap_clients( + self.verify_traffic_between_dut_clients( self.dut_client, self.android_devices[2]) wutils.reset_wifi(self.dut_client) if len(self.android_devices) > 2: @@ -142,12 +104,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_2g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_2g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_2g, WIFI_CONFIG_APBAND_2G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_2g, WIFI_CONFIG_APBAND_2G) @test_tracker_info(uuid="03362d54-a624-4fb8-ad97-7abb9e6f655c") def test_stress_wifi_connection_5G_softap_5G(self): @@ -155,12 +115,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_5g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_5g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_5g, WIFI_CONFIG_APBAND_5G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_5g, WIFI_CONFIG_APBAND_5G) @test_tracker_info(uuid="fdda4ff2-38d5-4398-9a59-c7cee407a2b3") def test_stress_wifi_connection_5G_DFS_softap_5G(self): @@ -168,12 +126,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_5g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_5g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_5g, WIFI_CONFIG_APBAND_5G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_5g, WIFI_CONFIG_APBAND_5G) @test_tracker_info(uuid="b3621721-7714-43eb-8438-b578164b9194") def test_stress_wifi_connection_5G_softap_2G(self): @@ -181,12 +137,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_5g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_5g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_5g, WIFI_CONFIG_APBAND_2G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_5g, WIFI_CONFIG_APBAND_2G) @test_tracker_info(uuid="bde1443f-f912-408e-b01a-537548dd023c") def test_stress_wifi_connection_5G_DFS_softap_2G(self): @@ -194,11 +148,9 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_5g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_5g, self.dut)) for count in range(self.stress_count): - self.verify_softap_full_on_off(self.wpapsk_5g, WIFI_CONFIG_APBAND_2G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_5g, WIFI_CONFIG_APBAND_2G) @test_tracker_info(uuid="2b6a891a-e0d6-4660-abf6-579099ce6924") def test_stress_wifi_connection_2G_softap_5G(self): @@ -206,12 +158,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): """ self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G) wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_2g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_2g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_2g, WIFI_CONFIG_APBAND_5G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_2g, WIFI_CONFIG_APBAND_5G) @test_tracker_info(uuid="f28abf22-9df0-4500-b342-6682ca305e60") def test_stress_wifi_connection_5G_softap_2G_with_location_scan_on(self): @@ -221,12 +171,10 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G) self.turn_location_on_and_scan_toggle_on() wutils.wifi_toggle_state(self.dut, True) - self.connect_to_wifi_network_and_verify((self.wpapsk_5g, self.dut)) + self.connect_to_wifi_network_and_verify((self.open_5g, self.dut)) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_softap_full_on_off(self.wpapsk_5g, WIFI_CONFIG_APBAND_2G) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_softap_full_on_off(self.open_5g, WIFI_CONFIG_APBAND_2G) @test_tracker_info(uuid="0edb1500-6c60-442e-9268-a2ad9ee2b55c") def test_stress_softap_2G_wifi_connection_2G(self): @@ -237,9 +185,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_2G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_2g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_2g, softap_config) @test_tracker_info(uuid="162a6679-edd5-4daa-9f25-75d79cf4bb4a") def test_stress_softap_5G_wifi_connection_5G(self): @@ -250,9 +196,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_5G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_5g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_5g, softap_config) @test_tracker_info(uuid="ee98f2dd-c4f9-4f48-ab59-f577267760d5") def test_stress_softap_5G_wifi_connection_5G_DFS(self): @@ -263,9 +207,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_5G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_5g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_5g, softap_config) @test_tracker_info(uuid="b50750b5-d5b9-4687-b9e7-9fb15f54b428") def test_stress_softap_5G_wifi_connection_2G(self): @@ -276,9 +218,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_5G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_2g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_2g, softap_config) @test_tracker_info(uuid="9a2865db-8e4b-4339-9999-000ce9b6970b") def test_stress_softap_2G_wifi_connection_5G(self): @@ -289,9 +229,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_2G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_5g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_5g, softap_config) @test_tracker_info(uuid="add6609d-91d6-4b89-94c5-0ad8b941e3d1") def test_stress_softap_2G_wifi_connection_5G_DFS(self): @@ -302,9 +240,7 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_2G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_5g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_5g, softap_config) @test_tracker_info(uuid="ee42afb6-99d0-4330-933f-d4dd8c3626c6") def test_stress_softap_5G_wifi_connection_2G_with_location_scan_on(self): @@ -317,6 +253,4 @@ class WifiStaApConcurrencyStressTest(WifiStaApConcurrencyTest): WIFI_CONFIG_APBAND_5G, check_connectivity=False) for count in range(self.stress_count): self.log.info("Iteration %d", count+1) - self.verify_wifi_full_on_off(self.wpapsk_2g, softap_config) - raise signals.TestPass(details="", extras={"Iterations":"%d" % - self.stress_count, "Pass":"%d" %(count+1)}) + self.verify_wifi_full_on_off(self.open_2g, softap_config) |