diff options
author | Nate Jiang <qiangjiang@google.com> | 2021-07-27 15:54:26 -0700 |
---|---|---|
committer | Nate Jiang <qiangjiang@google.com> | 2021-07-27 15:57:22 -0700 |
commit | 0e84ae8539a86f41a738bdde02fc2e4e0b27cffe (patch) | |
tree | 46144e2a9e1e8737b0c325adeea40c73eb9132e1 | |
parent | bbfbc77b09570383e83bcf12262b0246c2ffbccd (diff) | |
download | connectivity-0e84ae8539a86f41a738bdde02fc2e4e0b27cffe.tar.gz |
[ACTS] Fix the NonConcurrency test
Fix the test for both S and S-on-R test. Recently we restore the
interface priority on R device with S module, also we make the P2P lazy
initialze.
Bug: 193126257
Test: acts NonConcurrencyTest
Change-Id: I8c0bbb9bbb11d50a59bbe7d0d42b0792100a8b7b
-rw-r--r-- | acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py b/acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py index 724502fae..1c27ab8b9 100644 --- a/acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py +++ b/acts_tests/tests/google/wifi/aware/functional/NonConcurrencyTest.py @@ -25,6 +25,8 @@ from acts_contrib.test_utils.wifi import wifi_constants as wconsts from acts_contrib.test_utils.wifi.aware import aware_const as aconsts from acts_contrib.test_utils.wifi.aware import aware_test_utils as autils from acts_contrib.test_utils.wifi.aware.AwareBaseTest import AwareBaseTest +from acts_contrib.test_utils.wifi.p2p import wifi_p2p_test_utils as wp2putils +from acts_contrib.test_utils.wifi.p2p import wifi_p2p_const as p2pconsts # arbitrary timeout for events EVENT_TIMEOUT = 10 @@ -67,6 +69,10 @@ class NonConcurrencyTest(AwareBaseTest): # start other service if is_p2p: dut.droid.wifiP2pInitialize() + wp2putils.p2p_create_group(dut) + dut.ed.pop_event(p2pconsts.CONNECTED_EVENT, + p2pconsts.DEFAULT_TIMEOUT) + time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME) else: wutils.start_wifi_tethering(dut, self.TETHER_SSID, password=None) @@ -76,14 +82,19 @@ class NonConcurrencyTest(AwareBaseTest): dut.droid.wifiAwarePublish(id, p_config) autils.wait_for_event(dut, aconsts.SESSION_CB_ON_SESSION_CONFIG_FAILED) - # P2P, SoftAp and Aware has same priority, aware will be available + # Aware will be available, and try to tear down other service when new service request. autils.wait_for_event(dut, aconsts.BROADCAST_WIFI_AWARE_AVAILABLE) - # Start Aware again, publish should succeed. + # Try to attach again id = dut.droid.wifiAwareAttach() - autils.wait_for_event(dut, aconsts.EVENT_CB_ON_ATTACHED) - dut.droid.wifiAwarePublish(id, p_config) - autils.wait_for_event(dut, aconsts.SESSION_CB_ON_PUBLISH_STARTED) + if is_p2p or dut.droid.isSdkAtLeastS(): + autils.wait_for_event(dut, aconsts.EVENT_CB_ON_ATTACHED) + dut.droid.wifiAwarePublish(id, p_config) + autils.wait_for_event(dut, aconsts.SESSION_CB_ON_PUBLISH_STARTED) + else: + # SoftAp has higher priority on R device, attach should fail + autils.fail_on_event(dut, aconsts.EVENT_CB_ON_ATTACHED) + def run_incompat_service_then_aware(self, is_p2p): @@ -113,7 +124,11 @@ class NonConcurrencyTest(AwareBaseTest): asserts.assert_true(dut.droid.wifiIsAwareAvailable(), "Aware should be available") dut.droid.wifiAwareAttach() - autils.wait_for_event(dut, aconsts.EVENT_CB_ON_ATTACHED) + if is_p2p or dut.droid.isSdkAtLeastS(): + autils.wait_for_event(dut, aconsts.EVENT_CB_ON_ATTACHED) + else: + # SoftAp has higher priority on R device, attach should fail + autils.fail_on_event(dut, aconsts.EVENT_CB_ON_ATTACHED) def run_aware_then_connect_to_new_ap(self): """Validate interaction of Wi-Fi Aware and infra (STA) association with randomized MAC |