Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,3 @@ tests:
- class: org.elasticsearch.reservedstate.service.RepositoriesFileSettingsIT
method: testSettingsApplied
issue: https://github.com/elastic/elasticsearch/issues/116694
- class: org.elasticsearch.upgrades.FileSettingsRoleMappingUpgradeIT
method: testRoleMappingsAppliedOnUpgrade {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/118311
- class: org.elasticsearch.upgrades.FileSettingsRoleMappingUpgradeIT
method: testRoleMappingsAppliedOnUpgrade {upgradedNodes=1}
issue: https://github.com/elastic/elasticsearch/issues/118309
- class: org.elasticsearch.upgrades.FileSettingsRoleMappingUpgradeIT
method: testRoleMappingsAppliedOnUpgrade {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/118310
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import org.elasticsearch.test.XContentTestUtils;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.cluster.util.Version;
import org.elasticsearch.test.cluster.util.resource.Resource;
import org.junit.Before;
import org.elasticsearch.test.junit.RunnableTestRuleAdapter;
import org.junit.ClassRule;
import org.junit.rules.RuleChain;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -70,9 +71,15 @@ public String get() {
.setting("xpack.security.authc.anonymous.roles", "superuser")
.configFile("operator/settings.json", Resource.fromString(SETTING_JSON))
.build();
private static final RunnableTestRuleAdapter versionLimit = new RunnableTestRuleAdapter(
() -> assumeTrue(
"Only relevant when upgrading from a version before role mappings were stored in cluster state",
getOldClusterTestVersion().after(new Version(8, 7, 0)) && getOldClusterTestVersion().before(new Version(8, 15, 0))
)
);

@ClassRule
public static TestRule ruleChain = RuleChain.outerRule(repoDirectory).around(cluster);
public static TestRule ruleChain = RuleChain.outerRule(versionLimit).around(repoDirectory).around(cluster);

public FileSettingsRoleMappingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
Expand All @@ -83,14 +90,6 @@ protected ElasticsearchCluster getUpgradeCluster() {
return cluster;
}

@Before
public void checkVersions() {
assumeTrue(
"Only relevant when upgrading from a version before role mappings were stored in cluster state",
oldClusterHasFeature("gte_v8.7.0") && oldClusterHasFeature("gte_v8.15.0") == false
);
}

private static void waitForSecurityMigrationCompletionIfIndexExists() throws Exception {
final Request request = new Request("GET", "_cluster/state/metadata/.security-7");
assertBusy(() -> {
Expand Down