diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index eb2e6c7d12c..f002b41c6d3 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -69,8 +69,6 @@ compileTestJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-tr * configuration options based on their name. */ subprojects { - // TODO remove after backport - ext.bwc_tests_enabled = false Matcher m = project.name =~ /with(out)?-system-key/ if (false == m.matches()) { throw new InvalidUserDataException("Invalid project name [${project.name}]") diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java index 5807a6078ee..588e0557d81 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java @@ -28,9 +28,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import static org.elasticsearch.xpack.core.security.SecurityLifecycleServiceField.SECURITY_TEMPLATE_NAME; import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; public class TokenBackwardsCompatibilityIT extends ESRestTestCase { @@ -140,7 +138,6 @@ public class TokenBackwardsCompatibilityIT extends ESRestTestCase { public void testMixedCluster() throws Exception { assumeTrue("this test should only run against the mixed cluster", clusterType == CLUSTER_TYPE.MIXED); assumeTrue("the master must be on the latest version before we can write", isMasterOnLatestVersion()); - awaitIndexTemplateUpgrade(); Response getResponse = client().performRequest("GET", "token_backwards_compatibility_it/doc/old_cluster_token2"); assertOK(getResponse); Map source = (Map) entityAsMap(getResponse).get("_source"); @@ -188,7 +185,6 @@ public class TokenBackwardsCompatibilityIT extends ESRestTestCase { public void testUpgradedCluster() throws Exception { assumeTrue("this test should only run against the mixed cluster", clusterType == CLUSTER_TYPE.UPGRADED); - awaitIndexTemplateUpgrade(); Response getResponse = client().performRequest("GET", "token_backwards_compatibility_it/doc/old_cluster_token2"); assertOK(getResponse); Map source = (Map) entityAsMap(getResponse).get("_source"); @@ -265,28 +261,6 @@ public class TokenBackwardsCompatibilityIT extends ESRestTestCase { return Version.CURRENT.equals(Version.fromString(objectPath.evaluate("nodes." + masterNodeId + ".version"))); } - private void awaitIndexTemplateUpgrade() throws Exception { - assertTrue(awaitBusy(() -> { - try { - Response response = client().performRequest("GET", "/_cluster/state/metadata"); - assertOK(response); - ObjectPath objectPath = ObjectPath.createFromResponse(response); - final String mappingsPath = "metadata.templates." + SECURITY_TEMPLATE_NAME + "" + - ".mappings"; - Map mappings = objectPath.evaluate(mappingsPath); - assertNotNull(mappings); - assertThat(mappings.size(), greaterThanOrEqualTo(1)); - String key = mappings.keySet().iterator().next(); - String templateVersion = objectPath.evaluate(mappingsPath + "." + key + "" + "._meta.security-version"); - final Version tVersion = Version.fromString(templateVersion); - return Version.CURRENT.equals(tVersion); - } catch (IOException e) { - logger.warn("caught exception checking template version", e); - return false; - } - })); - } - private RestClient getRestClientForCurrentVersionNodesOnly() throws IOException { Response response = client().performRequest("GET", "_nodes"); assertOK(response);