blob: cd9d7f1a8e43f5ea3348e23946ec00b7f3390770 [file] [log] [blame]
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -07001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# -----------------------------------------------------------------------------
18# This set of libraries are used to verify linker namespaces.
19# -----------------------------------------------------------------------------
20
21# -----------------------------------------------------------------------------
22# Test cases
23# 1. Check that private libraries loaded in different namespaces are
24# different. Check that dlsym does not confuse them.
25# 2. Check that public libraries loaded in different namespaces are shared
26# between them.
27# 3. Check that namespace sticks on dlopen
Dimitry Ivanov7a34b9d2017-02-03 14:07:34 -080028# 4. Check that having access to shared library (libnstest_public.so)
29# does not expose symbols from dependent library (libnstest_public_internal.so)
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070030#
31# Dependency tree (visibility)
32# libnstest_root.so (this should be local to the namespace)
33# +-> libnstest_public.so
Dimitry Ivanov7a34b9d2017-02-03 14:07:34 -080034# +-> libnstest_public_internal.so
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070035# +-> libnstest_private.so
36#
37# libnstest_dlopened.so (library in private namespace dlopened from libnstest_root.so)
38# -----------------------------------------------------------------------------
39libnstest_root_src_files := namespaces_root.cpp
40libnstest_root_shared_libraries := libnstest_public libnstest_private
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070041libnstest_root_relative_install_path := private_namespace_libs
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070042module := libnstest_root
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070043include $(LOCAL_PATH)/Android.build.testlib.target.mk
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070044
Dimitry Ivanov7a34b9d2017-02-03 14:07:34 -080045libnstest_public_internal_src_files := namespaces_public_internal.cpp
46module := libnstest_public_internal
47libnstest_public_internal_relative_install_path := public_namespace_libs
48include $(LOCAL_PATH)/Android.build.testlib.target.mk
49
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070050libnstest_public_src_files := namespaces_public.cpp
Dimitry Ivanov7a34b9d2017-02-03 14:07:34 -080051libnstest_public_shared_libraries := libnstest_public_internal
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070052module := libnstest_public
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070053libnstest_public_relative_install_path := public_namespace_libs
54include $(LOCAL_PATH)/Android.build.testlib.target.mk
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070055
56libnstest_private_src_files := namespaces_private.cpp
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070057libnstest_private_relative_install_path := private_namespace_libs
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070058module := libnstest_private
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070059include $(LOCAL_PATH)/Android.build.testlib.target.mk
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070060
61libnstest_dlopened_src_files := namespaces_dlopened.cpp
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070062libnstest_dlopened_relative_install_path := private_namespace_libs
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070063module := libnstest_dlopened
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070064include $(LOCAL_PATH)/Android.build.testlib.target.mk
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070065
66# -----------------------------------------------------------------------------
67# This set of libraries is to test isolated namespaces
68#
69# Isolated namespaces do not allow loading of the library outside of
70# the search paths.
71#
72# This library cannot be loaded in isolated namespace because one of DT_NEEDED
73# libraries is outside of the search paths.
74#
75# libnstest_root_not_isolated.so (DT_RUNPATH = $ORIGIN/../private_namespace_libs_external/)
76# +-> libnstest_public.so
77# +-> libnstest_private_external.so (located in $ORIGIN/../private_namespace_libs_external/)
78#
79# Search path: $NATIVE_TESTS/private_namespace_libs/
80# -----------------------------------------------------------------------------
81libnstest_root_not_isolated_src_files := namespaces_root.cpp
82libnstest_root_not_isolated_shared_libraries := libnstest_public libnstest_private_external
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070083libnstest_root_not_isolated_relative_install_path := private_namespace_libs
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070084libnstest_root_not_isolated_ldflags := -Wl,--rpath,\$$ORIGIN/../private_namespace_libs_external \
85 -Wl,--enable-new-dtags
86
87module := libnstest_root_not_isolated
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070088include $(LOCAL_PATH)/Android.build.testlib.target.mk
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070089
90libnstest_private_external_src_files := namespaces_private.cpp
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070091libnstest_private_external_relative_install_path := private_namespace_libs_external
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070092module := libnstest_private_external
Dimitry Ivanova36e59b2016-09-01 11:37:39 -070093include $(LOCAL_PATH)/Android.build.testlib.target.mk