Revert "Add tests for loading native libraries in various locations through"
This reverts commit c09e656f28e0787afd404ef03ba92b73d4117434.
Reason for revert: b/259726812
Change-Id: I75091cf421011a888e9f9514b58e0e9328542082
diff --git a/libnativeloader/test/src/android/test/app/DataAppTest.java b/libnativeloader/test/src/android/test/app/DataAppTest.java
index 2e60ff0..922565e 100644
--- a/libnativeloader/test/src/android/test/app/DataAppTest.java
+++ b/libnativeloader/test/src/android/test/app/DataAppTest.java
@@ -81,16 +81,4 @@
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 11c34a6..7714e10 100644
--- a/libnativeloader/test/src/android/test/app/ProductAppTest.java
+++ b/libnativeloader/test/src/android/test/app/ProductAppTest.java
@@ -81,15 +81,4 @@
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 12e70fa..7c78e1b 100644
--- a/libnativeloader/test/src/android/test/app/SystemAppTest.java
+++ b/libnativeloader/test/src/android/test/app/SystemAppTest.java
@@ -79,14 +79,4 @@
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 f5f12e8..0a392c1 100644
--- a/libnativeloader/test/src/android/test/app/VendorAppTest.java
+++ b/libnativeloader/test/src/android/test/app/VendorAppTest.java
@@ -80,15 +80,4 @@
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 eb31e5f..5ba96cc 100644
--- a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
+++ b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
@@ -234,7 +234,7 @@
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 8486959..eda9993 100644
--- a/libnativeloader/test/src/android/test/lib/TestUtils.java
+++ b/libnativeloader/test/src/android/test/lib/TestUtils.java
@@ -19,7 +19,6 @@
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 @@
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";
- }
}