Android16 EDLA【CTS】CtsConnectivityMultiDevicesTestCases存在fail项
文章目录
- [Android16 EDLA【CTS】CtsConnectivityMultiDevicesTestCases存在fail项](#Android16 EDLA【CTS】CtsConnectivityMultiDevicesTestCases存在fail项)
一、前言
这里记录一个【CTS】CtsConnectivityMultiDevicesTestCases 测试Failed项。
从测试模块名称看是和多设备连接有关。
二、分析解决
测试模块: CtsConnectivityMultiDevicesTestCases
1、报错信息
报错项信息,如下图所示:

具体报错信息:
测试项: ConnectivityMultiDevicesTest#test_hotspot_upstream_wifi
报错堆栈:
Traceback (most recent call last):
File "connectivity_multi_devices_test.py", line 30, in test_hotspot_upstream_wifi
File "net_tests_utils/host/python/tether_utils.py", line 83, in setup_hotspot_and_client_for_upstream_type
File "mobly/snippet/client_base.py", line 213, in rpc_call
File "mobly/snippet/client_base.py", line 306, in _rpc
File "mobly/snippet/client_base.py", line 415, in _handle_rpc_response
mobly.snippet.errors.ApiError: <AndroidDevice|an4009059c06d08301a13>
-------------- Java Stacktrace ---------------
java.lang.AssertionError: Could not connect to a wifi access point within 30000 ms. Check that the test device has a wifi network configured, and that the test access point is functioning properly.
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.junit.Assert.assertNotNull(Assert.java:713)
at kotlin.test.junit.JUnitAsserter.assertNotNull(JUnitSupport.kt:48)
at kotlin.test.AssertionsKt__AssertionsKt.assertNotNull(Assertions.kt:145)
at kotlin.test.AssertionsKt.assertNotNull(Unknown Source:1)
at com.android.testutils.ConnectUtil.ensureWifiConnected$lambda$5(ConnectUtil.kt:307)
at com.android.testutils.ConnectUtil.$r8$lambda$HgCmL0DSouVbioJ09sNCV1Fdj8s(Unknown Source:0)
at
----------------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mobly/base_test.py", line 801, in exec_one_test
File "connectivity_multi_devices_test.py", line 34, in test_hotspot_upstream_wifi
File "net_tests_utils/host/python/tether_utils.py", line 115, in cleanup_tethering_for_upstream_type
File "mobly/snippet/client_base.py", line 213, in rpc_call
File "mobly/snippet/client_base.py", line 306, in _rpc
File "mobly/snippet/client_base.py", line 415, in _handle_rpc_response
mobly.snippet.errors.ApiError: <AndroidDevice|an4009059c06d08301a13>
另外一个测试项报错的堆栈信息也是差不多的。
堆栈信息看不懂。
2、原因分析
大概能看出Failed报错原因 :
java.lang.AssertionError: Could not connect to a wifi access point within 30000 ms测试设备(an4009059c06d08301a13)在 30 秒超时时间内未能连接到预设的 WiFi 热点,触发断言失败。
该项测试应该是一个开wifi,另外一个开热点相互连接测试的,未在规定时间成功连接导致Failed。
3、解决
之前在其他方案是有遇到过的,不用修改代码,需要使用特定手法测试就可以了。
此问题测试时需要使用两台一样的机器:
1.测试设备都连接ipv6网络;
2.EDLA测试笔记本和两台设备的时间显示保持一致;
3.确保EDLA测试笔记本可以识别到两台设备的adb;
4.运行run cts --shard-count 2 -m CtsConnectivityMultiDevicesTestCases跑此项测试。
该项测试项必须用两个设备测试,多设备或者少设备都是不行的。
三、其他
1、【CTS】CtsConnectivityMultiDevicesTestCases存在fail项小结
该项报错的可能原因有:
(1)使用一个设备或者多个设备测试该模块的该项;
(2)设备未连接ipv6的网络;
(3)其中一个设备的wifi或者热点异常;
2、Android16 EDLA 认证测试CTS问题分析解决
Android EDLA 认证测试的主要内容是 CTS、GTS、VTS ,还有一些其他的。
Android16 的CTS的测试项有900多个模块,总共有两百九十多万项需要测试。
其中有个测试模块 CtsDeqpTestCases ,包含了两百八十多万项,这个模块基本不会报错;
讲解CTS的某些Failed项解决思路:
https://blog.csdn.net/wenzhi20102321/article/details/155891415