Rename test class to match code.
Renaming DexLoggerIntegrationTests to
DynamicCodeLoggerIntegrationTests, to match the rename and changed
scope of the code it is testing.
Test: atest -p services/core/java/com/android/server/pm/dex
Bug: 122946463
Change-Id: I66abd6b173f148279085dee7a714aa64df7a941b
diff --git a/services/core/java/com/android/server/pm/dex/TEST_MAPPING b/services/core/java/com/android/server/pm/dex/TEST_MAPPING
index c93af2a..1c86c4f 100644
--- a/services/core/java/com/android/server/pm/dex/TEST_MAPPING
+++ b/services/core/java/com/android/server/pm/dex/TEST_MAPPING
@@ -9,7 +9,7 @@
]
},
{
- "name": "DexLoggerIntegrationTests"
+ "name": "DynamicCodeLoggerIntegrationTests"
}
]
}
diff --git a/tests/DexLoggerIntegrationTests/Android.mk b/tests/DynamicCodeLoggerIntegrationTests/Android.mk
similarity index 77%
rename from tests/DexLoggerIntegrationTests/Android.mk
rename to tests/DynamicCodeLoggerIntegrationTests/Android.mk
index ee02a72..f324eb1 100644
--- a/tests/DexLoggerIntegrationTests/Android.mk
+++ b/tests/DynamicCodeLoggerIntegrationTests/Android.mk
@@ -21,12 +21,12 @@
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := DexLoggerTestLibrary
+LOCAL_MODULE := DynamicCodeLoggerTestLibrary
LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/dcl)
include $(BUILD_JAVA_LIBRARY)
-dexloggertest_jar := $(LOCAL_BUILT_MODULE)
+dynamiccodeloggertest_jar := $(LOCAL_BUILT_MODULE)
# Also build a native library that the test app can dynamically load
@@ -34,7 +34,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := DexLoggerNativeTestLibrary
+LOCAL_MODULE := DynamicCodeLoggerNativeTestLibrary
LOCAL_SRC_FILES := src/cpp/com_android_dcl_Jni.cpp
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
@@ -48,19 +48,19 @@
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := DexLoggerNativeExecutable
+LOCAL_MODULE := DynamicCodeLoggerNativeExecutable
LOCAL_SRC_FILES := src/cpp/test_executable.cpp
include $(BUILD_EXECUTABLE)
-dexloggertest_executable := $(LOCAL_BUILT_MODULE)
+dynamiccodeloggertest_executable := $(LOCAL_BUILT_MODULE)
# Build the test app itself
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
-LOCAL_PACKAGE_NAME := DexLoggerIntegrationTests
+LOCAL_PACKAGE_NAME := DynamicCodeLoggerIntegrationTests
LOCAL_SDK_VERSION := current
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := shared
@@ -73,12 +73,12 @@
# Include both versions of the .so if we have 2 arch
LOCAL_MULTILIB := both
LOCAL_JNI_SHARED_LIBRARIES := \
- DexLoggerNativeTestLibrary \
+ DynamicCodeLoggerNativeTestLibrary \
-# This gets us the javalib.jar built by DexLoggerTestLibrary above as well as the various
+# This gets us the javalib.jar built by DynamicCodeLoggerTestLibrary above as well as the various
# native binaries.
LOCAL_JAVA_RESOURCE_FILES := \
- $(dexloggertest_jar) \
- $(dexloggertest_executable) \
+ $(dynamiccodeloggertest_jar) \
+ $(dynamiccodeloggertest_executable) \
include $(BUILD_PACKAGE)
diff --git a/tests/DexLoggerIntegrationTests/AndroidManifest.xml b/tests/DynamicCodeLoggerIntegrationTests/AndroidManifest.xml
similarity index 84%
rename from tests/DexLoggerIntegrationTests/AndroidManifest.xml
rename to tests/DynamicCodeLoggerIntegrationTests/AndroidManifest.xml
index a9f01ed..4327da2 100644
--- a/tests/DexLoggerIntegrationTests/AndroidManifest.xml
+++ b/tests/DynamicCodeLoggerIntegrationTests/AndroidManifest.xml
@@ -15,7 +15,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.frameworks.dexloggertest">
+ package="com.android.frameworks.dynamiccodeloggertest">
<!-- Tests feature introduced in P (28) -->
<uses-sdk
@@ -30,6 +30,6 @@
<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
- android:targetPackage="com.android.frameworks.dexloggertest"
- android:label="Integration test for DexLogger" />
+ android:targetPackage="com.android.frameworks.dynamiccodeloggertest"
+ android:label="Integration test for DynamicCodeLogger" />
</manifest>
diff --git a/tests/DexLoggerIntegrationTests/AndroidTest.xml b/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
similarity index 78%
rename from tests/DexLoggerIntegrationTests/AndroidTest.xml
rename to tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
index fb1bef6..f70b9c8 100644
--- a/tests/DexLoggerIntegrationTests/AndroidTest.xml
+++ b/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
@@ -13,17 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<configuration description="Runs DexLogger Integration Tests">
+<configuration description="Runs DynamicLogger Integration Tests">
<target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
- <option name="test-file-name" value="DexLoggerIntegrationTests.apk"/>
+ <option name="test-file-name" value="DynamicCodeLoggerIntegrationTests.apk"/>
<option name="cleanup-apks" value="true"/>
</target_preparer>
<option name="test-suite-tag" value="apct"/>
- <option name="test-tag" value="DexLoggerIntegrationTests"/>
+ <option name="test-tag" value="DynamicCodeLoggerIntegrationTests"/>
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
- <option name="package" value="com.android.frameworks.dexloggertest"/>
+ <option name="package" value="com.android.frameworks.dynamiccodeloggertest"/>
<option name="runner" value="android.support.test.runner.AndroidJUnitRunner"/>
<option name="hidden-api-checks" value="false"/>
</test>
diff --git a/tests/DexLoggerIntegrationTests/src/com/android/dcl/Simple.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java
similarity index 100%
rename from tests/DexLoggerIntegrationTests/src/com/android/dcl/Simple.java
rename to tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java
diff --git a/tests/DexLoggerIntegrationTests/src/com/android/server/pm/dex/DexLoggerIntegrationTests.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
similarity index 96%
rename from tests/DexLoggerIntegrationTests/src/com/android/server/pm/dex/DexLoggerIntegrationTests.java
rename to tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
index 99d1f5ff4..8ef15d8 100644
--- a/tests/DexLoggerIntegrationTests/src/com/android/server/pm/dex/DexLoggerIntegrationTests.java
+++ b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
@@ -49,7 +49,7 @@
import java.util.concurrent.TimeUnit;
/**
- * Integration tests for {@link DynamicCodeLogger}, formerly known as {@code DexLogger}.
+ * Integration tests for {@link DynamicCodeLogger}.
*
* The setup for the test dynamically loads code in a jar extracted
* from our assets (a secondary dex file).
@@ -59,11 +59,11 @@
* file's name and content. We verify that this message appears in
* the event log.
*
- * Run with "atest DexLoggerIntegrationTests".
+ * Run with "atest DynamicCodeLoggerIntegrationTests".
*/
@LargeTest
@RunWith(JUnit4.class)
-public final class DexLoggerIntegrationTests {
+public final class DynamicCodeLoggerIntegrationTests {
private static final String SHA_256 = "SHA-256";
@@ -162,7 +162,7 @@
File privateCopyFile = privateFile(privateCopyName);
mExpectedNameHash = hashOf(privateCopyName);
mExpectedContentHash = copyAndHashResource(
- libraryPath("DexLoggerNativeTestLibrary.so"), privateCopyFile);
+ libraryPath("DynamicCodeLoggerNativeTestLibrary.so"), privateCopyFile);
System.load(privateCopyFile.toString());
}
@@ -180,7 +180,7 @@
File privateCopyFile = privateFile(privateCopyName);
mExpectedNameHash = hashOf(privateCopyName);
mExpectedContentHash = copyAndHashResource(
- libraryPath("DexLoggerNativeTestLibrary.so"), privateCopyFile);
+ libraryPath("DynamicCodeLoggerNativeTestLibrary.so"), privateCopyFile);
System.load(privateCopyFile.toString());
}
@@ -196,7 +196,7 @@
File privateCopyFile = privateFile(privateCopyName);
mExpectedNameHash = hashOf(privateCopyName);
mExpectedContentHash = copyAndHashResource(
- "/DexLoggerNativeExecutable", privateCopyFile);
+ "/DynamicCodeLoggerNativeExecutable", privateCopyFile);
assertThat(privateCopyFile.setExecutable(true)).isTrue();
Process process = Runtime.getRuntime().exec(privateCopyFile.toString());
@@ -211,7 +211,7 @@
File privateCopyFile = privateFile("spoofed");
String expectedContentHash = copyAndHashResource(
- "/DexLoggerNativeExecutable", privateCopyFile);
+ "/DynamicCodeLoggerNativeExecutable", privateCopyFile);
EventLog.writeEvent(EventLog.getTagCode("auditd"),
"type=1400 avc: granted { execute_no_trans } "
@@ -275,7 +275,7 @@
public void testGeneratesEvents_spoofed_otherAppFile() throws Exception {
File ourPath = sContext.getDatabasePath("android_pay");
File targetPath = new File(ourPath.toString()
- .replace("com.android.frameworks.dexloggertest", "com.google.android.gms"));
+ .replace("com.android.frameworks.dynamiccodeloggertest", "com.google.android.gms"));
assertWithMessage("Expected " + targetPath + " to not be readable")
.that(targetPath.canRead()).isFalse();
@@ -348,7 +348,7 @@
MessageDigest hasher = MessageDigest.getInstance(SHA_256);
// Copy the jar from our Java resources to a private data directory
- Class<?> thisClass = DexLoggerIntegrationTests.class;
+ Class<?> thisClass = DynamicCodeLoggerIntegrationTests.class;
try (InputStream input = thisClass.getResourceAsStream(resourcePath);
OutputStream output = new FileOutputStream(copyTo)) {
byte[] buffer = new byte[1024];
diff --git a/tests/DexLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp b/tests/DynamicCodeLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp
similarity index 100%
rename from tests/DexLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp
rename to tests/DynamicCodeLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp
diff --git a/tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp b/tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp
similarity index 100%
rename from tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp
rename to tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp