diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/MultiTypeMappingTransformationTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/MultiTypeMappingTransformationTest.java index 2cd7a605d..bdd73221e 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/MultiTypeMappingTransformationTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/MultiTypeMappingTransformationTest.java @@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.testcontainers.containers.BindMode; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; @@ -31,10 +32,9 @@ class MultiTypeMappingTransformationTest extends BaseMigrationTest { @Test public void multiTypeTransformationTest_union() { try ( - final var indexCreatedCluster = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_13) - .withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR); + final var indexCreatedCluster = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_16); final var upgradedSourceCluster = new SearchClusterContainer(ES_V6_8_23) - .withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR); + .withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, BindMode.READ_WRITE); final var targetCluster = new SearchClusterContainer(SearchClusterContainer.OS_V2_14_0) ) { indexCreatedCluster.start(); @@ -60,6 +60,8 @@ public void multiTypeTransformationTest_union() { indexCreatedOperations.createSnapshotRepository(SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, es5Repo); indexCreatedOperations.takeSnapshot(es5Repo, snapshotName, originalIndexName); + indexCreatedCluster.copySnapshotData(localDirectory.getAbsolutePath()); + // Register snapshot repository and restore snapshot in ES 6 cluster upgradedSourceOperations.createSnapshotRepository(SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, es5Repo); upgradedSourceOperations.restoreSnapshot(es5Repo, snapshotName); @@ -119,7 +121,7 @@ public void multiTypeTransformationTest_union() { @Test public void es5_doesNotAllow_multiTypeConflicts() { try ( - final var es5 = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_13) + final var es5 = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_16) ) { es5.start(); diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java index a07f33a3d..fa4069115 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java @@ -34,7 +34,7 @@ public class SearchClusterContainer extends GenericContainer