use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.
the class DiscoveryNodeFiltersTests method testIpPublishFilteringMatchingAnd.
public void testIpPublishFilteringMatchingAnd() {
Settings settings = shuffleSettings(Settings.builder().put("xxx.tag", "A").put("xxx._publish_ip", "192.1.1.54").build());
DiscoveryNodeFilters filters = DiscoveryNodeFilters.buildFromSettings(AND, "xxx.", settings);
DiscoveryNode node = new DiscoveryNode("", "", "", "", "192.1.1.54", localAddress, singletonMap("tag", "A"), emptySet(), null);
assertThat(filters.match(node), equalTo(true));
}
use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.
the class DiscoveryNodeFiltersTests method testIpBindFilteringNotMatchingOr.
public void testIpBindFilteringNotMatchingOr() {
Settings settings = shuffleSettings(Settings.builder().put("xxx.tag", "A").put("xxx." + randomFrom("_ip", "_host_ip", "_publish_ip"), "8.8.8.8").build());
DiscoveryNodeFilters filters = DiscoveryNodeFilters.buildFromSettings(OR, "xxx.", settings);
DiscoveryNode node = new DiscoveryNode("", "", "", "", "192.1.1.54", localAddress, singletonMap("tag", "A"), emptySet(), null);
assertThat(filters.match(node), equalTo(true));
}
use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.
the class DiscoveryNodeFiltersTests method testIpBindFilteringNotMatchingAnd.
public void testIpBindFilteringNotMatchingAnd() {
Settings settings = shuffleSettings(Settings.builder().put("xxx.tag", "A").put("xxx." + randomFrom("_ip", "_host_ip", "_publish_ip"), "8.8.8.8").build());
DiscoveryNodeFilters filters = DiscoveryNodeFilters.buildFromSettings(AND, "xxx.", settings);
DiscoveryNode node = new DiscoveryNode("", "", "", "", "192.1.1.54", localAddress, singletonMap("tag", "A"), emptySet(), null);
assertThat(filters.match(node), equalTo(false));
}
use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.
the class DiscoveryNodeFiltersTests method testIpBindFilteringMatchingOr.
public void testIpBindFilteringMatchingOr() {
Settings settings = shuffleSettings(Settings.builder().put("xxx." + randomFrom("_ip", "_host_ip", "_publish_ip"), "192.1.1.54").put("xxx.tag", "A").build());
DiscoveryNodeFilters filters = DiscoveryNodeFilters.buildFromSettings(OR, "xxx.", settings);
DiscoveryNode node = new DiscoveryNode("", "", "", "", "192.1.1.54", localAddress, singletonMap("tag", "A"), emptySet(), null);
assertThat(filters.match(node), equalTo(true));
}
use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.
the class DiscoveryNodeFiltersTests method testIpPublishFilteringMatchingOr.
public void testIpPublishFilteringMatchingOr() {
Settings settings = shuffleSettings(Settings.builder().put("xxx._publish_ip", "192.1.1.54").put("xxx.tag", "A").build());
DiscoveryNodeFilters filters = DiscoveryNodeFilters.buildFromSettings(OR, "xxx.", settings);
DiscoveryNode node = new DiscoveryNode("", "", "", "", "192.1.1.54", localAddress, singletonMap("tag", "A"), emptySet(), null);
assertThat(filters.match(node), equalTo(true));
}
Aggregations