Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 116b91c2 authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Exclude all directories instead of only known ones

The previous known directories seem to be removed in some case and
breaks the test.  Since the intention is to exclude directories and
compare existing files, exclude all directories instead.

Test: atest ApkVerityTest
Bug: 149469433
Change-Id: Ib096062b5647920b90f7d9d5638226392a2df174
parent e98ae477
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);