diff options
| author | 2022-11-18 21:46:58 +0000 | |
|---|---|---|
| committer | 2022-11-18 21:46:58 +0000 | |
| commit | 7f11d4232a0f2d6d89c1e042bb99bbfcfd7b99b2 (patch) | |
| tree | 4c8b5f0c8d1cc76326c1f133c7f41d35ec5672fa /libnativeloader/test/src/android | |
| parent | c09e656f28e0787afd404ef03ba92b73d4117434 (diff) | |
Revert "Add tests for loading native libraries in various locations through"
This reverts commit c09e656f28e0787afd404ef03ba92b73d4117434.
Reason for revert: b/259726812
Change-Id: I75091cf421011a888e9f9514b58e0e9328542082
Diffstat (limited to 'libnativeloader/test/src/android')
6 files changed, 1 insertions, 51 deletions
diff --git a/libnativeloader/test/src/android/test/app/DataAppTest.java b/libnativeloader/test/src/android/test/app/DataAppTest.java index 2e60ff0000..922565e9fa 100644 --- a/libnativeloader/test/src/android/test/app/DataAppTest.java +++ b/libnativeloader/test/src/android/test/app/DataAppTest.java @@ -81,16 +81,4 @@ public class DataAppTest { TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); VendorSharedLib.loadLibrary("vendor_private5"); } - - @Test - public void testLoadPrivateLibrariesWithAbsolutePaths() { - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system", "system_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); - } } diff --git a/libnativeloader/test/src/android/test/app/ProductAppTest.java b/libnativeloader/test/src/android/test/app/ProductAppTest.java index 11c34a6b7a..7714e10b1a 100644 --- a/libnativeloader/test/src/android/test/app/ProductAppTest.java +++ b/libnativeloader/test/src/android/test/app/ProductAppTest.java @@ -81,15 +81,4 @@ public class ProductAppTest { TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); VendorSharedLib.loadLibrary("vendor_private5"); } - - @Test - public void testLoadPrivateLibrariesWithAbsolutePaths() { - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system", "system_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); - System.load(TestUtils.libPath("/product", "product_private6")); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); - } } diff --git a/libnativeloader/test/src/android/test/app/SystemAppTest.java b/libnativeloader/test/src/android/test/app/SystemAppTest.java index 12e70fa6b3..7c78e1bfce 100644 --- a/libnativeloader/test/src/android/test/app/SystemAppTest.java +++ b/libnativeloader/test/src/android/test/app/SystemAppTest.java @@ -79,14 +79,4 @@ public class SystemAppTest { TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("vendor_private5")); } - - @Test - public void testLoadPrivateLibrariesWithAbsolutePaths() { - System.load(TestUtils.libPath("/system", "system_private6")); - System.load(TestUtils.libPath("/system_ext", "systemext_private6")); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); - } } diff --git a/libnativeloader/test/src/android/test/app/VendorAppTest.java b/libnativeloader/test/src/android/test/app/VendorAppTest.java index f5f12e89e4..0a392c1f4c 100644 --- a/libnativeloader/test/src/android/test/app/VendorAppTest.java +++ b/libnativeloader/test/src/android/test/app/VendorAppTest.java @@ -80,15 +80,4 @@ public class VendorAppTest { TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); VendorSharedLib.loadLibrary("vendor_private5"); } - - @Test - public void testLoadPrivateLibrariesWithAbsolutePaths() { - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system", "system_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); - System.load(TestUtils.libPath("/vendor", "vendor_private6")); - } } diff --git a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java index eb31e5f936..5ba96cc05c 100644 --- a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java +++ b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java @@ -234,7 +234,7 @@ public class LibnativeloaderTest extends BaseHostJUnit4Test { void pushPrivateLibs(ZipFile libApk) throws Exception { // Push the libraries once for each test. Since we cannot unload them, we need a fresh // never-before-loaded library in each loadLibrary call. - for (int i = 1; i <= 6; ++i) { + for (int i = 1; i <= 5; ++i) { pushNativeTestLib(libApk, "/system/${LIB}/libsystem_private" + i + ".so"); pushNativeTestLib(libApk, "/system_ext/${LIB}/libsystemext_private" + i + ".so"); pushNativeTestLib(libApk, "/product/${LIB}/libproduct_private" + i + ".so"); diff --git a/libnativeloader/test/src/android/test/lib/TestUtils.java b/libnativeloader/test/src/android/test/lib/TestUtils.java index 8486959cf2..eda9993a7f 100644 --- a/libnativeloader/test/src/android/test/lib/TestUtils.java +++ b/libnativeloader/test/src/android/test/lib/TestUtils.java @@ -19,7 +19,6 @@ package android.test.lib; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import dalvik.system.VMRuntime; import org.junit.function.ThrowingRunnable; public final class TestUtils { @@ -33,9 +32,4 @@ public final class TestUtils { assertThat(t.getMessage()) .containsMatch("dlopen failed: .* is not accessible for the namespace"); } - - public static String libPath(String dir, String libName) { - String libDirName = VMRuntime.getRuntime().is64Bit() ? "lib64" : "lib"; - return dir + "/" + libDirName + "/lib" + libName + ".so"; - } } |