diff --git a/build.gradle b/build.gradle index 257c51520..05624e3c0 100644 --- a/build.gradle +++ b/build.gradle @@ -573,6 +573,7 @@ integTest { excludeTestsMatching "org.opensearch.indexmanagement.indexstatemanagement.action.NotificationActionIT" } exclude 'org/opensearch/indexmanagement/indexstatemanagement/MetadataRegressionIT.class' + exclude 'org/opensearch/indexmanagement/indexstatemanagement/ConvertIndexToRemoteIT.class' } // TODO: raise issue in Core, this is because of the test framework @@ -634,6 +635,7 @@ task integTestRemote(type: RestIntegTestTask) { // Snapshot action integration tests rely on node level setting path.repo which we can't set remotely exclude 'org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotActionIT.class' + exclude 'org/opensearch/indexmanagement/indexstatemanagement/action/ConvertIndexToRemoteIT.class' } // === Set up BWC tests === diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt index 106117fa2..51e4ee40c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt @@ -101,38 +101,6 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() protected open fun enableValidationService() { updateValidationServiceSetting(true) } - - protected fun createOrUpdateRole() { - val roleBody = """ - { - "cluster_permissions": ["cluster:admin/snapshot/restore", "cluster:admin/snapshot/create"], - "index_permissions": [ - { - "index_patterns": ["*"], - "allowed_actions": ["indices:*"] - } - ] - } - """.trimIndent() - - client().makeRequest( - method = "PUT", - endpoint = "/_plugins/_security/api/roles/snapshot_restore_role", - entity = StringEntity(roleBody, ContentType.APPLICATION_JSON), - ) - - // Map your test user to snapshot_restore_role - val roleMappingBody = """ - { - "users": ["testUser"] - } - """.trimIndent() - client().makeRequest( - method = "PUT", - endpoint = "/_plugins/_security/api/rolesmapping/snapshot_restore_role", - entity = StringEntity(roleMappingBody, ContentType.APPLICATION_JSON), - ) - } protected fun createPolicy( policy: Policy, policyId: String = OpenSearchTestCase.randomAlphaOfLength(10), diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ConvertIndexToRemoteActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ConvertIndexToRemoteActionIT.kt index 56b565680..5617a9cf4 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ConvertIndexToRemoteActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ConvertIndexToRemoteActionIT.kt @@ -21,7 +21,6 @@ class ConvertIndexToRemoteActionIT : IndexStateManagementRestTestCase() { private val testIndexName = javaClass.simpleName.lowercase(Locale.ROOT) fun `test basic conversion to remote index`() { - createOrUpdateRole() val indexName = "${testIndexName}_index_basic" val policyID = "${testIndexName}_policy_basic" val repository = "repository"