CoredumpCleanupRule { public static DiskCleanupRule forContainer(Path containerCrashPath) { return new ContainerCoredumpCleanupRule(containerCrashPath); }  static DiskCleanupRule forContainer(Path containerCrashPath); static DiskCleanupRule forHost(Path processedCoredumpsPath);  }
@Test public void for_container_test() throws IOException { Path path = fileSystem.getPath("/test/path"); DiskCleanupRule rule = CoredumpCleanupRule.forContainer(path); assertPriorities(rule, Map.of()); createFile(path.resolve("core1"), Instant.ofEpochSecond(232)); assertPriorities(rule, Map.of("/test/path/core1", Priority.MEDIUM)); createFile(path.resolve("core2"), Instant.ofEpochSecond(123)); assertPriorities(rule, Map.of( "/test/path/core2", Priority.MEDIUM, "/test/path/core1", Priority.HIGHEST)); createFile(path.resolve("vespa-proton-bin.core.325"), Instant.ofEpochSecond(456)); createFile(path.resolve("vespa-distributor.core.764"), Instant.ofEpochSecond(256)); var expected = Map.of( "/test/path/core2", Priority.HIGHEST, "/test/path/core1", Priority.HIGHEST, "/test/path/vespa-proton-bin.core.325", Priority.HIGHEST, "/test/path/vespa-distributor.core.764", Priority.MEDIUM); assertPriorities(rule, expected); Files.createDirectories(path.resolve("processing/abcd-1234")); createFile(path.resolve("processing/abcd-1234/core5"), Instant.ofEpochSecond(67)); assertPriorities(rule, expected); }