Skip to content

Commit 2ad9dab

Browse files
authored
Skip selected tests in SSLErrorMessageFileTests that rely on SecurityManager to block access to resources. (#123484) (#123509)
1 parent b5735d8 commit 2ad9dab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLErrorMessageFileTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.core.PathUtils;
1717
import org.elasticsearch.env.Environment;
1818
import org.elasticsearch.env.TestEnvironment;
19+
import org.elasticsearch.jdk.RuntimeVersionFeature;
1920
import org.elasticsearch.test.ESTestCase;
2021
import org.elasticsearch.xpack.core.ssl.SSLService;
2122
import org.junit.Before;
@@ -362,6 +363,11 @@ private void checkBlockedResource(
362363
String configKey,
363364
BiConsumer<String, Settings.Builder> configure
364365
) throws Exception {
366+
assumeTrue(
367+
"Requires Security Manager to block access, entitlements are not checked for unit tests",
368+
RuntimeVersionFeature.isSecurityManagerAvailable()
369+
);
370+
365371
final String prefix = randomSslPrefix();
366372
final Settings.Builder settings = Settings.builder();
367373
configure.accept(prefix, settings);

0 commit comments

Comments
 (0)