Exempt ApexTest.testApexType for GSI
ApexTest.testApexType tests if there are inconsistent APEXes. For
example, for updatable devices, there shouldn't be flattened APEXes, and
likewise for non-updatable devices, there shouldn't be non-flattened
APEXes.
However, GSI exceptionally includes both types of APEXes to support installing
it on updatable/non-updatable devices.
So, this test is exempted for GSI.
Change-Id: Ibed982f1085d1ac227451ea987eff15762975242
But: 137802149
Test: atest CtsApexTestCases
diff --git a/hostsidetests/apex/src/android/apex/cts/ApexTest.java b/hostsidetests/apex/src/android/apex/cts/ApexTest.java
index 9222dbb..0347299 100644
--- a/hostsidetests/apex/src/android/apex/cts/ApexTest.java
+++ b/hostsidetests/apex/src/android/apex/cts/ApexTest.java
@@ -32,13 +32,27 @@
return Boolean.parseBoolean(getDevice().getProperty("ro.apex.updatable"));
}
+ private boolean isGSI() throws Exception {
+ String systemProduct = getDevice().getProperty("ro.product.system.name");
+ return systemProduct.equals("aosp_arm")
+ || systemProduct.equals("aosp_arm64")
+ || systemProduct.equals("aosp_x86")
+ || systemProduct.equals("aosp_x86_64");
+ }
+
/**
* Ensures that the built-in APEXes are all with flattened APEXes
* or non-flattend APEXes. Mixture of them is not supported and thus
* not allowed.
+ *
+ * GSI is exempt from this test since it exceptionally includes both types os APEXes.
*/
@Test
public void testApexType() throws Exception {
+ if (isGSI()) {
+ return;
+ }
+
String[] builtinDirs = {
"/system/apex",
"/system_ext/apex",