From c034a43d44d87a6bb85bbdec9876b41b46ab5625 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 20 Jul 2017 15:17:35 +0900 Subject: [PATCH] Add [test] section for /data/[nativetest|benchmarktest] We have both system and vendor tests in the same directory /data/nativetest. Since we can't distinguish system and vendor tests at runtime, we choose to run all of them with the legacy namespace configuration where /system/lib and /vendor/lib are both accessible without any restriction. Furthermore, /system/lib/vndk-sp is added to the list of accessible directories for tests since some libs (such as libion.so) exist only in the directory but not in /system/lib. This will change in the future when we install system and vendor tests into different directories (vendor tests goes into ./vendor subdir). Then, we will run the tests with [system] or [vendor] configurations depending on their paths. Bug: 63597267 Test: run bionic-unit-tests Test: run linker-unit-tests Change-Id: I810003b2da0b30335200c130f484ea7b041f9f80 --- rootdir/etc/ld.config.txt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index 859fcd265..56066bcf2 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt @@ -7,8 +7,10 @@ dir.system = /system/bin/ dir.system = /system/xbin/ dir.vendor = /vendor/bin/ -dir.system = /data/nativetest/ -dir.system = /data/nativetest64/ +dir.test = /data/nativetest/ +dir.test = /data/nativetest64/ +dir.test = /data/benchmarktest/ +dir.test = /data/benchmarktest64/ [system] additional.namespaces = sphal,vndk,rs @@ -107,9 +109,23 @@ namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB} namespace.vndk.links = default namespace.vndk.link.default.shared_libs = android.hidl.memory@1.0-impl.so:libc.so:libz.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libvndksupport.so - +############################################################################### +# Namespace config for vendor processes. In O, no restriction is enforced for +# them. However, in O-MR1, access to /system/${LIB} will not be allowed to +# the default namespace. 'system' namespace will be added to give limited +# (LL-NDK only) access. +############################################################################### [vendor] namespace.default.isolated = false namespace.default.search.paths = /vendor/${LIB}:/vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/system/${LIB} namespace.default.asan.search.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/data/asan/system/${LIB}:/system/${LIB} + +############################################################################### +# Namespace config for tests. No VNDK restriction is enforced for these tests. +############################################################################### +[test] +namespace.default.isolated = false +namespace.default.search.paths = /vendor/${LIB}:/vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/system/${LIB} + +namespace.default.asan.search.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/data/asan/system/${LIB}:/system/${LIB}