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,– testInitDomainjunit.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 此问题

像一颗深绿色的宝石镶嵌在云南大地上,

Android CTS测试Fail项修改总结(四)

相关文章:

你感兴趣的文章:

标签云: