File tree Expand file tree Collapse file tree 5 files changed +42
-99
lines changed
src/test/java/org/elasticsearch/upgrades
x-pack/qa/full-cluster-restart
src/test/java/org/elasticsearch/xpack/restart Expand file tree Collapse file tree 5 files changed +42
-99
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ for (Version version : bwcVersions.indexCompatible) {
9191 systemProperty ' tests.is_old_cluster' , ' false'
9292 systemProperty ' tests.old_cluster_version' , version. toString(). minus(" -SNAPSHOT" )
9393 systemProperty ' tests.path.repo' , new File (buildDir, " cluster/shared/repo" )
94-
9594 }
9695
9796 Task versionBwcTest = tasks. create(name : " ${ baseName} #bwcTest" ) {
@@ -115,4 +114,3 @@ task integTest {
115114}
116115
117116check. dependsOn(integTest)
118-
Original file line number Diff line number Diff line change 1717 * under the License.
1818 */
1919
20- package org .elasticsearch .bwc ;
20+ package org .elasticsearch .upgrades ;
2121
2222import org .apache .http .util .EntityUtils ;
2323import org .elasticsearch .Version ;
@@ -153,7 +153,23 @@ protected boolean preserveIndicesUponCompletion() {
153153 return true ;
154154 }
155155
156+ @ Override
157+ protected boolean preserveSnapshotsUponCompletion () {
158+ return true ;
159+ }
160+
161+ @ Override
162+ protected boolean preserveReposUponCompletion () {
163+ return true ;
164+ }
165+
166+ @ Override
167+ protected boolean preserveTemplatesUponCompletion () {
168+ return true ;
169+ }
170+
156171 public void testQueryBuilderBWC () throws Exception {
172+ assumeTrue ("5.x not supported" , oldClusterVersion .onOrAfter (Version .V_6_0_0_alpha1 ));
157173 String index = "queries" ;
158174 if (runningAgainstOldCluster ) {
159175 XContentBuilder mappingsAndSettings = jsonBuilder ();
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ subprojects {
196196 systemProperty ' tests.old_cluster_version' , version. toString(). minus(" -SNAPSHOT" )
197197 systemProperty ' tests.path.repo' , new File (buildDir, " cluster/shared/repo" )
198198 exclude ' org/elasticsearch/upgrades/FullClusterRestartIT.class'
199+ exclude ' org/elasticsearch/upgrades/QueryBuilderBWCIT.class'
199200 }
200201
201202 Task upgradedClusterTest = tasks. create(name : " ${ baseName} #upgradedClusterTest" , type : RestIntegTestTask )
@@ -234,6 +235,7 @@ subprojects {
234235 systemProperty ' tests.old_cluster_version' , version. toString(). minus(" -SNAPSHOT" )
235236 systemProperty ' tests.path.repo' , new File (buildDir, " cluster/shared/repo" )
236237 exclude ' org/elasticsearch/upgrades/FullClusterRestartIT.class'
238+ exclude ' org/elasticsearch/upgrades/QueryBuilderBWCIT.class'
237239 }
238240
239241 Task versionBwcTest = tasks. create(name : " ${ baseName} #bwcTest" ) {
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+ package org .elasticsearch .xpack .restart ;
7+
8+ import org .elasticsearch .common .settings .Settings ;
9+ import org .elasticsearch .common .util .concurrent .ThreadContext ;
10+
11+ import java .nio .charset .StandardCharsets ;
12+ import java .util .Base64 ;
13+
14+ public class QueryBuilderBWCIT extends org .elasticsearch .upgrades .QueryBuilderBWCIT {
15+
16+ @ Override
17+ protected Settings restClientSettings () {
18+ String token = "Basic " + Base64 .getEncoder ().encodeToString ("test_user:x-pack-test-password" .getBytes (StandardCharsets .UTF_8 ));
19+ return Settings .builder ()
20+ .put (ThreadContext .PREFIX + ".Authorization" , token )
21+ .build ();
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments