commit | 2ffc9278a75ad2ec0ad21f68cdf7247ee63416fc | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Wed Jan 04 10:31:12 2023 +0000 |
committer | David Brazdil <dbrazdil@google.com> | Wed Jan 04 10:44:07 2023 +0000 |
tree | 0fc6d664c061c0a0185e8d2adf71b1193330229e | |
parent | f86e0cb752a87bd47deeedfacc3b70ab66659e4b [diff] |
AuthFsHostTestCases: Also skip beforeClassWithDevice I624b041a31546823290f927812a61a802005a995 skipped the tests on Cuttlefish but this did not address the problem fully. Skip earlier, before the shared VM is created. Bug: 261861853 Test: TH Merged-In: Ided6b9d71d87bc054cffa95b95af407778ef51f0 Change-Id: Ifea13fc5183e94c55d591f6b8dc7be18a0febb95
diff --git a/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java b/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java index 67275c1..b18fbae 100644 --- a/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java +++ b/authfs/tests/java/src/com/android/fs/AuthFsHostTest.java
@@ -125,6 +125,11 @@ ITestDevice androidDevice = testInfo.getDevice(); sAndroid = new CommandRunner(androidDevice); + if (isCuttlefish(androidDevice)) { + sAssumptionFailed = true; + return; + } + try { testIfDeviceIsCapable(androidDevice); } catch (AssumptionViolatedException e) { @@ -173,7 +178,6 @@ @Before public void setUp() throws Exception { assumeFalse(sAssumptionFailed); - assumeFalse(isCuttlefish()); sAndroid.run("mkdir " + TEST_OUTPUT_DIR); }
diff --git a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java index dae4231..8e2d0ee 100644 --- a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java +++ b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
@@ -401,7 +401,11 @@ } protected boolean isCuttlefish() throws Exception { - String productName = getDevice().getProperty("ro.product.name"); + return isCuttlefish(getDevice()); + } + + protected static boolean isCuttlefish(ITestDevice device) throws Exception { + String productName = device.getProperty("ro.product.name"); return (null != productName) && (productName.startsWith("aosp_cf_x86") || productName.startsWith("aosp_cf_arm")