7.0 CTS fail 項分析(二)

來源:互聯網
上載者:User
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:<media.[log u:object_r:audio]server_service:s0> but was:<media.[imageeffect u:object_r:camera]server_service:s0>

問題分析:在該測試例中測試機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 ''

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.