Merge changes I45a82bf8,I80f3ee4e,I5aad29fa,Id415642b
* changes: vndk-def: Add --system-dir-ignored option vndk-def-tool: Update README.md vndk-def: Implement degenerated VNDK for o-release vndk-def: Introduce better eligible list
This commit is contained in:
@@ -1,131 +1,77 @@
|
|||||||
VNDK Definition Tool
|
VNDK Definition Tool
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
VNDK definition tool was designed to classify all shared libraries in the
|
||||||
|
system partition and give suggestions to copy necessary libraries to the vendor
|
||||||
|
partition.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Create a generic reference symbols from AOSP build:
|
To run VNDK definition tool, you will need three inputs:
|
||||||
|
|
||||||
$ python3 vndk_definition_tool.py create-generic-ref \
|
1. The system and vendor image for your target
|
||||||
-o generic_arm64/system \
|
2. Android Treble reference image
|
||||||
${OUT_DIR_COMMON_BASE}/target/product/generic_arm64/system
|
3. Eligible VNDK list from Google (e.g. eligible-list-v3.0.csv)
|
||||||
|
|
||||||
Run the VNDK definition tool with:
|
The high-level overview of the command line usage is:
|
||||||
|
|
||||||
$ python3 vndk_definition_tool.py vndk \
|
$ python3 ./vndk_definition_tool.py vndk \
|
||||||
|
--system "/path/to/your/product_out/system" \
|
||||||
|
--vendor "/path/to/your/product_out/vendor" \
|
||||||
|
--aosp-system "/path/to/aosp/generic/system" \
|
||||||
|
--tag-file "eligible-list-v3.0.csv"
|
||||||
|
|
||||||
|
This command will print several lines such as:
|
||||||
|
|
||||||
|
extra_vndk_sp_indirect: libexample1.so
|
||||||
|
extra_vndk_sp_indirect: libexample2.so
|
||||||
|
vndk_ext: libexample3.so
|
||||||
|
vndk_ext: libexample4.so
|
||||||
|
|
||||||
|
This output implies:
|
||||||
|
|
||||||
|
1. `libexample1.so` and `libexample2.so` should be copied into
|
||||||
|
`/vendor/lib[64]/vndk-sp`.
|
||||||
|
|
||||||
|
2. `libexample3.so` and `libexample4.so` should be copied into
|
||||||
|
`/vendor/lib[64]`.
|
||||||
|
|
||||||
|
|
||||||
|
# Boilerplates
|
||||||
|
|
||||||
|
There are some boilerplates in `templates` directory that can automate the
|
||||||
|
process to copy shared libraries.
|
||||||
|
|
||||||
|
If the output tagged some shared libraries with `extra_vndk_sp_indirect`, then
|
||||||
|
copy `templates/extra_vndk_sp_indirect.txt` to an Android.mk and substitute
|
||||||
|
`##_EXTRA_VNDK_SP_INDIRECT_##` with library names (without `.so`).
|
||||||
|
|
||||||
|
If the output tagged some shared libraries with `vndk_ext`, then copy
|
||||||
|
`templates/vndk_ext.txt` to an Android.mk and substitute `##_VNDK_EXT_##` with
|
||||||
|
library names (without `.so`).
|
||||||
|
|
||||||
|
These boilerplates only define the modules to copy shared libraries.
|
||||||
|
Developers have to add those modules to the `PRODUCT_PACKAGES` variable in
|
||||||
|
their `device.mk`. For example, in the example mentioned above, following
|
||||||
|
`PRODUCT_PACKAGES` changes are necessary for that target:
|
||||||
|
|
||||||
|
PRODUCT_PACKAGES += libexample1.vndk-sp-ext
|
||||||
|
PRODUCT_PACKAGES += libexample2.vndk-sp-ext
|
||||||
|
PRODUCT_PACKAGES += libexample3.vndk-ext
|
||||||
|
PRODUCT_PACKAGES += libexample4.vndk-ext
|
||||||
|
|
||||||
|
|
||||||
|
## Ignore Subdirectories
|
||||||
|
|
||||||
|
Some devices keep their vendor modules in `/system/vendor`. To run VNDK
|
||||||
|
definition tool for those devices, we have to skip `/system/vendor` and specify
|
||||||
|
it with `--vendor` option. For example:
|
||||||
|
|
||||||
|
python3 vndk_definition_tool.py vndk \
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
--system ${ANDROID_PRODUCT_OUT}/system \
|
||||||
--vendor ${ANDROID_PRODUCT_OUT}/vendor \
|
--system-dir-igored vendor \
|
||||||
--load-generic-refs generic_arm64
|
--vendor ${ANDROID_PRODUCT_OUT}/system/vendor \
|
||||||
|
# ...
|
||||||
This command will print shared libraries that belong to the following sets:
|
|
||||||
|
|
||||||
1. **sp-ndk**
|
|
||||||
|
|
||||||
- This contains the pre-defined SP-NDK libraries.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]`
|
|
||||||
|
|
||||||
2. **sp-ndk-vndk-stable**
|
|
||||||
|
|
||||||
- This contains the SP-NDK dependencies.
|
|
||||||
|
|
||||||
- The libraries with long-term API/ABI stability/compatibility commitment.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]/vndk-stable`
|
|
||||||
|
|
||||||
3. **sp-hal**
|
|
||||||
|
|
||||||
- This contains the pre-defined SP-HAL libraries.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/vendor/lib[64]/sameprocess`
|
|
||||||
|
|
||||||
4. **sp-hal-dep**
|
|
||||||
|
|
||||||
- This contains the SP-HAL non-AOSP dependencies.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/vendor/lib[64]/sameprocess`
|
|
||||||
|
|
||||||
5. **sp-hal-vndk-stable**
|
|
||||||
|
|
||||||
- This contains the SP-HAL AOSP dependencies.
|
|
||||||
|
|
||||||
- The libraries with long-term API/ABI stability/compatibility commitment.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]/vndk-stable`
|
|
||||||
|
|
||||||
6. **vndk-core**
|
|
||||||
|
|
||||||
- This contains the shared libraries used by both the framework and
|
|
||||||
vendor code.
|
|
||||||
|
|
||||||
- The libraries must be either intact or inward-customized.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]/vndk-$FWK`
|
|
||||||
|
|
||||||
7. **vndk-indirect**
|
|
||||||
|
|
||||||
- This contains the shared libraries which are indirectly used by
|
|
||||||
aforementioned vndk-core but not directly used by vendor code.
|
|
||||||
|
|
||||||
- The libraries must be either intact or inward-customized.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]/vndk-$FWK`
|
|
||||||
|
|
||||||
8. **vndk-fwd-ext**
|
|
||||||
|
|
||||||
- This contains the vndk-core/vndk-indirect overlays for *the framework*.
|
|
||||||
|
|
||||||
- The libraries must be either outward-customized or extended. In other
|
|
||||||
words, the libraries in this list might use or define non-AOSP APIs.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/system/lib[64]/vndk-$FWK-ext`
|
|
||||||
|
|
||||||
9. **vndk-vnd-ext**
|
|
||||||
|
|
||||||
- This contains the vndk-core overlays for *vendor code*.
|
|
||||||
|
|
||||||
- The libraries must be either outward-customized or extended. In other
|
|
||||||
words, the libraries in this list might use or define non-AOSP APIs.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/vendor/lib[64]/vndk-$VND-ext`
|
|
||||||
|
|
||||||
10. **extra-vendor-lib**
|
|
||||||
|
|
||||||
- This contains the extra libraries that have to be copied from
|
|
||||||
`/system/lib[64]` to `/vendor/lib[64]`.
|
|
||||||
|
|
||||||
- The libraries in this list are usually the non-AOSP dependencies of
|
|
||||||
vndk-vnd-ext or other vendor code.
|
|
||||||
|
|
||||||
- The libraries will be installed to `/vendor/lib[64]`
|
|
||||||
|
|
||||||
|
|
||||||
# Sub Directory Tagging
|
|
||||||
|
|
||||||
If there are some sub directory under system partition must be treated as
|
|
||||||
vendor files, then specify such directory with: `--system-dir-as-vendor`.
|
|
||||||
|
|
||||||
Conversely, if there are some sub directory under vendor partition must be
|
|
||||||
treated as system files, then specify such directory with:
|
|
||||||
`--vendor-dir-as-system`.
|
|
||||||
|
|
||||||
For example, if the device does not have an independent `vendor` partition (but
|
|
||||||
with a `vendor` folder in the `system` partition), then run this command:
|
|
||||||
|
|
||||||
$ python3 vndk_definition_tool.py vndk \
|
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
|
||||||
--system-dir-as-vendor vendor \
|
|
||||||
--load-generic-refs generic_arm64
|
|
||||||
|
|
||||||
For example, if `/system/bin/hw`, `/system/lib/hw`, and `/system/lib64/hw` are
|
|
||||||
containing vendor files, then run this command:
|
|
||||||
|
|
||||||
$ python3 vndk_definition_tool.py vndk \
|
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
|
||||||
--system-dir-as-vendor bin/hw \
|
|
||||||
--system-dir-as-vendor lib/hw \
|
|
||||||
--system-dir-as-vendor lib64/hw \
|
|
||||||
--vendor ${ANDROID_PRODUCT_OUT}/vendor \
|
|
||||||
--load-generic-refs generic_arm64
|
|
||||||
|
|
||||||
|
|
||||||
## Implicit Dependencies
|
## Implicit Dependencies
|
||||||
@@ -143,65 +89,15 @@ And then, run VNDK definition tool with:
|
|||||||
$ python3 vndk_definition_tool.py vndk \
|
$ python3 vndk_definition_tool.py vndk \
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
--system ${ANDROID_PRODUCT_OUT}/system \
|
||||||
--vendor ${ANDROID_PRODUCT_OUT}/vendor \
|
--vendor ${ANDROID_PRODUCT_OUT}/vendor \
|
||||||
--load-generic-refs generic_arm64 \
|
--aosp-system ${ANDROID_PRODUCT_OUT}/../generic_arm64_a \
|
||||||
|
--tag-file eligible-list-v3.0.csv \
|
||||||
--load-extra-deps dlopen.dep
|
--load-extra-deps dlopen.dep
|
||||||
|
|
||||||
|
|
||||||
## Partition for VNDK with Outward Customization
|
## Remarks
|
||||||
|
|
||||||
An outward-customized VNDK library can be put on both system and vendor
|
To run VNDK definition tool against an image (`.img`), run the following
|
||||||
partition. VNDK definition tool will assume such library will be installed
|
command to mount the images and run `vndk_definition_tool.py` with `sudo`:
|
||||||
into /system/lib[64]/vndk-$FWK-ext by default. Use following options to change
|
|
||||||
the default behavior.
|
|
||||||
|
|
||||||
* `--outward-customization-default-partition=[system*|vendor|both]`
|
|
||||||
|
|
||||||
This option specifies the default destination for outward-customized VNDK
|
|
||||||
libraries. The default value is the system partition.
|
|
||||||
|
|
||||||
* `--outward-customization-for-system=[lib]`
|
|
||||||
|
|
||||||
This option specifies the library that should be installed to the system
|
|
||||||
partition if it is an outward-customized VNDK library.
|
|
||||||
|
|
||||||
* `--outward-customization-for-vendor=[lib]`
|
|
||||||
|
|
||||||
This option specifies the library that should be installed to the vendor
|
|
||||||
partition if it is an outward-customized VNDK library.
|
|
||||||
|
|
||||||
|
|
||||||
## Warnings
|
|
||||||
|
|
||||||
### Incorrect Partition
|
|
||||||
|
|
||||||
If you specify `--warn-incorrect-partition` command line option, then VNDK
|
|
||||||
definition tool will emit warnings when:
|
|
||||||
|
|
||||||
1. A framework library is only used by vendor binaries.
|
|
||||||
|
|
||||||
2. A vendor library is only used by framework binaries.
|
|
||||||
|
|
||||||
This allows people to review the correct partition for the module. For example,
|
|
||||||
|
|
||||||
warning: /system/lib/libtinyxml.so: This is a framework library with
|
|
||||||
vendor-only usages.
|
|
||||||
|
|
||||||
warning: /system/lib64/libtinyxml.so: This is a framework library with
|
|
||||||
vendor-only usages.
|
|
||||||
|
|
||||||
These warnings suggest that `libtinyxml.so` might be better to move to vendor
|
|
||||||
partition.
|
|
||||||
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
We can run this against Nexus 6p Factory Image:
|
|
||||||
|
|
||||||
$ unzip angler-nmf26f-factory-ef607244.zip
|
|
||||||
|
|
||||||
$ cd angler-nmf26f
|
|
||||||
|
|
||||||
$ unzip image-angler-nmf26f.zip
|
|
||||||
|
|
||||||
$ simg2img system.img system.raw.img
|
$ simg2img system.img system.raw.img
|
||||||
|
|
||||||
@@ -216,34 +112,7 @@ We can run this against Nexus 6p Factory Image:
|
|||||||
$ sudo mount -o loop,ro vendor.raw.img vendor
|
$ sudo mount -o loop,ro vendor.raw.img vendor
|
||||||
|
|
||||||
$ sudo python3 vndk_definition_tool.py vndk \
|
$ sudo python3 vndk_definition_tool.py vndk \
|
||||||
--system system --vendor vendor
|
--system system \
|
||||||
|
--vendor vendor \
|
||||||
We can run this against latest Android build:
|
--aosp-system /path/to/aosp/generic/system \
|
||||||
|
--tag-file eligible-list-v3.0.csv
|
||||||
$ python3 vndk_definition_tool.py vndk \
|
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
|
||||||
--system-dir-as-vendor bin/hw \
|
|
||||||
--system-dir-as-vendor lib/hw \
|
|
||||||
--system-dir-as-vendor lib64/hw \
|
|
||||||
--vendor ${ANDROID_PRODUCT_OUT}/vendor
|
|
||||||
|
|
||||||
|
|
||||||
## Find SP-NDK and SP-HAL Dependencies
|
|
||||||
|
|
||||||
VNDK Definition Tool can define the same-process HAL as well. To find SP-NDK,
|
|
||||||
SP-HAL, SP-HAL-DEP, and VNDK-stable, run `sp-lib` subcommand:
|
|
||||||
|
|
||||||
$ python3 vndk_definition_tool.py sp-lib \
|
|
||||||
--system ${ANDROID_PRODUCT_OUT}/system \
|
|
||||||
--vendor ${ANDROID_PRODUCT_OUT}/vendor
|
|
||||||
|
|
||||||
The output format is identical to the one described in [Usage](#usage) section.
|
|
||||||
|
|
||||||
|
|
||||||
## Python 2 Support
|
|
||||||
|
|
||||||
Since `vndk_definition_tool.py` runs 3x faster with Python 3, the shebang is
|
|
||||||
specifying `python3` by default. To run `vndk_definition_tool.py` with
|
|
||||||
python2, run the following command:
|
|
||||||
|
|
||||||
$ python vndk_definition_tool.py [options]
|
|
||||||
|
|||||||
12
vndk/tools/definition-tool/datasets/minimum_dlopen_deps.txt
Normal file
12
vndk/tools/definition-tool/datasets/minimum_dlopen_deps.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/system/lib/libEGL.so:/system/lib/libEGL.so
|
||||||
|
/system/lib/libEGL.so:/system/lib/libGLESv1_CM.so
|
||||||
|
/system/lib/libEGL.so:/system/lib/libGLESv2.so
|
||||||
|
/system/lib/libc.so:/system/lib/libc_malloc_debug.so
|
||||||
|
/system/lib/libc.so:/system/lib/libicuuc.so
|
||||||
|
/system/lib/libc.so:/system/lib/libnetd_client.so
|
||||||
|
/system/lib64/libEGL.so:/system/lib64/libEGL.so
|
||||||
|
/system/lib64/libEGL.so:/system/lib64/libGLESv1_CM.so
|
||||||
|
/system/lib64/libEGL.so:/system/lib64/libGLESv2.so
|
||||||
|
/system/lib64/libc.so:/system/lib64/libc_malloc_debug.so
|
||||||
|
/system/lib64/libc.so:/system/lib64/libicuuc.so
|
||||||
|
/system/lib64/libc.so:/system/lib64/libnetd_client.so
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
EXTRA_VNDK_SP_INDIRECT_LIBRARIES := ##_EXTRA_VNDK_SP_INDIRECT_##
|
||||||
|
|
||||||
|
define define-vndk-sp-indirect-ext-lib
|
||||||
|
include $$(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := $1.vndk-sp-ext
|
||||||
|
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||||
|
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,,)/PACKED/$1.so
|
||||||
|
LOCAL_MULTILIB := first
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM := $1.so
|
||||||
|
LOCAL_MODULE_SUFFIX := .so
|
||||||
|
LOCAL_MODULE_RELATIVE_PATH := vndk-sp
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
include $$(BUILD_PREBUILT)
|
||||||
|
|
||||||
|
ifneq ($$(TARGET_2ND_ARCH),)
|
||||||
|
ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true)
|
||||||
|
include $$(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := $1.vndk-sp-ext
|
||||||
|
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||||
|
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$$(TARGET_2ND_ARCH_VAR_PREFIX),)/PACKED/$1.so
|
||||||
|
LOCAL_MULTILIB := 32
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM := $1.so
|
||||||
|
LOCAL_MODULE_SUFFIX := .so
|
||||||
|
LOCAL_MODULE_RELATIVE_PATH := vndk-sp
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
include $$(BUILD_PREBUILT)
|
||||||
|
endif # TARGET_TRANSLATE_2ND_ARCH is not true
|
||||||
|
endif # TARGET_2ND_ARCH is not empty
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach lib,$(VNDK_SP_LIBRARIES),\
|
||||||
|
$(eval $(call define-vndk-sp-indirect-ext-lib,$(lib))))
|
||||||
|
|
||||||
|
# Add following module names to PRODUCT_PACKAGES:
|
||||||
|
# PRODUCT_PACKAGES += $(addsuffix .vndk-sp-ext,$(EXTRA_VNDK_SP_INDIRECT_LIBRARIES))
|
||||||
37
vndk/tools/definition-tool/templates/vndk_ext.txt
Normal file
37
vndk/tools/definition-tool/templates/vndk_ext.txt
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
VNDK_EXT_LIBRARIES := ##_VNDK_EXT_##
|
||||||
|
|
||||||
|
define define-vndk-ext-lib
|
||||||
|
include $$(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := $1.vndk-ext
|
||||||
|
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||||
|
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,,)/PACKED/$1.so
|
||||||
|
LOCAL_MULTILIB := first
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM := $1.so
|
||||||
|
LOCAL_MODULE_SUFFIX := .so
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
include $$(BUILD_PREBUILT)
|
||||||
|
|
||||||
|
ifneq ($$(TARGET_2ND_ARCH),)
|
||||||
|
ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true)
|
||||||
|
include $$(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := $1.vndk-ext
|
||||||
|
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||||
|
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$$(TARGET_2ND_ARCH_VAR_PREFIX),)/PACKED/$1.so
|
||||||
|
LOCAL_MULTILIB := 32
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM := $1.so
|
||||||
|
LOCAL_MODULE_SUFFIX := .so
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
include $$(BUILD_PREBUILT)
|
||||||
|
endif # TARGET_TRANSLATE_2ND_ARCH is not true
|
||||||
|
endif # TARGET_2ND_ARCH is not empty
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach lib,$(VNDK_SP_LIBRARIES),\
|
||||||
|
$(eval $(call define-vndk-ext-lib,$(lib))))
|
||||||
|
|
||||||
|
# Add following module names to PRODUCT_PACKAGES:
|
||||||
|
# PRODUCT_PACKAGES += $(addsuffix .vndk-ext,$(VNDK_EXT_LIBRARIES))
|
||||||
@@ -132,17 +132,13 @@ class ELFLinkerTest(unittest.TestCase):
|
|||||||
self.assertEqual(['/system/lib64/libdl.so'],
|
self.assertEqual(['/system/lib64/libdl.so'],
|
||||||
self._get_paths_from_nodes(nodes))
|
self._get_paths_from_nodes(nodes))
|
||||||
|
|
||||||
def test_elf_class(self):
|
def test_elf_class_and_partitions(self):
|
||||||
gb = self._create_normal_graph()
|
gb = self._create_normal_graph()
|
||||||
graph = gb.graph
|
graph = gb.graph
|
||||||
self.assertEqual(6, len(graph.lib32))
|
self.assertEqual(5, len(graph.lib_pt[PT_SYSTEM].lib32))
|
||||||
self.assertEqual(6, len(graph.lib64))
|
self.assertEqual(5, len(graph.lib_pt[PT_SYSTEM].lib64))
|
||||||
|
self.assertEqual(1, len(graph.lib_pt[PT_VENDOR].lib32))
|
||||||
def test_partitions(self):
|
self.assertEqual(1, len(graph.lib_pt[PT_VENDOR].lib64))
|
||||||
gb = self._create_normal_graph()
|
|
||||||
graph = gb.graph
|
|
||||||
self.assertEqual(10, len(gb.graph.lib_pt[PT_SYSTEM]))
|
|
||||||
self.assertEqual(2, len(gb.graph.lib_pt[PT_VENDOR]))
|
|
||||||
|
|
||||||
def test_deps(self):
|
def test_deps(self):
|
||||||
gb = self._create_normal_graph()
|
gb = self._create_normal_graph()
|
||||||
@@ -169,7 +165,7 @@ class ELFLinkerTest(unittest.TestCase):
|
|||||||
graph = gb.graph
|
graph = gb.graph
|
||||||
|
|
||||||
# Check the unresolved symbols.
|
# Check the unresolved symbols.
|
||||||
for lib_set in (graph.lib32, graph.lib64):
|
for lib_set in graph.lib_pt:
|
||||||
for lib in lib_set.values():
|
for lib in lib_set.values():
|
||||||
self.assertEqual(set(), lib.unresolved_symbols)
|
self.assertEqual(set(), lib.unresolved_symbols)
|
||||||
|
|
||||||
@@ -237,6 +233,27 @@ class ELFLinkerTest(unittest.TestCase):
|
|||||||
node = graph.get_lib('/vendor/lib64/libEGL.so')
|
node = graph.get_lib('/vendor/lib64/libEGL.so')
|
||||||
self.assertEqual([], self._get_paths_from_nodes(node.users))
|
self.assertEqual([], self._get_paths_from_nodes(node.users))
|
||||||
|
|
||||||
|
def test_compute_predefined_fwk_only_rs(self):
|
||||||
|
lib_names = (
|
||||||
|
'libft2',
|
||||||
|
'libmediandk',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add VNDK-SP libraries.
|
||||||
|
gb = GraphBuilder()
|
||||||
|
for name in lib_names:
|
||||||
|
gb.add_multilib(PT_SYSTEM, name)
|
||||||
|
gb.resolve()
|
||||||
|
|
||||||
|
# Compute FWK-ONLY-RS and check the result.
|
||||||
|
fwk_only_rs = gb.graph.compute_predefined_fwk_only_rs()
|
||||||
|
fwk_only_rs = set(lib.path for lib in fwk_only_rs)
|
||||||
|
|
||||||
|
for lib_dir_name in ('lib', 'lib64'):
|
||||||
|
lib_dir = '/system/' + lib_dir_name
|
||||||
|
for name in lib_names:
|
||||||
|
self.assertIn(os.path.join(lib_dir, name + '.so'), fwk_only_rs)
|
||||||
|
|
||||||
def test_compute_predefined_vndk_sp(self):
|
def test_compute_predefined_vndk_sp(self):
|
||||||
lib_names = (
|
lib_names = (
|
||||||
'android.hardware.graphics.allocator@2.0',
|
'android.hardware.graphics.allocator@2.0',
|
||||||
@@ -288,7 +305,6 @@ class ELFLinkerTest(unittest.TestCase):
|
|||||||
lib_names = (
|
lib_names = (
|
||||||
'libbacktrace',
|
'libbacktrace',
|
||||||
'libblas',
|
'libblas',
|
||||||
'libft2',
|
|
||||||
'liblzma',
|
'liblzma',
|
||||||
'libpng',
|
'libpng',
|
||||||
'libunwind',
|
'libunwind',
|
||||||
@@ -505,58 +521,6 @@ class ELFLinkerTest(unittest.TestCase):
|
|||||||
self.assertNotIn(libc_path, sp_ndk_indirect)
|
self.assertNotIn(libc_path, sp_ndk_indirect)
|
||||||
|
|
||||||
|
|
||||||
def test_find_existing_vndk(self):
|
|
||||||
gb = GraphBuilder()
|
|
||||||
|
|
||||||
libpng32_core, libpng64_core = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libpng', extra_dir='vndk-26')
|
|
||||||
libpng32_fwk, libpng64_fwk = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libpng', extra_dir='vndk-26-ext')
|
|
||||||
|
|
||||||
libjpeg32_core, libjpeg64_core = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libjpeg', extra_dir='vndk-26')
|
|
||||||
libjpeg32_vnd, libjpeg64_vnd = \
|
|
||||||
gb.add_multilib(PT_VENDOR, 'libjpeg', extra_dir='vndk-26-ext')
|
|
||||||
|
|
||||||
gb.resolve()
|
|
||||||
|
|
||||||
vndk_core, vndk_fwk_ext, vndk_vnd_ext = gb.graph.find_existing_vndk()
|
|
||||||
|
|
||||||
expected_vndk_core = {
|
|
||||||
libpng32_core, libpng64_core, libjpeg32_core, libjpeg64_core}
|
|
||||||
expected_vndk_fwk_ext = {libpng32_fwk, libpng64_fwk}
|
|
||||||
expected_vndk_vnd_ext = {libjpeg32_vnd, libjpeg64_vnd}
|
|
||||||
|
|
||||||
self.assertSetEqual(expected_vndk_core, vndk_core)
|
|
||||||
self.assertSetEqual(expected_vndk_fwk_ext, vndk_fwk_ext)
|
|
||||||
self.assertSetEqual(expected_vndk_vnd_ext, vndk_vnd_ext)
|
|
||||||
|
|
||||||
def test_find_existing_vndk_without_version(self):
|
|
||||||
gb = GraphBuilder()
|
|
||||||
|
|
||||||
libpng32_core, libpng64_core = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libpng', extra_dir='vndk')
|
|
||||||
libpng32_fwk, libpng64_fwk = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libpng', extra_dir='vndk-ext')
|
|
||||||
|
|
||||||
libjpeg32_core, libjpeg64_core = \
|
|
||||||
gb.add_multilib(PT_SYSTEM, 'libjpeg', extra_dir='vndk')
|
|
||||||
libjpeg32_vnd, libjpeg64_vnd = \
|
|
||||||
gb.add_multilib(PT_VENDOR, 'libjpeg', extra_dir='vndk-ext')
|
|
||||||
|
|
||||||
gb.resolve()
|
|
||||||
|
|
||||||
vndk_core, vndk_fwk_ext, vndk_vnd_ext = gb.graph.find_existing_vndk()
|
|
||||||
|
|
||||||
expected_vndk_core = {
|
|
||||||
libpng32_core, libpng64_core, libjpeg32_core, libjpeg64_core}
|
|
||||||
expected_vndk_fwk_ext = {libpng32_fwk, libpng64_fwk}
|
|
||||||
expected_vndk_vnd_ext = {libjpeg32_vnd, libjpeg64_vnd}
|
|
||||||
|
|
||||||
self.assertSetEqual(expected_vndk_core, vndk_core)
|
|
||||||
self.assertSetEqual(expected_vndk_fwk_ext, vndk_fwk_ext)
|
|
||||||
self.assertSetEqual(expected_vndk_vnd_ext, vndk_vnd_ext)
|
|
||||||
|
|
||||||
def test_compute_vndk_cap(self):
|
def test_compute_vndk_cap(self):
|
||||||
gb = GraphBuilder()
|
gb = GraphBuilder()
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ class GenericRefsTest(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(self.ref.is_equivalent_lib(libc_eq))
|
self.assertTrue(self.ref.is_equivalent_lib(libc_eq))
|
||||||
|
|
||||||
|
def test_has_same_name_lib(self):
|
||||||
|
self.assertTrue(self.ref.has_same_name_lib(
|
||||||
|
MockLib('/vendor/lib/libc.so', {})))
|
||||||
|
self.assertFalse(self.ref.has_same_name_lib(
|
||||||
|
MockLib('/vendor/lib/lib_does_not_exist.so', {})))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
479
vndk/tools/definition-tool/tests/test_tagged_dict.py
Executable file
479
vndk/tools/definition-tool/tests/test_tagged_dict.py
Executable file
@@ -0,0 +1,479 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from compat import StringIO
|
||||||
|
from vndk_definition_tool import TaggedDict, TaggedPathDict, TaggedLibDict, \
|
||||||
|
NUM_PARTITIONS, PT_SYSTEM, PT_VENDOR
|
||||||
|
|
||||||
|
|
||||||
|
_TEST_DATA = '''Path,Tag
|
||||||
|
/system/lib/lib_ll_ndk.so,ll-ndk
|
||||||
|
/system/lib/lib_ll_ndk_indirect.so,ll-ndk-indirect
|
||||||
|
/system/lib/lib_sp_ndk.so,sp-ndk
|
||||||
|
/system/lib/lib_sp_ndk_indirect.so,sp-ndk-indirect
|
||||||
|
/system/lib/lib_vndk_sp.so,vndk-sp
|
||||||
|
/system/lib/lib_vndk_sp_indirect.so,vndk-sp-indirect
|
||||||
|
/system/lib/lib_vndk_sp_indirect_private.so,vndk-sp-indirect-private
|
||||||
|
/system/lib/lib_vndk.so,vndk
|
||||||
|
/system/lib/lib_fwk_only.so,fwk-only
|
||||||
|
/system/lib/lib_fwk_only_rs.so,fwk-only-rs
|
||||||
|
/vendor/lib/lib_sp_hal.so,sp-hal
|
||||||
|
/vendor/lib/lib_sp_hal_dep.so,sp-hal-dep
|
||||||
|
/vendor/lib/lib_vnd_only.so,vnd-only
|
||||||
|
/system/lib/lib_remove.so,remove
|
||||||
|
/system/lib/lib_hl_ndk.so,hl-ndk
|
||||||
|
/system/lib/lib_vndk_indirect.so,vndk-indirect
|
||||||
|
/system/lib/lib_vndk_sp_both.so,vndk-sp-both
|
||||||
|
/system/lib/lib_vndk_sp_hal.so,vndk-sp-hal
|
||||||
|
'''
|
||||||
|
|
||||||
|
_TEST_DATA_ALIAS_PATHS = {
|
||||||
|
'/system/lib/lib_hl_ndk.so',
|
||||||
|
'/system/lib/lib_vndk_sp_both.so',
|
||||||
|
'/system/lib/lib_vndk_sp_hal.so',
|
||||||
|
'/system/lib/lib_vndk_indirect.so'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class TaggedDictTest(unittest.TestCase):
|
||||||
|
def test_normalize_tag(self):
|
||||||
|
self.assertEqual('ll_ndk', TaggedDict._normalize_tag('ll-ndk'))
|
||||||
|
self.assertEqual('ll_ndk', TaggedDict._normalize_tag('LL-NDK'))
|
||||||
|
self.assertEqual('ll_ndk', TaggedDict._normalize_tag('LL_NDK'))
|
||||||
|
with self.assertRaises(ValueError):
|
||||||
|
TaggedDict._normalize_tag('unknown-lib-tag')
|
||||||
|
|
||||||
|
|
||||||
|
def _check_tag_visibility(self, d, from_tag, visible_tags):
|
||||||
|
for to_tag in TaggedDict.TAGS:
|
||||||
|
self.assertEqual(d.is_tag_visible(from_tag, to_tag),
|
||||||
|
to_tag in visible_tags)
|
||||||
|
|
||||||
|
|
||||||
|
def test_is_tag_visible(self):
|
||||||
|
d = TaggedDict()
|
||||||
|
|
||||||
|
# LL-NDK
|
||||||
|
visible_tags = {'ll_ndk', 'll_ndk_indirect'}
|
||||||
|
self._check_tag_visibility(d, 'll_ndk', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'll_ndk_indirect', visible_tags)
|
||||||
|
|
||||||
|
# SP-NDK
|
||||||
|
visible_tags = {'ll_ndk', 'll_ndk_indirect',
|
||||||
|
'sp_ndk', 'sp_ndk_indirect'}
|
||||||
|
self._check_tag_visibility(d, 'sp_ndk', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'sp_ndk_indirect', visible_tags)
|
||||||
|
|
||||||
|
# VNDK-SP
|
||||||
|
visible_tags = {'ll_ndk', 'sp_ndk', 'vndk_sp', 'vndk_sp_indirect',
|
||||||
|
'vndk_sp_indirect_private', 'fwk_only_rs'}
|
||||||
|
self._check_tag_visibility(d, 'vndk_sp', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'vndk_sp_indirect', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'vndk_sp_indirect_private', visible_tags)
|
||||||
|
|
||||||
|
# VNDK
|
||||||
|
visible_tags = {'ll_ndk', 'sp_ndk', 'vndk_sp', 'vndk_sp_indirect',
|
||||||
|
'vndk'}
|
||||||
|
self._check_tag_visibility(d, 'vndk', visible_tags)
|
||||||
|
|
||||||
|
# FWK-ONLY
|
||||||
|
visible_tags = {'ll_ndk', 'll_ndk_indirect', 'sp_ndk',
|
||||||
|
'sp_ndk_indirect', 'vndk_sp', 'vndk_sp_indirect',
|
||||||
|
'vndk_sp_indirect_private', 'vndk', 'fwk_only',
|
||||||
|
'fwk_only_rs', 'sp_hal'}
|
||||||
|
self._check_tag_visibility(d, 'fwk_only', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'fwk_only_rs', visible_tags)
|
||||||
|
|
||||||
|
# SP-HAL
|
||||||
|
visible_tags = {'ll_ndk', 'sp_ndk', 'vndk_sp', 'sp_hal', 'sp_hal_dep'}
|
||||||
|
self._check_tag_visibility(d, 'sp_hal', visible_tags)
|
||||||
|
self._check_tag_visibility(d, 'sp_hal_dep', visible_tags)
|
||||||
|
|
||||||
|
# VND-ONLY
|
||||||
|
visible_tags = {'ll_ndk', 'sp_ndk', 'vndk_sp', 'vndk_sp_indirect',
|
||||||
|
'vndk', 'sp_hal', 'sp_hal_dep', 'vnd_only'}
|
||||||
|
self._check_tag_visibility(d, 'vnd_only', visible_tags)
|
||||||
|
|
||||||
|
# Remove
|
||||||
|
self._check_tag_visibility(d, 'remove', set())
|
||||||
|
|
||||||
|
|
||||||
|
class TaggedPathDictTest(unittest.TestCase):
|
||||||
|
def test_enumerate_paths(self):
|
||||||
|
self.assertEqual(
|
||||||
|
['/system/lib/libc.so'],
|
||||||
|
list(TaggedPathDict._enumerate_paths('/system/lib/libc.so')))
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
['/system/lib/libc.so', '/system/lib64/libc.so'],
|
||||||
|
list(TaggedPathDict._enumerate_paths('/system/${LIB}/libc.so')))
|
||||||
|
|
||||||
|
|
||||||
|
def test_load_from_csv_empty(self):
|
||||||
|
try:
|
||||||
|
TaggedPathDict().load_from_csv(StringIO(''))
|
||||||
|
except StopIteration:
|
||||||
|
self.fail('empty file should be considered as a valid input')
|
||||||
|
|
||||||
|
|
||||||
|
def test_load_from_csv_with_header(self):
|
||||||
|
fp = StringIO('Path,Tag\nliba.so,fwk-only\n')
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
self.assertIn('liba.so', d.fwk_only)
|
||||||
|
|
||||||
|
fp = StringIO('Tag,Path\nfwk-only,liba.so\n')
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
self.assertIn('liba.so', d.fwk_only)
|
||||||
|
|
||||||
|
|
||||||
|
def test_load_from_csv_without_header(self):
|
||||||
|
fp = StringIO('liba.so,fwk-only\n')
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
self.assertIn('liba.so', d.fwk_only)
|
||||||
|
|
||||||
|
|
||||||
|
def _check_test_data_loaded(self, d):
|
||||||
|
# Paths
|
||||||
|
self.assertIn('/system/lib/lib_ll_ndk.so', d.ll_ndk)
|
||||||
|
self.assertIn('/system/lib/lib_ll_ndk_indirect.so', d.ll_ndk_indirect)
|
||||||
|
self.assertIn('/system/lib/lib_sp_ndk.so', d.sp_ndk)
|
||||||
|
self.assertIn('/system/lib/lib_sp_ndk_indirect.so', d.sp_ndk_indirect)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_sp.so', d.vndk_sp)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_sp_indirect.so', d.vndk_sp_indirect)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_sp_indirect_private.so',
|
||||||
|
d.vndk_sp_indirect_private)
|
||||||
|
self.assertIn('/system/lib/lib_vndk.so', d.vndk)
|
||||||
|
self.assertIn('/system/lib/lib_fwk_only.so', d.fwk_only)
|
||||||
|
self.assertIn('/system/lib/lib_fwk_only_rs.so', d.fwk_only_rs)
|
||||||
|
self.assertIn('/vendor/lib/lib_sp_hal.so', d.sp_hal)
|
||||||
|
self.assertIn('/vendor/lib/lib_sp_hal_dep.so', d.sp_hal_dep)
|
||||||
|
self.assertIn('/vendor/lib/lib_vnd_only.so', d.vnd_only)
|
||||||
|
self.assertIn('/system/lib/lib_remove.so', d.remove)
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
self.assertIn('/system/lib/lib_hl_ndk.so', d.fwk_only)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_sp_both.so', d.vndk_sp)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_sp_hal.so', d.vndk_sp)
|
||||||
|
self.assertIn('/system/lib/lib_vndk_indirect.so', d.vndk)
|
||||||
|
|
||||||
|
|
||||||
|
def test_load_from_csv_tags(self):
|
||||||
|
fp = StringIO(_TEST_DATA)
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
self._check_test_data_loaded(d)
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_from_csv(self):
|
||||||
|
d = TaggedPathDict.create_from_csv(StringIO(_TEST_DATA))
|
||||||
|
self._check_test_data_loaded(d)
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_from_csv_path(self):
|
||||||
|
with tempfile.NamedTemporaryFile('w+') as f:
|
||||||
|
f.write(_TEST_DATA)
|
||||||
|
f.flush()
|
||||||
|
|
||||||
|
d = TaggedPathDict.create_from_csv_path(f.name)
|
||||||
|
self._check_test_data_loaded(d)
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_path_tag(self):
|
||||||
|
fp = StringIO(_TEST_DATA)
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
|
||||||
|
self.assertEqual('ll_ndk', d.get_path_tag('/system/lib/lib_ll_ndk.so'))
|
||||||
|
self.assertEqual('ll_ndk_indirect',
|
||||||
|
d.get_path_tag('/system/lib/lib_ll_ndk_indirect.so'))
|
||||||
|
self.assertEqual('sp_ndk', d.get_path_tag('/system/lib/lib_sp_ndk.so'))
|
||||||
|
self.assertEqual('sp_ndk_indirect',
|
||||||
|
d.get_path_tag('/system/lib/lib_sp_ndk_indirect.so'))
|
||||||
|
self.assertEqual('vndk_sp',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_sp.so'))
|
||||||
|
self.assertEqual('vndk_sp_indirect',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_sp_indirect.so'))
|
||||||
|
self.assertEqual(
|
||||||
|
'vndk_sp_indirect_private',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_sp_indirect_private.so'))
|
||||||
|
self.assertEqual('vndk', d.get_path_tag('/system/lib/lib_vndk.so'))
|
||||||
|
self.assertEqual('fwk_only',
|
||||||
|
d.get_path_tag('/system/lib/lib_fwk_only.so'))
|
||||||
|
self.assertEqual('fwk_only_rs',
|
||||||
|
d.get_path_tag('/system/lib/lib_fwk_only_rs.so'))
|
||||||
|
self.assertEqual('sp_hal',
|
||||||
|
d.get_path_tag('/vendor/lib/lib_sp_hal.so'))
|
||||||
|
self.assertEqual('sp_hal_dep',
|
||||||
|
d.get_path_tag('/vendor/lib/lib_sp_hal_dep.so'))
|
||||||
|
self.assertEqual('vnd_only',
|
||||||
|
d.get_path_tag('/vendor/lib/lib_vnd_only.so'))
|
||||||
|
self.assertEqual('remove',
|
||||||
|
d.get_path_tag('/system/lib/lib_remove.so'))
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
self.assertEqual('fwk_only',
|
||||||
|
d.get_path_tag('/system/lib/lib_hl_ndk.so'))
|
||||||
|
self.assertEqual('vndk_sp',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_sp_hal.so'))
|
||||||
|
self.assertEqual('vndk_sp',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_sp_both.so'))
|
||||||
|
self.assertEqual('vndk',
|
||||||
|
d.get_path_tag('/system/lib/lib_vndk_indirect.so'))
|
||||||
|
|
||||||
|
# Unmatched paths
|
||||||
|
self.assertEqual('fwk_only', d.get_path_tag('/system/lib/unknown.so'))
|
||||||
|
self.assertEqual('fwk_only', d.get_path_tag('/data/lib/unknown.so'))
|
||||||
|
self.assertEqual('vnd_only', d.get_path_tag('/vendor/lib/unknown.so'))
|
||||||
|
|
||||||
|
|
||||||
|
def _check_path_visibility(self, d, all_paths, from_paths, visible_paths):
|
||||||
|
for from_path in from_paths:
|
||||||
|
for to_path in all_paths:
|
||||||
|
self.assertEqual(d.is_path_visible(from_path, to_path),
|
||||||
|
to_path in visible_paths)
|
||||||
|
|
||||||
|
|
||||||
|
def test_is_path_visible(self):
|
||||||
|
fp = StringIO(_TEST_DATA)
|
||||||
|
d = TaggedPathDict()
|
||||||
|
d.load_from_csv(fp)
|
||||||
|
|
||||||
|
# Collect path universe set.
|
||||||
|
all_paths = set()
|
||||||
|
for tag in TaggedPathDict.TAGS:
|
||||||
|
all_paths |= getattr(d, tag)
|
||||||
|
all_paths -= _TEST_DATA_ALIAS_PATHS
|
||||||
|
|
||||||
|
# LL-NDK
|
||||||
|
from_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_ll_ndk_indirect.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_ll_ndk_indirect.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# SP-NDK
|
||||||
|
from_paths = {
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk_indirect.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_ll_ndk_indirect.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk_indirect.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# VNDK-SP
|
||||||
|
from_paths = {
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect_private.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect_private.so',
|
||||||
|
'/system/lib/lib_fwk_only_rs.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# VNDK
|
||||||
|
from_paths = {
|
||||||
|
'/system/lib/lib_vndk.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect.so',
|
||||||
|
'/system/lib/lib_vndk.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# FWK-ONLY
|
||||||
|
from_paths = {
|
||||||
|
'/system/lib/lib_fwk_only.so',
|
||||||
|
'/system/lib/lib_fwk_only_rs.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_ll_ndk_indirect.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk_indirect.so',
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect_private.so',
|
||||||
|
'/system/lib/lib_vndk.so',
|
||||||
|
'/system/lib/lib_fwk_only.so',
|
||||||
|
'/system/lib/lib_fwk_only_rs.so',
|
||||||
|
'/vendor/lib/lib_sp_hal.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# SP-HAL
|
||||||
|
from_paths = {
|
||||||
|
'/vendor/lib/lib_sp_hal.so',
|
||||||
|
'/vendor/lib/lib_sp_hal_dep.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/vendor/lib/lib_sp_hal.so',
|
||||||
|
'/vendor/lib/lib_sp_hal_dep.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
# VND-ONLY
|
||||||
|
from_paths = {
|
||||||
|
'/vendor/lib/lib_vnd_only.so',
|
||||||
|
}
|
||||||
|
visible_paths = {
|
||||||
|
'/system/lib/lib_ll_ndk.so',
|
||||||
|
'/system/lib/lib_sp_ndk.so',
|
||||||
|
'/system/lib/lib_vndk_sp.so',
|
||||||
|
'/system/lib/lib_vndk_sp_indirect.so',
|
||||||
|
'/system/lib/lib_vndk.so',
|
||||||
|
'/vendor/lib/lib_sp_hal.so',
|
||||||
|
'/vendor/lib/lib_sp_hal_dep.so',
|
||||||
|
'/vendor/lib/lib_vnd_only.so',
|
||||||
|
}
|
||||||
|
self._check_path_visibility(d, all_paths, from_paths, visible_paths)
|
||||||
|
|
||||||
|
|
||||||
|
class MockSPLibResult(object):
|
||||||
|
def __init__(self, sp_hal, sp_hal_dep):
|
||||||
|
self.sp_hal = sp_hal
|
||||||
|
self.sp_hal_dep = sp_hal_dep
|
||||||
|
|
||||||
|
|
||||||
|
class MockELFLinkData(object):
|
||||||
|
def __init__(self, path):
|
||||||
|
self.path = path
|
||||||
|
|
||||||
|
|
||||||
|
class MockELFGraph(object):
|
||||||
|
def __init__(self):
|
||||||
|
self.lib_pt = [dict() for i in range(NUM_PARTITIONS)]
|
||||||
|
|
||||||
|
def add(self, path):
|
||||||
|
partition = PT_VENDOR if path.startswith('/vendor') else PT_SYSTEM
|
||||||
|
lib = MockELFLinkData(path)
|
||||||
|
self.lib_pt[partition][path] = lib
|
||||||
|
return lib
|
||||||
|
|
||||||
|
def compute_sp_lib(self, generic_refs=None):
|
||||||
|
vendor_libs = self.lib_pt[PT_VENDOR].values()
|
||||||
|
return MockSPLibResult(
|
||||||
|
set(v for v in vendor_libs if 'lib_sp_hal.so' in v.path),
|
||||||
|
set(v for v in vendor_libs if 'lib_sp_hal_dep.so' in v.path))
|
||||||
|
|
||||||
|
|
||||||
|
class TaggedLibDictTest(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.tagged_paths = TaggedPathDict.create_from_csv(StringIO(_TEST_DATA))
|
||||||
|
|
||||||
|
self.graph = MockELFGraph()
|
||||||
|
|
||||||
|
self.lib_ll_ndk = self.graph.add('/system/lib/lib_ll_ndk.so')
|
||||||
|
self.lib_ll_ndk_indirect = \
|
||||||
|
self.graph.add('/system/lib/lib_ll_ndk_indirect.so')
|
||||||
|
|
||||||
|
self.lib_sp_ndk = self.graph.add('/system/lib/lib_sp_ndk.so')
|
||||||
|
self.lib_sp_ndk_indirect = \
|
||||||
|
self.graph.add('/system/lib/lib_sp_ndk_indirect.so')
|
||||||
|
|
||||||
|
self.lib_vndk_sp = self.graph.add('/system/lib/lib_vndk_sp.so')
|
||||||
|
self.lib_vndk_sp_indirect = \
|
||||||
|
self.graph.add('/system/lib/lib_vndk_sp_indirect.so')
|
||||||
|
self.lib_vndk_sp_indirect_private = \
|
||||||
|
self.graph.add('/system/lib/lib_vndk_sp_indirect_private.so')
|
||||||
|
|
||||||
|
self.lib_vndk = self.graph.add('/system/lib/lib_vndk.so')
|
||||||
|
|
||||||
|
self.lib_fwk_only = self.graph.add('/system/lib/lib_fwk_only.so')
|
||||||
|
self.lib_fwk_only_rs = self.graph.add('/system/lib/lib_fwk_only_rs.so')
|
||||||
|
|
||||||
|
self.lib_sp_hal = self.graph.add('/vendor/lib/lib_sp_hal.so')
|
||||||
|
self.lib_sp_hal_dep = self.graph.add('/vendor/lib/lib_sp_hal_dep.so')
|
||||||
|
|
||||||
|
self.lib_vnd_only = self.graph.add('/vendor/lib/lib_vnd_only.so')
|
||||||
|
|
||||||
|
self.tagged_libs = \
|
||||||
|
TaggedLibDict.create_from_graph(self.graph, self.tagged_paths)
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_from_graph(self):
|
||||||
|
self.assertIn(self.lib_ll_ndk, self.tagged_libs.ll_ndk)
|
||||||
|
self.assertIn(self.lib_ll_ndk_indirect,
|
||||||
|
self.tagged_libs.ll_ndk_indirect)
|
||||||
|
self.assertIn(self.lib_sp_ndk, self.tagged_libs.sp_ndk)
|
||||||
|
self.assertIn(self.lib_sp_ndk_indirect,
|
||||||
|
self.tagged_libs.sp_ndk_indirect)
|
||||||
|
|
||||||
|
self.assertIn(self.lib_vndk_sp, self.tagged_libs.vndk_sp)
|
||||||
|
self.assertIn(self.lib_vndk_sp_indirect,
|
||||||
|
self.tagged_libs.vndk_sp_indirect)
|
||||||
|
self.assertIn(self.lib_vndk_sp_indirect_private,
|
||||||
|
self.tagged_libs.vndk_sp_indirect_private)
|
||||||
|
|
||||||
|
self.assertIn(self.lib_vndk, self.tagged_libs.vndk)
|
||||||
|
|
||||||
|
self.assertIn(self.lib_fwk_only, self.tagged_libs.fwk_only)
|
||||||
|
self.assertIn(self.lib_fwk_only_rs, self.tagged_libs.fwk_only_rs)
|
||||||
|
|
||||||
|
self.assertIn(self.lib_sp_hal, self.tagged_libs.sp_hal)
|
||||||
|
self.assertIn(self.lib_sp_hal_dep, self.tagged_libs.sp_hal_dep)
|
||||||
|
self.assertIn(self.lib_vnd_only, self.tagged_libs.vnd_only)
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_path_tag(self):
|
||||||
|
d = self.tagged_libs
|
||||||
|
|
||||||
|
self.assertEqual('ll_ndk', d.get_path_tag(self.lib_ll_ndk))
|
||||||
|
self.assertEqual('ll_ndk_indirect',
|
||||||
|
d.get_path_tag(self.lib_ll_ndk_indirect))
|
||||||
|
self.assertEqual('sp_ndk', d.get_path_tag(self.lib_sp_ndk))
|
||||||
|
self.assertEqual('sp_ndk_indirect',
|
||||||
|
d.get_path_tag(self.lib_sp_ndk_indirect))
|
||||||
|
self.assertEqual('vndk_sp', d.get_path_tag(self.lib_vndk_sp))
|
||||||
|
self.assertEqual('vndk_sp_indirect',
|
||||||
|
d.get_path_tag(self.lib_vndk_sp_indirect))
|
||||||
|
self.assertEqual('vndk_sp_indirect_private',
|
||||||
|
d.get_path_tag(self.lib_vndk_sp_indirect_private))
|
||||||
|
self.assertEqual('vndk', d.get_path_tag(self.lib_vndk))
|
||||||
|
self.assertEqual('fwk_only', d.get_path_tag(self.lib_fwk_only))
|
||||||
|
self.assertEqual('fwk_only_rs', d.get_path_tag(self.lib_fwk_only_rs))
|
||||||
|
self.assertEqual('sp_hal', d.get_path_tag(self.lib_sp_hal))
|
||||||
|
self.assertEqual('sp_hal_dep', d.get_path_tag(self.lib_sp_hal_dep))
|
||||||
|
self.assertEqual('vnd_only', d.get_path_tag(self.lib_vnd_only))
|
||||||
|
|
||||||
|
# Unmatched paths
|
||||||
|
tag = d.get_path_tag(MockELFLinkData('/system/lib/unknown.so'))
|
||||||
|
self.assertEqual('fwk_only', tag)
|
||||||
|
tag = d.get_path_tag(MockELFLinkData('/data/lib/unknown.so'))
|
||||||
|
self.assertEqual('fwk_only', tag)
|
||||||
|
tag = d.get_path_tag(MockELFLinkData('/vendor/lib/unknown.so'))
|
||||||
|
self.assertEqual('vnd_only', tag)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from compat import StringIO
|
|
||||||
from vndk_definition_tool import (ELF, ELFLinker, PT_SYSTEM, PT_VENDOR,
|
|
||||||
GenericRefs, SPLibResult)
|
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
TESTDATA_DIR = os.path.join(SCRIPT_DIR ,'testdata', 'test_vndk')
|
|
||||||
|
|
||||||
class MockBannedLibs(object):
|
|
||||||
def is_banned(self, name):
|
|
||||||
return False
|
|
||||||
|
|
||||||
class ELFLinkerVNDKTest(unittest.TestCase):
|
|
||||||
def _get_paths_from_nodes(self, nodes):
|
|
||||||
return sorted([node.path for node in nodes])
|
|
||||||
|
|
||||||
def _create_graph_gr(self, input_dir, generic_refs_dir):
|
|
||||||
if not generic_refs_dir:
|
|
||||||
generic_refs = None
|
|
||||||
else:
|
|
||||||
generic_refs_dir = os.path.join(TESTDATA_DIR, generic_refs_dir)
|
|
||||||
generic_refs = GenericRefs.create_from_sym_dir(generic_refs_dir)
|
|
||||||
|
|
||||||
input_dir = os.path.join(TESTDATA_DIR, input_dir)
|
|
||||||
|
|
||||||
graph = ELFLinker.create_from_dump(
|
|
||||||
system_dirs=[os.path.join(input_dir, 'system')],
|
|
||||||
vendor_dirs=[os.path.join(input_dir, 'vendor')],
|
|
||||||
generic_refs=generic_refs)
|
|
||||||
|
|
||||||
return (graph, generic_refs)
|
|
||||||
|
|
||||||
def _create_graph_vndk(self, input_dir, generic_refs_dir):
|
|
||||||
graph, generic_refs = self._create_graph_gr(input_dir, generic_refs_dir)
|
|
||||||
|
|
||||||
vndk = graph._compute_vndk(
|
|
||||||
sp_lib=SPLibResult(set(), set(), set(), set(), set(), set()),
|
|
||||||
vndk_customized_for_system=set(),
|
|
||||||
vndk_customized_for_vendor=set(),
|
|
||||||
generic_refs=generic_refs,
|
|
||||||
banned_libs=MockBannedLibs())
|
|
||||||
|
|
||||||
return (graph, vndk)
|
|
||||||
|
|
||||||
def test_compute_vndk(self):
|
|
||||||
graph, vndk = self._create_graph_vndk('pre_treble', None)
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_vnd_ext))
|
|
||||||
|
|
||||||
def test_compute_vndk_indirect_no_gr(self):
|
|
||||||
graph, vndk = self._create_graph_vndk('vndk_indirect', None)
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
self.assertEqual(['/system/lib/vndk/libcutils_dep.so',
|
|
||||||
'/system/lib64/vndk/libcutils_dep.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_indirect))
|
|
||||||
|
|
||||||
def test_compute_vndk_fwk_ext(self):
|
|
||||||
graph, vndk = self._create_graph_vndk('vndk_fwk_ext', 'vndk_gr')
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libRS.so',
|
|
||||||
'/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libRS.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
self.assertEqual(['/system/lib/vndk-ext/libRS.so',
|
|
||||||
'/system/lib64/vndk-ext/libRS.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_vnd_ext))
|
|
||||||
|
|
||||||
def test_compute_vndk_vnd_ext(self):
|
|
||||||
graph, vndk = self._create_graph_vndk('vndk_vnd_ext', 'vndk_gr')
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libRS.so',
|
|
||||||
'/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libRS.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
self.assertEqual(['/vendor/lib/vndk-ext/libRS.so',
|
|
||||||
'/vendor/lib64/vndk-ext/libRS.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_vnd_ext))
|
|
||||||
|
|
||||||
def test_compute_vndk_inward_customization(self):
|
|
||||||
graph, generic_refs = self._create_graph_gr(
|
|
||||||
'vndk_inward_customization', 'vndk_gr')
|
|
||||||
|
|
||||||
# Make sure libjpeg.so was loaded from the input dir.
|
|
||||||
libjpeg_32 = graph.get_lib('/system/lib/libjpeg.so')
|
|
||||||
self.assertIsNotNone(libjpeg_32)
|
|
||||||
libjpeg_64 = graph.get_lib('/system/lib64/libjpeg.so')
|
|
||||||
self.assertIsNotNone(libjpeg_64)
|
|
||||||
|
|
||||||
# Compute vndk sets and move libraries to the correct directories.
|
|
||||||
vndk = graph._compute_vndk(
|
|
||||||
sp_lib=SPLibResult(set(), set(), set(), set(), set(), set()),
|
|
||||||
vndk_customized_for_system=set(),
|
|
||||||
vndk_customized_for_vendor=set(),
|
|
||||||
generic_refs=generic_refs,
|
|
||||||
banned_libs=MockBannedLibs())
|
|
||||||
|
|
||||||
# Check vndk-core libraries.
|
|
||||||
self.assertEqual(['/system/lib/vndk/libRS.so',
|
|
||||||
'/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libRS.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
|
|
||||||
# Check vndk-indirect libraries.
|
|
||||||
self.assertEqual(['/system/lib/vndk/libjpeg.so',
|
|
||||||
'/system/lib64/vndk/libjpeg.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_indirect))
|
|
||||||
|
|
||||||
# Check libjpeg.so (inward-customization) has been renamed.
|
|
||||||
self.assertIsNone(graph.get_lib('/system/lib/libjpeg.so'))
|
|
||||||
self.assertIsNone(graph.get_lib('/system/lib64/libjpeg.so'))
|
|
||||||
self.assertIs(libjpeg_32,
|
|
||||||
graph.get_lib('/system/lib/vndk/libjpeg.so'))
|
|
||||||
self.assertIs(libjpeg_64,
|
|
||||||
graph.get_lib('/system/lib64/vndk/libjpeg.so'))
|
|
||||||
|
|
||||||
# Check the absence of vndk-ext libraries.
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
self.assertEqual([], self._get_paths_from_nodes(vndk.vndk_vnd_ext))
|
|
||||||
|
|
||||||
def test_compute_vndk_indirect_ext(self):
|
|
||||||
# This test case reveals a corner case that will break vndk-indirect
|
|
||||||
# computation. To reproduce the case, the following condition must be
|
|
||||||
# satisfied:
|
|
||||||
#
|
|
||||||
# 1. libA depends on libB.
|
|
||||||
# 2. libA is a vndk-fwk-ext.
|
|
||||||
# 3. libB is an outward-customized vndk which depends on non-AOSP libC.
|
|
||||||
#
|
|
||||||
# Both AOSP libA and libB will be added to vndk-core. But,
|
|
||||||
# unfortunately, libA will be resolved to libB in vndk-fwk-ext and this
|
|
||||||
# will break the vndk-indirect computation because libC is not in
|
|
||||||
# generic references.
|
|
||||||
|
|
||||||
graph, vndk = self._create_graph_vndk('vndk_indirect_ext',
|
|
||||||
'vndk_indirect_ext_gr')
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libRS.so',
|
|
||||||
'/system/lib/vndk/libcutils.so',
|
|
||||||
'/system/lib64/vndk/libRS.so',
|
|
||||||
'/system/lib64/vndk/libcutils.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libRS_internal.so',
|
|
||||||
'/system/lib64/vndk/libRS_internal.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_indirect))
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk-ext/libRS_internal.so',
|
|
||||||
'/system/lib64/vndk-ext/libRS_internal.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
|
|
||||||
def test_compute_vndk_ext_deps(self):
|
|
||||||
# This test case reveals a bug in the vndk-core dependencies assertion.
|
|
||||||
# This will happen when libA and libB are added to both vndk-fwk-ext and
|
|
||||||
# vndk-vnd-ext in the first round, libA depends libC, libC depends
|
|
||||||
# libB.
|
|
||||||
|
|
||||||
graph, vndk = self._create_graph_vndk('vndk_ext_dep', 'vndk_ext_dep_gr')
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk/libA.so',
|
|
||||||
'/system/lib/vndk/libB.so',
|
|
||||||
'/system/lib/vndk/libC.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_core))
|
|
||||||
|
|
||||||
self.assertEqual(['/system/lib/vndk-ext/libA.so',
|
|
||||||
'/system/lib/vndk-ext/libB.so',
|
|
||||||
'/system/lib/vndk-ext/libC.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_fwk_ext))
|
|
||||||
|
|
||||||
self.assertEqual(['/vendor/lib/vndk-ext/libA.so',
|
|
||||||
'/vendor/lib/vndk-ext/libB.so',
|
|
||||||
'/vendor/lib/vndk-ext/libC.so'],
|
|
||||||
self._get_paths_from_nodes(vndk.vndk_vnd_ext))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user