diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-02-10 19:01:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-02-10 19:01:19 +0000 |
commit | 132768084e24119c337e56fd110b97a23e5593c2 (patch) | |
tree | 8aa0ee9551134cd88bc89ebdbc40e0f398f50971 /tests | |
parent | e86a8d605b3df0c396e23ee02933c76d7040a73b (diff) | |
parent | 7d429d3c480166e1013bcdf68f4be479209aa509 (diff) | |
download | android_bionic-132768084e24119c337e56fd110b97a23e5593c2.tar.gz android_bionic-132768084e24119c337e56fd110b97a23e5593c2.tar.bz2 android_bionic-132768084e24119c337e56fd110b97a23e5593c2.zip |
Merge "Replace public library list with shared lib sonames (part 1/2)"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dlext_test.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp index e629e417c..fdb73655d 100644 --- a/tests/dlext_test.cpp +++ b/tests/dlext_test.cpp @@ -621,12 +621,6 @@ TEST(dlext, ns_smoke) { static const char* root_lib = "libnstest_root.so"; std::string path = std::string("libc.so:libc++.so:libdl.so:libm.so:") + g_public_lib; - ASSERT_FALSE(android_init_namespaces(path.c_str(), nullptr)); - ASSERT_STREQ("android_init_namespaces failed: error initializing public namespace: " - "a library with soname \"libnstest_public.so\" was not found in the " - "default namespace", - dlerror()); - ASSERT_FALSE(android_init_namespaces("", nullptr)); ASSERT_STREQ("android_init_namespaces failed: error initializing public namespace: " "the list of public libraries is empty.", dlerror()); @@ -637,12 +631,15 @@ TEST(dlext, ns_smoke) { ASSERT_TRUE(android_init_namespaces(path.c_str(), nullptr)) << dlerror(); - // Check that libraries added to public namespace are NODELETE + // Check that libraries added to public namespace are not NODELETE dlclose(handle_public); - handle_public = dlopen((get_testlib_root() + "/public_namespace_libs/" + g_public_lib).c_str(), - RTLD_NOW | RTLD_NOLOAD); + handle_public = dlopen(lib_public_path.c_str(), RTLD_NOW | RTLD_NOLOAD); - ASSERT_TRUE(handle_public != nullptr) << dlerror(); + ASSERT_TRUE(handle_public == nullptr); + ASSERT_EQ(std::string("dlopen failed: library \"") + lib_public_path + + "\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror()); + + handle_public = dlopen(lib_public_path.c_str(), RTLD_NOW); android_namespace_t* ns1 = android_create_namespace("private", nullptr, |