7.0 CTS fail 项分析(二)

1、    CtsTelecomTestCases
android.telecom.cts.WiredHeadsetTest#testInCallLongPress_hangupCall    fail
junit.framework.AssertionFailedError: Call: Call [id: TC@1, state: HOLDING, details: [pa: PhoneAccountHandle{CtsConnectionService, xtstest_CALL_PROVIDER_ID, UserHandle{0}}, hdl: tel:10000, caps: [Capabilities:], props: [Properties:]]] should be in state 7 expected:<7> but was:<3>

android.telecom.cts.WiredHeadsetTest#testInCallShortPress_togglesMute      fail
junit.framework.AssertionFailedError: No call added to InCallService.

问题分析:这两项测试与耳机相关,模拟插入耳机状态下短按、长按按钮的行为,Google CTS 要求短按静音,长按挂断电话。

2、    CtsSecurityHostTestCases
android.security.cts.SELinuxHostTest#testAospServiceContexts    fail
junit.framework.ComparisonFailure: Lines do not match: expected: but was:

问题分析:在该测试例中测试机root目录下的service_contexts 对应源码中的/system/sepolicy/service_contexts的71行,应该是:
71 media.log u:object_r:audioserver_service:s0
可以和CTS jar中的general_service_contexts 完全匹配,如果不是,那就会报错。

3、CtsNetTestCases
android.net.cts.DnsTest#testDnsWorks    fail
junit.framework.AssertionFailedError: [RERUN] DNS could not resolve ipv6.google.com, check the network supports IPv6

问题分析:该测试项需要架设IPV6网络才可以进行

3、    CtsHostsideNetworkTests
com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testDataSaverMode_blacklisted    fail
java.lang.AssertionError: on-device tests failed:
junit.framework.ComparisonFailure: wrong status expected:<[EN]ABLED> but was:<[DIS]ABLED>

原因分析:手机在测试时,将10111加入黑名单,但是后续测试的时候,发现有从黑名单里移除,所以不符合预期出错。Log如下:
//将10111这个APP加入黑名单
11-15 18:15:41.215154 8677 8691 D RestrictBackgroundNetworkTests: Command 'cmd netpolicy add restrict-background-blacklist 10111' returned ''     
11-15 18:15:41.134780 968 4744 V NetworkPolicy: updateRuleForRestrictBackgroundLocked(10111): isForeground=false, isBlacklisted=true, isWhitelisted=false, oldRule=0 (NONE), newRule=4 (REJECT_METERED), newUidRules=4 (REJECT_METERED), oldUidRules=0 (NONE)
//返回被限制的状态,符合预期
11-15 18:15:41.318794 8765 8765 D CtsNetApp2: getRestrictBackgroundStatus: returning 3// public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3;
//在这里被改了
11-15 18:15:46.701290 968 983 V NetworkPolicy: updateRuleForRestrictBackgroundLocked(10111): isForeground=false, isBlacklisted=false, isWhitelisted=false, oldRule=4 (REJECT_METERED), newRule=0 (NONE), newUidRules=0 (NONE), oldUidRules=4 (REJECT_METERED)
//返回状态变成1,不符合预期,报错
11-15 18:15:52.486557 8765 8765 D CtsNetApp2: getRestrictBackgroundStatus: returning 1 // public static final int RESTRICT_BACKGROUND_STATUS_DISABLED = 1;
11-15 18:15:52.747362 8677 8691 D RestrictBackgroundNetworkTests: Command 'cmd netpolicy set restrict-background false' returned ''

你可能感兴趣的:(7.0 CTS fail 项分析(二))