summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-04-17 23:55:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-17 23:55:54 +0000
commitc1f7d95e0b30e0ff09c46e1fd20187d9c54afa18 (patch)
tree61a49b9d7d4946584f3cf809aa95fb3012baa9a9
parent6341b27f7016b154c8ded216cf07b36d9e49e986 (diff)
parent26a8f228e6763254e965df71f70d7d49a3d9373f (diff)
downloadplatform_testing-c1f7d95e0b30e0ff09c46e1fd20187d9c54afa18.tar.gz
Merge "Add Aware test case and enable it for QuickShare CUJ." into main
-rw-r--r--tests/bettertogether/betocq/betocq_test_suite.py6
-rw-r--r--tests/bettertogether/betocq/directed_tests/scc_2g_wfd_sta_test.py24
-rw-r--r--tests/bettertogether/betocq/directed_tests/scc_5g_aware_sta_test.py100
3 files changed, 111 insertions, 19 deletions
diff --git a/tests/bettertogether/betocq/betocq_test_suite.py b/tests/bettertogether/betocq/betocq_test_suite.py
index 806c6a52d..fe14f380e 100644
--- a/tests/bettertogether/betocq/betocq_test_suite.py
+++ b/tests/bettertogether/betocq/betocq_test_suite.py
@@ -45,6 +45,7 @@ from betocq.directed_tests import mcc_5g_wfd_dfs_5g_sta_test
from betocq.directed_tests import mcc_5g_wfd_non_dbs_2g_sta_test
from betocq.directed_tests import scc_2g_wfd_sta_test
from betocq.directed_tests import scc_2g_wlan_sta_test
+from betocq.directed_tests import scc_5g_aware_sta_test
from betocq.directed_tests import scc_5g_wfd_dbs_2g_sta_test
from betocq.directed_tests import scc_5g_wfd_sta_test
from betocq.directed_tests import scc_5g_wlan_sta_test
@@ -142,6 +143,11 @@ class BetoCqPerformanceTestSuite(base_betocq_suite.BaseBetocqSuite):
clazz=scc_5g_wfd_sta_test.Scc5gWfdStaTest,
config=config,
)
+ if test_parameters.target_cuj_name is nc_constants.TARGET_CUJ_QUICK_SHARE:
+ self.add_test_class(
+ clazz=scc_5g_aware_sta_test.Scc5gAwareStaTest,
+ config=config,
+ )
self.add_test_class(
clazz=scc_5g_wlan_sta_test.Scc5gWifiLanStaTest,
config=config,
diff --git a/tests/bettertogether/betocq/directed_tests/scc_2g_wfd_sta_test.py b/tests/bettertogether/betocq/directed_tests/scc_2g_wfd_sta_test.py
index 43ab314ed..c9340b436 100644
--- a/tests/bettertogether/betocq/directed_tests/scc_2g_wfd_sta_test.py
+++ b/tests/bettertogether/betocq/directed_tests/scc_2g_wfd_sta_test.py
@@ -14,13 +14,11 @@
"""This Test is to test the Wifi SCC in a general case.
-In this case, both the WFD and WLAN are using the 2G channel, the WFD and WLAN
-should use the same channel.
+In this case, both the WFD and WLAN are using the smae 2G channel
+Note that The country code is set to JP so that 5G is not available for
+any D2D mediums.
-The device requirements:
- support 5G: false
-The AP requirements:
- wifi channel: 6 (2437)
+The device requirements: N/A.
"""
import datetime
@@ -45,7 +43,7 @@ class Scc2gWfdStaTest(d2d_performance_test_base.D2dPerformanceTestBase):
"""Test class for Wifi SCC with 2G WFD and STA."""
def _get_country_code(self) -> str:
- return 'US'
+ return 'JP'
def setup_class(self):
super().setup_class()
@@ -92,17 +90,5 @@ class Scc2gWfdStaTest(d2d_performance_test_base.D2dPerformanceTestBase):
def _is_wifi_ap_ready(self) -> bool:
return True if self.test_parameters.wifi_2g_ssid else False
- @property
- def _devices_capabilities_definition(self) -> dict[str, dict[str, bool]]:
- return {
- 'discoverer': {
- 'supports_5g': False,
- },
- 'advertiser': {
- 'supports_5g': False,
- },
- }
-
-
if __name__ == '__main__':
test_runner.main()
diff --git a/tests/bettertogether/betocq/directed_tests/scc_5g_aware_sta_test.py b/tests/bettertogether/betocq/directed_tests/scc_5g_aware_sta_test.py
new file mode 100644
index 000000000..ad2aaeb7a
--- /dev/null
+++ b/tests/bettertogether/betocq/directed_tests/scc_5g_aware_sta_test.py
@@ -0,0 +1,100 @@
+# Copyright (C) 2024 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.
+
+"""This test is to test the Wifi SCC in a general case.
+
+In this case, both the Aware and WLAN are using the same 5G channel.
+
+The device requirements:
+ support 5G: true
+The AP requirements:
+ wifi channel: 36 (5180)
+"""
+import logging
+import os
+import sys
+
+# Allows local imports to be resolved via relative path, so the test can be run
+# without building.
+_betocq_dir = os.path.dirname(os.path.dirname(__file__))
+if _betocq_dir not in sys.path:
+ sys.path.append(_betocq_dir)
+
+from mobly import base_test
+from mobly import test_runner
+
+from betocq import d2d_performance_test_base
+from betocq import nc_constants
+
+
+class Scc5gAwareStaTest(d2d_performance_test_base.D2dPerformanceTestBase):
+ """Test class for Wifi SCC with 5G Aware and STA."""
+
+ def _get_country_code(self) -> str:
+ return 'US'
+
+ def setup_class(self):
+ super().setup_class()
+ self.performance_test_iterations = getattr(
+ self.test_scc_5g_aware_sta, base_test.ATTR_REPEAT_CNT
+ )
+ logging.info(
+ 'performance test iterations: %s', self.performance_test_iterations
+ )
+
+ @base_test.repeat(
+ count=nc_constants.SCC_PERFORMANCE_TEST_COUNT,
+ max_consecutive_error=nc_constants.SCC_PERFORMANCE_TEST_MAX_CONSECUTIVE_ERROR,
+ )
+ def test_scc_5g_aware_sta(self):
+ """Test the performance for Wifi SCC with 5G Aware and STA."""
+ self._test_connection_medium_performance(
+ nc_constants.NearbyMedium.WIFIAWARE_ONLY,
+ wifi_ssid=self.test_parameters.wifi_5g_ssid,
+ wifi_password=self.test_parameters.wifi_5g_password,
+ )
+
+ def _get_file_transfer_failure_tip(self) -> str:
+ return (
+ 'The Wifi Aware connection might be broken, check related logs, '
+ f'{self._get_throughput_low_tip()}'
+ )
+
+ def _get_throughput_low_tip(self) -> str:
+ return (
+ f'{self._throughput_low_string}. This is a SCC 5G test case with Aware'
+ ' and STA operating at the same 5G channel. Check STA and Aware'
+ ' frequencies in the target logs and ensure they'
+ ' have the same value. Check with the wifi chip vendor about the'
+ ' possible firmware Tx/Rx issues in this mode. Also check if the AP'
+ ' channel is set correctly and is supported by the used wifi medium.'
+ )
+
+ def _is_wifi_ap_ready(self) -> bool:
+ return True if self.test_parameters.wifi_5g_ssid else False
+
+ @property
+ def _devices_capabilities_definition(self) -> dict[str, dict[str, bool]]:
+ return {
+ 'discoverer': {
+ 'supports_5g': True,
+ },
+ 'advertiser': {
+ 'supports_5g': True,
+ },
+ }
+
+
+if __name__ == '__main__':
+ test_runner.main()