summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-02-13 20:14:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-02-13 20:14:55 +0000
commit651cb0c6747fe193b96448d532157cfca329f45d (patch)
tree1302c377ab8ecb771018590323cf702569c182a5
parent7de784c1eba9f0c9679b72368bf997080a24fd1c (diff)
parent116b91c2c113a7c1d1e8a4e52d61eb5fc96963cf (diff)
Merge "Exclude all directories instead of only known ones"
-rw-r--r--tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java b/tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java
index 20d0e9690e8e..ae20cae36839 100644
--- a/tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java
+++ b/tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java
@@ -430,10 +430,9 @@ public class ApkVerityTest extends BaseHostJUnit4Test {
private void verifyInstalledFiles(String... filenames) throws DeviceNotAvailableException {
String apkPath = getApkPath(TARGET_PACKAGE);
String appDir = apkPath.substring(0, apkPath.lastIndexOf("/"));
+ // Exclude directories since we only care about files.
HashSet<String> actualFiles = new HashSet<>(Arrays.asList(
- expectRemoteCommandToSucceed("ls " + appDir).split("\n")));
- assertTrue(actualFiles.remove("lib"));
- assertTrue(actualFiles.remove("oat"));
+ expectRemoteCommandToSucceed("ls -p " + appDir + " | grep -v '/'").split("\n")));
HashSet<String> expectedFiles = new HashSet<>(Arrays.asList(filenames));
assertEquals(expectedFiles, actualFiles);