Skip to content

Commit f9dd907

Browse files
committed
Trivially allow some packages
1 parent b303ab2 commit f9dd907

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/framework/src/main/java/org/elasticsearch/entitlement/runtime/policy/TestPolicyManager.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ boolean isTriviallyAllowed(Class<?> requestingClass) {
8585
if (isTestFrameworkClass(requestingClass)) {
8686
return true;
8787
}
88+
if ("org.elasticsearch.jdk".equals(requestingClass.getPackageName())) {
89+
// PluginsLoaderTests, PluginsServiceTests, PluginsUtilsTests
90+
return true;
91+
}
92+
if ("org.elasticsearch.nativeaccess".equals(requestingClass.getPackageName())) {
93+
// UberModuleClassLoaderTests
94+
return true;
95+
}
96+
if (requestingClass.getPackageName().startsWith("org.elasticsearch.plugins")) {
97+
// PluginsServiceTests, NamedComponentReaderTests
98+
return true;
99+
}
88100
if (isTriviallyAllowingTestCode && isTestCode(requestingClass)) {
89101
return true;
90102
}
@@ -133,6 +145,8 @@ private boolean isTestCode(Class<?> requestingClass) {
133145
private static final String[] TEST_FRAMEWORK_PACKAGE_PREFIXES = {
134146
"org.gradle",
135147

148+
"org.jcodings", // A library loaded with SPI that tries to create a CharsetProvider
149+
136150
// We shouldn't really need the rest of these. They should be discovered on the testOnlyClasspath.
137151
"com.carrotsearch.randomizedtesting",
138152
"com.sun.tools.javac",

0 commit comments

Comments
 (0)