From 777079d2f7c3aa577b3943993691557dee970eb1 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 12 Aug 2020 11:14:28 +1000 Subject: [PATCH] Mute kerberos tests for jdk 8u[262,271) --- .../security/authc/kerberos/KerberosAuthenticationIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java b/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java index e94a133ff322a..8d6c521706c5e 100644 --- a/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java +++ b/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java @@ -33,6 +33,7 @@ import java.security.PrivilegedExceptionAction; import java.util.List; import java.util.Map; +import java.util.stream.IntStream; import javax.security.auth.login.LoginContext; @@ -89,9 +90,11 @@ public void setupRoleMapping() throws IOException { assertOK(response); } - // JDK 8u262 shipped with a NPE in Kerberos code, see https://github.com/elastic/elasticsearch/issues/56507 + // JDK 8u262 shipped with a NPE in Kerberos code and fixed in 8u271, see https://github.com/elastic/elasticsearch/issues/56507 public void testSuppressedOnJDK8u262() { - assumeFalse("Cannot run on JDK 8u262", "1.8.0_262".equals(System.getProperty("java.version"))); + final String javaVersion = System.getProperty("java.version"); + assumeFalse("Cannot run on JDK 8u[262, 271)", + IntStream.range(262, 271).mapToObj(i -> "1.8.0_" + i).anyMatch(javaVersion::equals)); } public void testLoginByKeytab() throws IOException, PrivilegedActionException {