From 755f61f8d0afc8969abf3870c57ab0c1cfcae1ba Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Tue, 30 Apr 2024 10:24:37 -0700 Subject: [PATCH 1/2] Adjusted integ tests for when security is enabled. Signed-off-by: AWSHurneyt --- .../alerting/transport/GetRemoteIndexesActionIT.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt index 99556fe3c..9b29e499d 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt @@ -101,7 +101,9 @@ class GetRemoteIndexesActionIT : AlertingRestTestCase() { assertNotNull(clusterDetails[ClusterIndexes.INDEXES_FIELD]) val indexes = clusterDetails[ClusterIndexes.INDEXES_FIELD] as Map> - assertEquals(expectedNames.size, indexes.keys.size) + + // Skipping this assert when security is enabled as it doesn't consider the existence of system indexes. + if (!securityEnabled()) assertEquals(expectedNames.size, indexes.keys.size) // Validate index-level response details expectedNames.forEach { indexName -> @@ -149,7 +151,9 @@ class GetRemoteIndexesActionIT : AlertingRestTestCase() { assertNotNull(clusterDetails[ClusterIndexes.INDEXES_FIELD]) val indexes = clusterDetails[ClusterIndexes.INDEXES_FIELD] as Map> - assertEquals(expectedNames.size, indexes.keys.size) + + // Skipping this assert when security is enabled as it doesn't consider the existence of system indexes. + if (!securityEnabled()) assertEquals(expectedNames.size, indexes.keys.size) // Validate index-level response details expectedNames.forEach { indexName -> From e9d89de6938a5cca92e0db554ab30e000f0c7a6e Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Tue, 30 Apr 2024 11:00:12 -0700 Subject: [PATCH 2/2] Adjusted integ tests for when security is enabled. Signed-off-by: AWSHurneyt --- .../opensearch/alerting/transport/GetRemoteIndexesActionIT.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt index 9b29e499d..0b9282d10 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/transport/GetRemoteIndexesActionIT.kt @@ -201,7 +201,8 @@ class GetRemoteIndexesActionIT : AlertingRestTestCase() { assertNotNull(clusterDetails[ClusterIndexes.INDEXES_FIELD]) val indexes = clusterDetails[ClusterIndexes.INDEXES_FIELD] as Map> - assertEquals(expectedNames.size, indexes.keys.size) + // Skipping this assert when security is enabled as it doesn't consider the existence of system indexes. + if (!securityEnabled()) assertEquals(expectedNames.size, indexes.keys.size) // Validate index-level response details expectedNames.forEach { indexName ->