summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-08-16 22:52:59 +0000
committerandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-08-16 22:52:59 +0000
commit15f39743f4f7550db39e38acc06ccbd9c82a0ea3 (patch)
treeb1e81aa1f69cf81518759f6d22589e68e26e5421
parent8cd2a17a238adb5f8045ec3b31077a1125912894 (diff)
parent18db382f11af3c80367c3c60a29ee41ddf3cb79b (diff)
downloadplatform_cts-15f39743f4f7550db39e38acc06ccbd9c82a0ea3.tar.gz
platform_cts-15f39743f4f7550db39e38acc06ccbd9c82a0ea3.tar.bz2
platform_cts-15f39743f4f7550db39e38acc06ccbd9c82a0ea3.zip
Snap for 4959036 from 18db382f11af3c80367c3c60a29ee41ddf3cb79b to marshmallow-cts-release
Change-Id: Iae9f0c39ab0fbbf671f7dc1b2ae3e636df9f31c7
-rw-r--r--apps/CtsVerifier/AndroidManifest.xml2
-rw-r--r--hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b71361168.apkbin710089 -> 1891867 bytes
-rw-r--r--hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b79488511.apkbin0 -> 1891846 bytes
-rw-r--r--hostsidetests/appsecurity/src/com/android/cts/appsecurity/CorruptApkTests.java35
-rw-r--r--tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java2
5 files changed, 22 insertions, 17 deletions
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 5e3317e66f2..99f9d2ce549 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,7 +18,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cts.verifier"
android:versionCode="5"
- android:versionName="6.0_r31">
+ android:versionName="6.0_r32">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23"/>
diff --git a/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b71361168.apk b/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b71361168.apk
index ef1e2bf5d79..dc00656dc20 100644
--- a/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b71361168.apk
+++ b/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b71361168.apk
Binary files differ
diff --git a/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b79488511.apk b/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b79488511.apk
new file mode 100644
index 00000000000..22af499980f
--- /dev/null
+++ b/hostsidetests/appsecurity/res/corruptapk/CtsCorruptApkTests_b79488511.apk
Binary files differ
diff --git a/hostsidetests/appsecurity/src/com/android/cts/appsecurity/CorruptApkTests.java b/hostsidetests/appsecurity/src/com/android/cts/appsecurity/CorruptApkTests.java
index 8fc1ff929ca..b334b05a8a2 100644
--- a/hostsidetests/appsecurity/src/com/android/cts/appsecurity/CorruptApkTests.java
+++ b/hostsidetests/appsecurity/src/com/android/cts/appsecurity/CorruptApkTests.java
@@ -39,7 +39,8 @@ import java.io.OutputStream;
*/
public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
private final String B71360999_PKG = "com.android.appsecurity.b71360999";
- private final String B71361168_PKG = "com.example.helloworld";
+ private final String B71361168_PKG = "com.android.appsecurity.b71361168";
+ private final String B79488511_PKG = "com.android.appsecurity.b79488511";
private static final String TEST_APK_RESOURCE_PREFIX = "/corruptapk/";
private IBuildInfo mBuildInfo;
@@ -55,6 +56,7 @@ public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
super.setUp();
uninstall(B71360999_PKG);
uninstall(B71361168_PKG);
+ uninstall(B79488511_PKG);
}
@After
@@ -63,6 +65,7 @@ public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
super.tearDown();
uninstall(B71360999_PKG);
uninstall(B71361168_PKG);
+ uninstall(B79488511_PKG);
}
/** Uninstall the apk if the test failed previously. */
@@ -74,11 +77,11 @@ public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
}
/**
- * Tests that apks described in b/71360999 do not install successfully nor cause
+ * Tests that apks described in b/71360999 do not install successfully.
*/
public void testFailToInstallCorruptStringPoolHeader_b71360999() throws Exception {
final String APK_PATH = "CtsCorruptApkTests_b71360999.apk";
- assertFailsToInstall(APK_PATH, B71360999_PKG);
+ assertInstallNoFatalError(APK_PATH, B71360999_PKG);
}
/**
@@ -86,29 +89,31 @@ public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
*/
public void testFailToInstallCorruptStringPoolHeader_b71361168() throws Exception {
final String APK_PATH = "CtsCorruptApkTests_b71361168.apk";
- assertFailsToInstall(APK_PATH, B71361168_PKG);
+ assertInstallNoFatalError(APK_PATH, B71361168_PKG);
}
/**
- * Assert that the app fails to install and the reason for failing is not caused by a buffer
- * overflow nor a out of bounds read.
+ * Tests that apks described in b/79488511 do not install successfully.
+ */
+ public void testFailToInstallCorruptStringPoolHeader_b79488511() throws Exception {
+ final String APK_PATH = "CtsCorruptApkTests_b79488511.apk";
+ assertInstallNoFatalError(APK_PATH, B79488511_PKG);
+ }
+
+ /**
+ * Assert that installing the app does not cause a native error caused by a buffer overflow
+ * or an out-of-bounds read.
**/
- private void assertFailsToInstall(String filename, String pkg) throws Exception {
+ private void assertInstallNoFatalError(String filename, String pkg) throws Exception {
ITestDevice device = getDevice();
device.clearLogcat();
-
installPackageFromResource(filename);
- assertFalse(device.getInstalledPackageNames().contains(pkg));
-
// This catches if the device fails to install the app because a segmentation fault
// or out of bounds read created by the bug occurs
String logs = device.executeAdbCommand("logcat", "-d");
assertNotNull(logs);
- // Whether we hung or not, check for the log indicating the size is bad
- boolean fixWasHit = logs.contains("Bad string block: malformed block dimensions") ||
- logs.contains("Bad string block: data size");
- assertTrue(fixWasHit);
+
// Also check for the original indicators
assertFalse(logs.contains("SIGSEGV"));
assertFalse(logs.contains("==ERROR"));
@@ -117,7 +122,7 @@ public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
/**
* Attempt to install the package with the given name from resources
**/
- private void installPackageFromResource(String apkFilenameInResources)
+ private void installPackageFromResource(String apkFilenameInResources)
throws Exception {
final ITestDevice device = getDevice();
String fullResourceName = TEST_APK_RESOURCE_PREFIX + apkFilenameInResources;
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
index 19ea96d87bd..95eba3c3b6a 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
@@ -31,7 +31,7 @@ public class CtsBuildProvider implements IBuildProvider {
@Option(name="cts-install-path", description="the path to the cts installation to use")
private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
- public static final String CTS_BUILD_VERSION = "6.0_r31";
+ public static final String CTS_BUILD_VERSION = "6.0_r32";
public static final String CTS_PACKAGE = "com.android.cts.tradefed.testtype";
/**