summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author JW Wang <wangchun@google.com> 2022-08-08 17:01:38 +0800
committer Chun-Wei Wang <wangchun@google.com> 2022-08-12 08:20:57 +0000
commit9280a391672b4eeea25d5bd99f68ba9da63f178a (patch)
tree9acc8b486bca6836ccf63883497f7ac3add7ff0a
parentcc505f41771b052871ce88d3de51dd69b6c016bb (diff)
Fix remounting /vendor
remountVendorWritable() should be called when remounting /vendor Bug: 242272856 Test: atest StagedInstallInternalTest Change-Id: Id699892ae935b2214f7f9bf3c2cc87c3d8ef6690
-rw-r--r--tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
index c4cb33da4a6d..44265511ee50 100644
--- a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
+++ b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
@@ -123,16 +123,27 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
}
boolean found = false;
+ boolean remountSystem = false;
+ boolean remountVendor = false;
for (String file : files) {
CommandResult result = getDevice().executeShellV2Command("ls " + file);
if (result.getStatus() == CommandStatus.SUCCESS) {
found = true;
- break;
+ if (file.startsWith("/system")) {
+ remountSystem = true;
+ } else if (file.startsWith("/vendor")) {
+ remountVendor = true;
+ }
}
}
if (found) {
- getDevice().remountSystemWritable();
+ if (remountSystem) {
+ getDevice().remountSystemWritable();
+ }
+ if (remountVendor) {
+ getDevice().remountVendorWritable();
+ }
for (String file : files) {
getDevice().executeShellCommand("rm -rf " + file);
}
@@ -150,7 +161,11 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
if (!getDevice().isAdbRoot()) {
getDevice().enableAdbRoot();
}
- getDevice().remountSystemWritable();
+ if ("system".equals(partition)) {
+ getDevice().remountSystemWritable();
+ } else if ("vendor".equals(partition)) {
+ getDevice().remountVendorWritable();
+ }
assertTrue(getDevice().pushFile(apex, "/" + partition + "/apex/" + fileName));
}
@@ -158,7 +173,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
if (!getDevice().isAdbRoot()) {
getDevice().enableAdbRoot();
}
- getDevice().remountSystemWritable();
+ getDevice().remountVendorWritable();
File file = File.createTempFile("test-vendor-apex-allow-list", ".xml");
try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
final String fmt =