diff options
author | Alan Stokes <alanstokes@google.com> | 2019-02-19 17:14:42 +0000 |
---|---|---|
committer | Alan Stokes <alanstokes@google.com> | 2019-02-20 12:30:44 +0000 |
commit | 8d3b7a4d45992c7af409c0dbcfc1d29ece1ce44e (patch) | |
tree | fa7b004978a4951fdc79eb14a4c394241456853d | |
parent | 13d637a0230ad7d34a3287df2fa5657395d79216 (diff) |
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
-rw-r--r-- | services/core/java/com/android/server/pm/dex/TEST_MAPPING | 2 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/Android.mk (renamed from tests/DexLoggerIntegrationTests/Android.mk) | 20 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/AndroidManifest.xml (renamed from tests/DexLoggerIntegrationTests/AndroidManifest.xml) | 6 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml (renamed from tests/DexLoggerIntegrationTests/AndroidTest.xml) | 8 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java (renamed from tests/DexLoggerIntegrationTests/src/com/android/dcl/Simple.java) | 0 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java (renamed from tests/DexLoggerIntegrationTests/src/com/android/server/pm/dex/DexLoggerIntegrationTests.java) | 18 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp (renamed from tests/DexLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp) | 0 | ||||
-rw-r--r-- | tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp (renamed from tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp) | 0 |
8 files changed, 27 insertions, 27 deletions
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 c93af2a5ba41..1c86c4f72ff9 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 index ee02a72b6819..f324eb10a7b0 100644 --- a/tests/DexLoggerIntegrationTests/Android.mk +++ b/tests/DynamicCodeLoggerIntegrationTests/Android.mk @@ -21,12 +21,12 @@ LOCAL_PATH:= $(call my-dir) 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 @@ dexloggertest_jar := $(LOCAL_BUILT_MODULE) 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 $(BUILD_SHARED_LIBRARY) 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 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ # 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 index a9f01edbdc41..4327da2db3dd 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 index fb1bef6da08a..f70b9c8cb357 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 index e995a26ea5c9..e995a26ea5c9 100644 --- a/tests/DexLoggerIntegrationTests/src/com/android/dcl/Simple.java +++ b/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 index 99d1f5ff4bb3..8ef15d869a0b 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.List; 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 @@ import java.util.concurrent.TimeUnit; * 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 @@ public final class DexLoggerIntegrationTests { 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 @@ public final class DexLoggerIntegrationTests { 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 @@ public final class DexLoggerIntegrationTests { 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 @@ public final class DexLoggerIntegrationTests { 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 final class DexLoggerIntegrationTests { 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 @@ public final class DexLoggerIntegrationTests { 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 index 060888310b51..060888310b51 100644 --- a/tests/DexLoggerIntegrationTests/src/cpp/com_android_dcl_Jni.cpp +++ b/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 index ad025e696dec..ad025e696dec 100644 --- a/tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp +++ b/tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp |