Make storage and StrictMode tests more robust.
Many of the AppSecurity tests verify cross-user interactions by
creating and starting temporary users on multi-user devices. Since
user creation adds significant overhead, this change creates a
secondary and tertiary user only once for the entire module, which
individual tests can then efficiently reuse.
Quietly skip testFullDisk() when we're unable to free up more than
90% of disk space, since that's a prerequisite for that test.
Rewrite StrictModeTest to use explicit listener for observing
violations, since reading back raw logcat data recently became
very flaky.
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.ExternalStorageHostTest
Bug: 38234598, 37486230, 37915178, 62018992
Change-Id: I97182aaa8c82cdc0a1169d5b4adac053c84a1b11
diff --git a/hostsidetests/appsecurity/AndroidTest.xml b/hostsidetests/appsecurity/AndroidTest.xml
index d1989e6..418d363 100644
--- a/hostsidetests/appsecurity/AndroidTest.xml
+++ b/hostsidetests/appsecurity/AndroidTest.xml
@@ -14,6 +14,7 @@
limitations under the License.
-->
<configuration description="Config for the CTS App Security host tests">
+ <target_preparer class="android.appsecurity.cts.AppSecurityPreparer" />
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
<option name="jar" value="CtsAppSecurityHostTestCases.jar" />
<option name="runtime-hint" value="20m" />