Skip to content

Commit 56a489d

Browse files
committed
Ensure that plugins that utilize dumpCoverage can write to jacoco.dir when tests.security.manager is enabled
Signed-off-by: Craig Perkins <[email protected]>
1 parent be8bbe1 commit 56a489d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/framework/src/main/java/org/opensearch/bootstrap/BootstrapForTesting.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ public class BootstrapForTesting {
148148
Security.addClasspathPermissions(perms);
149149
// java.io.tmpdir
150150
FilePermissionUtils.addDirectoryPath(perms, "java.io.tmpdir", javaTmpDir, "read,readlink,write,delete", false);
151+
String jacocoDir = System.getProperty("jacoco.dir");
152+
if (jacocoDir != null) {
153+
FilePermissionUtils.addDirectoryPath(perms, "jacoco.dir", PathUtils.get(jacocoDir), "read,readlink,write,delete", false);
154+
}
151155
// custom test config file
152156
String testConfigFile = System.getProperty("tests.config");
153157
if (Strings.hasLength(testConfigFile)) {

0 commit comments

Comments
 (0)