@@ -586,6 +586,9 @@ public void testTransformLegacyTemplateCleanup() throws Exception {
586586 }
587587
588588 public void testSlmPolicyAndStats () throws IOException {
589+ @ UpdateForV9
590+ var originalClusterSupportsSlm = parseLegacyVersion (getOldClusterVersion ()).map (v -> v .onOrAfter (Version .V_7_4_0 )).orElse (true );
591+
589592 SnapshotLifecyclePolicy slmPolicy = new SnapshotLifecyclePolicy (
590593 "test-policy" ,
591594 "test-policy" ,
@@ -594,7 +597,7 @@ public void testSlmPolicyAndStats() throws IOException {
594597 Collections .singletonMap ("indices" , Collections .singletonList ("*" )),
595598 null
596599 );
597- if (isRunningAgainstOldCluster () && clusterHasFeature ( RestTestLegacyFeatures . SLM_SUPPORTED ) ) {
600+ if (isRunningAgainstOldCluster () && originalClusterSupportsSlm ) {
598601 Request createRepoRequest = new Request ("PUT" , "_snapshot/test-repo" );
599602 String repoCreateJson = "{" + " \" type\" : \" fs\" ," + " \" settings\" : {" + " \" location\" : \" test-repo\" " + " }" + "}" ;
600603 createRepoRequest .setJsonEntity (repoCreateJson );
@@ -608,7 +611,7 @@ public void testSlmPolicyAndStats() throws IOException {
608611 client ().performRequest (createSlmPolicyRequest );
609612 }
610613
611- if (isRunningAgainstOldCluster () == false && clusterHasFeature ( RestTestLegacyFeatures . SLM_SUPPORTED ) ) {
614+ if (isRunningAgainstOldCluster () == false && originalClusterSupportsSlm ) {
612615 Request getSlmPolicyRequest = new Request ("GET" , "_slm/policy/test-policy" );
613616 Response response = client ().performRequest (getSlmPolicyRequest );
614617 Map <String , Object > responseMap = entityAsMap (response );
@@ -940,6 +943,10 @@ public void testDataStreams() throws Exception {
940943 var originalClusterSupportsDataStreams = parseLegacyVersion (getOldClusterVersion ()).map (v -> v .onOrAfter (Version .V_7_9_0 ))
941944 .orElse (true );
942945
946+ @ UpdateForV9
947+ var originalClusterDataStreamHasDateInIndexName = parseLegacyVersion (getOldClusterVersion ()).map (v -> v .onOrAfter (Version .V_7_11_0 ))
948+ .orElse (true );
949+
943950 assumeTrue ("no data streams in versions before 7.9.0" , originalClusterSupportsDataStreams );
944951 if (isRunningAgainstOldCluster ()) {
945952 createComposableTemplate (client (), "dst" , "ds" );
@@ -977,12 +984,7 @@ public void testDataStreams() throws Exception {
977984 assertEquals ("ds" , ds .get ("name" ));
978985 assertEquals (1 , indices .size ());
979986 assertEquals (
980- DataStreamTestHelper .getLegacyDefaultBackingIndexName (
981- "ds" ,
982- 1 ,
983- timestamp ,
984- clusterHasFeature (RestTestLegacyFeatures .DATA_STREAMS_DATE_IN_INDEX_NAME )
985- ),
987+ DataStreamTestHelper .getLegacyDefaultBackingIndexName ("ds" , 1 , timestamp , originalClusterDataStreamHasDateInIndexName ),
986988 indices .get (0 ).get ("index_name" )
987989 );
988990 assertNumHits ("ds" , 1 , 1 );
0 commit comments