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)

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值