forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.17] Add has_custom_cutoff_date to logsdb usage. (elastic#117550)
Indicates whether es.mapping.synthetic_source_fallback_to_stored_source.cutoff_date_restricted_override system property has been configured. A follow up from elastic#116647
- Loading branch information
Showing
6 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
apply plugin: 'elasticsearch.internal-java-rest-test' | ||
|
||
dependencies { | ||
javaRestTestImplementation(testArtifact(project(xpackModule('core')))) | ||
} | ||
|
||
tasks.named("javaRestTest").configure { | ||
// This test cluster is using a BASIC license and FIPS 140 mode is not supported in BASIC | ||
buildParams.withFipsEnabledOnly(it) | ||
|
||
usesDefaultDistribution() | ||
} |
45 changes: 45 additions & 0 deletions
45
...om-cutoff/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/LogsdbWithBasicRestIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.logsdb; | ||
|
||
import org.elasticsearch.test.cluster.ElasticsearchCluster; | ||
import org.elasticsearch.test.cluster.local.distribution.DistributionType; | ||
import org.elasticsearch.test.rest.ESRestTestCase; | ||
import org.hamcrest.Matchers; | ||
import org.junit.ClassRule; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
public class LogsdbWithBasicRestIT extends ESRestTestCase { | ||
|
||
@ClassRule | ||
public static ElasticsearchCluster cluster = ElasticsearchCluster.local() | ||
.distribution(DistributionType.DEFAULT) | ||
.systemProperty("es.mapping.synthetic_source_fallback_to_stored_source.cutoff_date_restricted_override", "2027-12-31T23:59") | ||
.setting("xpack.security.enabled", "false") | ||
.setting("cluster.logsdb.enabled", "true") | ||
.build(); | ||
|
||
@Override | ||
protected String getTestRestCluster() { | ||
return cluster.getHttpAddresses(); | ||
} | ||
|
||
public void testCustomCutoffDateUsage() throws IOException { | ||
var response = getAsMap("/_xpack/usage"); | ||
Map<?, ?> usage = (Map<?, ?>) response.get("logsdb"); | ||
assertThat(usage, Matchers.hasEntry("available", true)); | ||
assertThat(usage, Matchers.hasEntry("enabled", true)); | ||
assertThat(usage, Matchers.hasEntry("indices_count", 0)); | ||
assertThat(usage, Matchers.hasEntry("indices_with_synthetic_source", 0)); | ||
assertThat(usage, Matchers.hasEntry("num_docs", 0)); | ||
assertThat(usage, Matchers.hasEntry("size_in_bytes", 0)); | ||
assertThat(usage, Matchers.hasEntry("has_custom_cutoff_date", true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters