Android CTS測试Fail项改动总结(四)
Android5.1上的測试
1、android.security.cts.SELinuxDomainTest# testInitDomain fail
打印的log
junit.framework.AssertionFailedError: Expected 1 process in SELinux domain "u:r:init:s0" Found
"[
pid: "1" proctitle: "/init" label: "u:r:init:s0" vsize: 1327104,
pid: "298" proctitle: "/system/bin/immvibed" label: "u:r:init:s0" vsize: 1765376
]"
expected:<1> but was:<2> at junit.framework.Assert.fail(Assert.java:50)
这个是典型的L 版本号SELinux Test 问题.
android.security.cts.SELinuxDomainTest 有1项fail,
-- testInitDomain
junit.framework.AssertionFailedError: Expected 1 process in SELinux domain "u:r:init:s0" Found "[pid: "1" proctitle: "/init" label: "u:r:init:s0" vsize: 1327104, pid: "298" proctitle: "/system/bin/immvibed" label: "u:r:init:s0" vsize: 1765376]" expected:<1>
but was:<2> at junit.framework.Assert.fail(Assert.java:50)
其关键原因是由于 Google 强调系统关键进程的SELinux Context 必须唯一, 系统关键进程包含如 init, vold, surfaceflinger, netd, servicemanager, drmserver 等等. 一旦发现有多个process 同一时候使用这些关键的domain 则SELinux Test fail.
为此要求。系统关键进程启动长时间执行的process, 必须进行domain 切换. 否则将无法通过Google CTS test.
典型情况就是通过init 启动某个 service, 而没有对这个service 进行domain 切换. 比方贵司这个问题中 suntrold_32 这个 service 没有进行domain 切换, 成而无法通过測试.
以下是一个简单的demo.
情景: 定义一个init 启动的service, demo_service, 相应的运行档是/system/bin/demo.
(1). 创建一个demo.te 在/device/mediatke/common/sepolicy 文件夹下, 然后在/device/mediatke/common/BoardConfig.mk 的BOARD_SEPOLICY_UNION 宏中新增 demo.te
(2). 定义demo 类型,init 启动service 时类型转换, demo.te 中
type demo, domain;
type demo_exec, exec_type, file_type;
init_daemon_domain(demo)
(3). 绑定运行档 file_context 类型
/system/bin/demo u:object_r:demo_exec:s0
(4). 依据demo 须要訪问的文件以及设备, 定义其他的权限在demo.te 中.
典型情况就是通过init 启动某个 service, 而没有对这个service 进行domain 切换. 比方这个问题中immvibed 这个 service 没有进行domain 切换, 从而无法通过測试.仅仅需依照demo改动就可以.
2、android.webgl.cts.WebGLTest#test_conformance_extensions_oes_texture_float_with_canvas_html fail
去掉GMS中的WebViewGoogle.apk使用WebView.apk能够Pass。假设国内版本号一定要集成WebViewGoogle.apk仅仅能申请豁免,可參考下面链接
https://code.google.com/p/chromium/issues/detail?id=482278
集成WebViewGoogle.apk后,因为这是 Chromium 42 版 common 的问题, 无法改动, 可拿 chromium bug report 的资料与 Google 讨论, waive 此问题
3、com.android.cts.appsecurity.AppSecurityTests#2项 fail
【步骤】Compatibility Test Package: android.tests.appsecurity ABI
com.android.cts.appsecurity.AppSecurityTests
-- testExternalStorageNone
-- testExternalStorageWrite
【现象】
com.android.cts.tradefed.testtype.TestTimeoutException at com.android.cts.tradefed.testtype.JarHostTest.runTest(JarHostTest.java:223)
分析思路:
1、首先确认測试时是否有插入SD卡,因在此项測试须要插入SD卡才干通过
2、假设插入SD卡还是Fail。
请确认下在sdcard.c(system/core/sdcard/)中是否把mtklogger中的support write permission部分代码加上导致的.
假设没有请把/frameworks/base/data/etc/platform.xml中WRITE_EXTERNAL_STORAGE去除group id="media_rw"再进行測试
3、假设init.rc中有export SECONDARY_STORAGE /storage/sdcard1,去掉再測试
4、以上步骤验证完后还是Fail,经过版本号对照,发现是YuloreFrameWork.apk引起的。删除后測试pass
cts-tf > run cts --class com.android.cts.appsecurity.AppSecurityTests
06-29 10:10:46 I/TestInvocation: Starting invocation for 'cts' on build '5.1_r1' on device AYEMA6YHKVNJQOIZ
06-29 10:10:46 I/AYEMA6YHKVNJQOIZ: Created result dir 2015.06.29_10.10.46
06-29 10:10:47 I/CtsTest: ABIs: [armeabi-v7a, arm64-v8a]
06-29 10:11:01 I/AYEMA6YHKVNJQOIZ: Collecting device info
06-29 10:11:03 I/CtsTest: Start test run of 2 packages, containing 22 tests
06-29 10:11:03 I/AYEMA6YHKVNJQOIZ: -----------------------------------------
06-29 10:11:03 I/AYEMA6YHKVNJQOIZ: Test package arm64-v8a android.tests.appsecurity started
06-29 10:11:03 I/AYEMA6YHKVNJQOIZ: -----------------------------------------
06-29 10:11:23 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testAppFailAccessPrivateData PASS
06-29 10:11:32 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testAppUpgradeDifferentCerts PASS
06-29 10:11:59 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageGifts PASS
06-29 10:12:10 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageNone PASS
06-29 10:12:20 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageRead PASS
06-29 10:12:31 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageWrite PASS
06-29 10:12:47 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testInstrumentationDiffCert PASS
06-29 10:12:49 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testMultiUserStorage PASS
06-29 10:14:06 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testPermissionDiffCert PASS
06-29 10:14:17 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testSharedUidDifferentCerts PASS
06-29 10:14:34 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testUninstallRemovesData PASS
06-29 10:14:37 I/AYEMA6YHKVNJQOIZ: arm64-v8a android.tests.appsecurity package complete: Passed 11, Failed 0, Not Executed 0
06-29 10:14:37 I/AYEMA6YHKVNJQOIZ: -----------------------------------------
06-29 10:14:37 I/AYEMA6YHKVNJQOIZ: Test package armeabi-v7a android.tests.appsecurity started
06-29 10:14:37 I/AYEMA6YHKVNJQOIZ: -----------------------------------------
06-29 10:14:57 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testAppFailAccessPrivateData PASS
06-29 10:15:06 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testAppUpgradeDifferentCerts PASS
06-29 10:15:32 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageGifts PASS
06-29 10:15:43 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageNone PASS
06-29 10:15:53 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageRead PASS
06-29 10:16:04 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testExternalStorageWrite PASS
06-29 10:16:20 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testInstrumentationDiffCert PASS
06-29 10:16:22 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testMultiUserStorage PASS
06-29 10:17:43 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testPermissionDiffCert PASS
06-29 10:17:56 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testSharedUidDifferentCerts PASS
06-29 10:18:16 I/AYEMA6YHKVNJQOIZ: com.android.cts.appsecurity.AppSecurityTests#testUninstallRemovesData PASS
06-29 10:18:21 I/AYEMA6YHKVNJQOIZ: Saved log device_logcat_892804764496421781.zip
06-29 10:18:25 I/AYEMA6YHKVNJQOIZ: Saved log host_log_3382781982890595027.zip
06-29 10:18:25 I/AYEMA6YHKVNJQOIZ: armeabi-v7a android.tests.appsecurity package complete: Passed 11, Failed 0, Not Executed 0
06-29 10:18:25 I/AYEMA6YHKVNJQOIZ: XML test result file generated at 2015.06.29_10.10.46. Passed 22, Failed 0, Not Executed 0
06-29 10:18:25 I/AYEMA6YHKVNJQOIZ: Time: 7m 38s
4、android.media.cts.DecodeEditEncodeTest#testVideoEdit720p fail
【步骤】Compatibility Test Package: android.media ABI
android.media.cts.DecodeEditEncodeTest
-- testVideoEdit720p
【现象】
junit.framework.AssertionFailedError: Found 29 bad frames at junit.framework.Assert.fail(Assert.java:50)
这个问题与android.media.cts.EncodeDecodeTest#2项 fail属于同一个原因引起的
【步骤】Compatibility Test Package: android.media ABI
android.media.cts.EncodeDecodeTest
-- testEncodeDecodeVideoFromSurfaceToSurface720p
-- testVP8EncodeDecodeVideoFromSurfaceToSurface720p
【现象】
junit.framework.AssertionFailedError: Found 29 bad frames at junit.framework.Assert.fail(Assert.java:50)
改动方案:
root cause:
PQ_ADL_INDEX_DEFAULT默认打开。会对画面做处理,导致色点有误差。
solution:
改动alps/vendor/mediatek/proprietary/platform/mt6795/hardware/pq/cust_color.h这个文件
將
#define PQ_ADL_INDEX_DEFAULT "1”
改为
#define PQ_ADL_INDEX_DEFAULT "0”
5、com.android.cts.devicepolicy.DeviceOwnerTest Fail
測试部分结果
cts-tf > run cts --class com.android.cts.devicepolicy.DeviceOwnerTest
07-08 11:31:36 I/TestInvocation: Starting invocation for 'cts' on build '5.1_r1' on device 8ef2d4c2
07-08 11:31:36 I/8ef2d4c2: Created result dir 2015.07.08_11.31.36
07-08 11:31:36 I/CtsTest: ABIs: [armeabi-v7a, arm64-v8a]
07-08 11:31:48 I/8ef2d4c2: Collecting device info
07-08 11:31:50 I/CtsTest: Start test run of 2 packages, containing 14 tests
07-08 11:31:50 I/8ef2d4c2: -----------------------------------------
07-08 11:31:50 I/8ef2d4c2: Test package arm64-v8a android.adminhostside started
07-08 11:31:50 I/8ef2d4c2: -----------------------------------------
07-08 11:31:50 I/BaseDevicePolicyTest: Installing app CtsDeviceOwnerApp.apk
07-08 11:31:55 I/DeviceOwnerTest: Output for command dpm set-device-owner 'com.android.cts.deviceowner/com.android.cts.deviceowner.BaseDeviceOwnerTest$BasicAdminReceiver': java.lang.IllegalStateException: Trying to set device owner but device is already provisioned.
at android.os.Parcel.readException(Parcel.java:1569)
at android.os.Parcel.readException(Parcel.java:1509)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:3212)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) 07-08 11:31:55 I/8ef2d4c2: com.android.cts.devicepolicy.DeviceOwnerTest#testApplicationRestrictions FAIL
junit.framework.AssertionFailedError: java.lang.IllegalStateException: Trying to set device owner but device is already provisioned.
at android.os.Parcel.readException(Parcel.java:1569)
at android.os.Parcel.readException(Parcel.java:1509)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:3212)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
expected to start with "Success:"
at junit.framework.Assert.fail(Assert.java:50)
at junit.framework.Assert.assertTrue(Assert.java:20)
at com.android.cts.devicepolicy.DeviceOwnerTest.setDeviceOwner(DeviceOwnerTest.java:96)
at com.android.cts.devicepolicy.DeviceOwnerTest.setUp(DeviceOwnerTest.java:41)
at junit.framework.TestCase.runBare(TestCase.java:132)
at com.android.tradefed.testtype.DeviceTestResult$1.protect(DeviceTestResult.java:81)
at com.android.tradefed.testtype.DeviceTestResult.runProtected(DeviceTestResult.java:56)
at com.android.tradefed.testtype.DeviceTestResult.run(DeviceTestResult.java:85)
at junit.framework.TestCase.run(TestCase.java:124)
at com.android.tradefed.testtype.DeviceTestCase.run(DeviceTestCase.java:117)
at com.android.cts.tradefed.testtype.JarHostTest$TestRunnable.run(JarHostTest.java:248)
at com.android.tradefed.util.RunUtil$RunnableNotifier.run(RunUtil.java:346)
提示:java.lang.IllegalStateException: Trying to set device owner but device is already provisioned.已经存在device owner
解决思路:
去设置-》高级设置-》帐户 中查看
已经存在一个账户了,须要删除这个帐户。方法例如以下:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
删除后又一次測试
cts-tf > run cts --class com.android.cts.devicepolicy.DeviceOwnerTest
07-08 11:38:25 I/TestInvocation: Starting invocation for 'cts' on build '5.1_r1' on device 8ef2d4c2
07-08 11:38:25 I/8ef2d4c2: Created result dir 2015.07.08_11.38.25
07-08 11:38:25 I/CtsTest: ABIs: [armeabi-v7a, arm64-v8a]
07-08 11:38:37 I/8ef2d4c2: Collecting device info
07-08 11:38:39 I/CtsTest: Start test run of 2 packages, containing 14 tests
07-08 11:38:39 I/8ef2d4c2: -----------------------------------------
07-08 11:38:39 I/8ef2d4c2: Test package arm64-v8a android.adminhostside started
07-08 11:38:39 I/8ef2d4c2: -----------------------------------------
07-08 11:38:40 I/BaseDevicePolicyTest: Installing app CtsDeviceOwnerApp.apk
07-08 11:38:44 I/DeviceOwnerTest: Output for command dpm set-device-owner 'com.android.cts.deviceowner/com.android.cts.deviceowner.BaseDeviceOwnerTest$BasicAdminReceiver': Success: Device owner set to package com.android.cts.deviceowner
Active admin set to component {com.android.cts.deviceowner/com.android.cts.deviceowner.BaseDeviceOwnerTest$BasicAdminReceiver} 07-08 11:38:46 I/BaseDevicePolicyTest: Test com.android.cts.deviceowner.ApplicationRestrictionsTest#testSetApplicationRestrictions: PASSED
07-08 11:38:46 I/BaseDevicePolicyTest: Test com.android.cts.deviceowner.ApplicationRestrictionsTest#testAndroidTestCaseSetupProperly: PASSED
07-08 11:38:48 I/BaseDevicePolicyTest: Test com.android.cts.deviceowner.ClearDeviceOwnerTest#testClearDeviceOwner: PASSED
07-08 11:38:48 I/BaseDevicePolicyTest: Test com.android.cts.deviceowner.ClearDeviceOwnerTest#testAndroidTestCaseSetupProperly: PASSED
07-08 11:38:49 I/8ef2d4c2: com.android.cts.devicepolicy.DeviceOwnerTest#testApplicationRestrictions PASS
在GTS中也有这项測试:com.google.android.xts.devicepolicy.DeviceOwnerTest
假设有报:java.lang.IllegalStateException: Trying to set device owner but device is already provisioned应该就是同一个问题,仅仅要把帐户删除再測试
Android CTS測试Fail项改动总结(四)的更多相关文章
- Android自己主动化測试——CTS測试
一.为什么须要兼容性測试(下面称CTS)? 1.1.让APP提供更好的用户体验.用户能够选择很多其它的适合自己设备的APP.让APP更稳定. 1.2.让开发人员设计更高质量的APP. 1.3.通过CT ...
- android 性能測试CTS篇
CTS介绍 一.CTS简单介绍 CTS 全称Compatibility Test Suite兼容性測试工具. 当电子产品开发出来.并定制了自己的Android系统后,必需要通过最新的CTS检測.以保证 ...
- Android单元測试之JUnit
随着近期几年測试方面的工作慢慢火热起来.常常看见有招聘測试project师的招聘信息.在Java中有单元測试这么一个JUnit 方式,Android眼下主要编写的语言是Java,所以在Android开 ...
- Android性能測试 一些适用于Android Studio的代码审查和性能測试工具
导言: Android应用在CPU占用,内存消耗方面的性能指标是影响产品质量的重要因素,因为QQ管家,360手机助手等应用都提供直观的内存消耗,流量监控功能,致使用户比以往更加关注软件的性能,并以此进 ...
- SWTBOK測试实践系列(1) -- 測试在项眼下期的评审投入划算吗?
測试策略:静态測试还是动态測试? [对话场景] 成功公布某个软件版本号之后,项目团队召开了项目的经验教训总结大会.在会议期间,项目经理小项和測试经理小測进行了例如以下的对话: 小项:"小測, ...
- android 性能測试iozone篇
一:简单介绍 iozone是一个文件系统的benchmark工具, 用于測试不同的操作系统中文件系统的读写性能, 能够測试下面13种模式 0=write/rewrite 1=read/re-read ...
- android性能測试systrace
一:简单介绍 systrace 是 Android4.1 引入的一套用于做性能分析的工具. 基于 Linux 内核的 ftrace 机制(用于跟踪 Linux 内核的函数调用), 能够输出各个线程当前 ...
- Android—— ubuntu下【CTS】測试TV真机
近期接触到CTS,据传不懂CTS就不算一个合格的android开发者,我之前一直没见周边谁用过.作为一个产品开发的android人员,我还是太年轻- 撰写不易,转载请注明出处:http://blog. ...
- Android自己主动化測试解决方式
如今,已经有大量的Android自己主动化測试架构或工具可供我们使用,当中包含:Activity Instrumentation, MonkeyRunner, Robotium, 以及Robolect ...
随机推荐
- 【JAVA得知】struts2 于 Actionsupport 任务
尊重原创:http://xumiao900.iteye.com/blog/469760 Action 跟 Actionsupport 的差别 当我们在写action的时候,能够实现A ...
- 项目之软件project(我专业四年都未曾知道这四个字的含义,几句话便懂了)
潘鹏在CSDN上原创.如其它站点转载请注意排版和写明出处: 软件project的本质 一级标题 控制 质量 二级标题 成本 扩展 高内聚低耦合 效率 控制: 成本:企业要求的是以最快的速度完毕可 ...
- SDL2源码分析5:更新纹理(SDL_UpdateTexture())
===================================================== SDL源码分析系列文章列表: SDL2源码分析1:初始化(SDL_Init()) SDL2源 ...
- STM32W108无线传感器网络嵌入式uCOS-II的移植及实时环境监測
基于STM32W108无线开发板,将ucos-ii v2.86内核移植到其上,并加入用户任务.实现对温湿度.超声波.声音.光敏等传感器的控制及实时数据採集. 14.1开发环境说明 硬件:STM32W1 ...
- Callable 获取线程返回值
allable与 Future 两功能是Java在兴许版本号中为了适应多并法才增加的,Callable是类似于Runnable的接口,实现Callable接口的类和实现Runnable的类都是可被其它 ...
- android应用开发--------------看RadioGroup源代码,写相似单选选项卡的集成控件(如底部导航,tab等等)
博客为 有时个哥 原创.如需转载请标明出处:http://blog.csdn.net/ls703/article/details/46694967 watermark/2/text/aHR0cDovL ...
- 【hadoop之翊】——基于CentOS的hadoop2.4.0伪分布安装配置
今天总算是把hadoop2.4的整个开发环境弄好了,包括 windows7上eclipse连接hadoop,eclipse的配置和測试弄得烦躁的一逗比了~ 先上一张成功的图片,hadoop的伪分布式安 ...
- Python使用subprocess的Popen要调用系统命令
当我们须要调用系统的命令的时候,最先考虑的os模块.用os.system()和os.popen()来进行操作.可是这两个命令过于简单.不能完毕一些复杂的操作,如给执行的命令提供输入或者读取命令的输出, ...
- telnet模拟http訪问
HTTP协议经常使用的无非就那么几个命令 GET HEAD PUT POST 此处简单说下http的GET和HEAD 举两个简单的样例: GET的样例 telnet serverip 80 GET h ...
- hive的非交互模式
在linux的终端运行:$HIVE_HOME/bin/hive 会进入交互模式: $HIVE_HOME/bin/hive -e或者-f 是非交互模式 1.非交互模式运行HQL语句 $HIVE_HOM ...