Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ielatif committed May 31, 2019
1 parent f94cef5 commit 2ebcdad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public void testPreventJoinClusterWithUnsupportedIndices() {
Settings.builder().build();
MetaData.Builder metaBuilder = MetaData.builder();
IndexMetaData indexMetaData = IndexMetaData.builder("test")
.settings(settings(VersionUtils.getPreviousVersion(Version.CURRENT
.minimumIndexCompatibilityVersion())))
.settings(settings(Version.fromString("6.8.0"))) // latest V6 released version
.numberOfShards(1)
.numberOfReplicas(1).build();
metaBuilder.put(indexMetaData, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,29 +318,6 @@ public void testJoinValidatorForFIPSLicense() throws Exception {
}
}

public void testIndexJoinValidator_Old_And_Rolling() throws Exception {
createComponents(Settings.EMPTY);
BiConsumer<DiscoveryNode, ClusterState> joinValidator = security.getJoinValidator();
assertNotNull(joinValidator);
Version version = VersionUtils.randomVersionBetween(random(), VersionUtils.getFirstVersion(),
VersionUtils.getPreviousVersion(Version.V_7_0_0));
DiscoveryNode node = new DiscoveryNode("foo", buildNewFakeTransportAddress(), Version.CURRENT);
IndexMetaData indexMetaData = IndexMetaData.builder(SECURITY_MAIN_ALIAS)
.settings(settings(version)
.put(INDEX_FORMAT_SETTING.getKey(), INTERNAL_MAIN_INDEX_FORMAT - 1))
.numberOfShards(1).numberOfReplicas(0)
.build();
DiscoveryNode existingOtherNode = new DiscoveryNode("bar", buildNewFakeTransportAddress(), version);
DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(existingOtherNode).build();
ClusterState clusterState = ClusterState.builder(ClusterName.DEFAULT)
.nodes(discoveryNodes)
.metaData(MetaData.builder().put(indexMetaData, true).build()).build();
IllegalStateException e = expectThrows(IllegalStateException.class,
() -> joinValidator.accept(node, clusterState));
assertThat(e.getMessage(), equalTo("Security index is not on the current version [6] - " +
"The Upgrade API must be run for 7.x nodes to join the cluster"));
}

public void testIndexJoinValidator_FullyCurrentCluster() throws Exception {
createComponents(Settings.EMPTY);
BiConsumer<DiscoveryNode, ClusterState> joinValidator = security.getJoinValidator();
Expand Down

0 comments on commit 2ebcdad

Please sign in to comment.