Skip to content

Commit d9f4b11

Browse files
authored
Ensure that plugins that utilize dumpCoverage can write to jacoco.dir when tests.security.manager is enabled (opensearch-project#18988)
Signed-off-by: Craig Perkins <[email protected]>
1 parent a6a61b3 commit d9f4b11

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
### Fixed
1414
- Fix unnecessary refreshes on update preparation failures ([#15261](https://github.com/opensearch-project/OpenSearch/issues/15261))
1515
- Fix NullPointerException in segment replicator ([#18997](https://github.com/opensearch-project/OpenSearch/pull/18997))
16+
- Ensure that plugins that utilize dumpCoverage can write to jacoco.dir when tests.security.manager is enabled ([#18983](https://github.com/opensearch-project/OpenSearch/pull/18983))
1617

1718
### Dependencies
1819
- Bump `com.netflix.nebula.ospackage-base` from 12.0.0 to 12.1.0 ([#19019](https://github.com/opensearch-project/OpenSearch/pull/19019))

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ 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(
154+
perms,
155+
"jacoco.dir",
156+
PathUtils.get(jacocoDir),
157+
"read,readlink,write,delete",
158+
false
159+
);
160+
}
151161
// custom test config file
152162
String testConfigFile = System.getProperty("tests.config");
153163
if (Strings.hasLength(testConfigFile)) {

0 commit comments

Comments
 (0)