2、 CtsSecurityHostTestCases
android.security.cts.SELinuxHostTest#testAospServiceContexts fail
junit.framework.ComparisonFailure: Lines do not match: expected:<media.[log u:object_r:audio]server_service:s0> but was:<media.[imageeffect u:object_r:camera]server_service:s0>
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 ''