-
Notifications
You must be signed in to change notification settings - Fork 66
/
ReportsSchedulerPluginIT.kt
35 lines (32 loc) · 1.44 KB
/
ReportsSchedulerPluginIT.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
package org.opensearch.integTest
import org.junit.Ignore
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest
import org.opensearch.action.admin.cluster.node.info.NodesInfoRequest
import org.opensearch.action.admin.cluster.node.info.PluginsAndModules
import org.opensearch.cluster.health.ClusterHealthStatus
import org.opensearch.plugins.PluginInfo
import org.opensearch.test.OpenSearchIntegTestCase
class ReportsSchedulerPluginIT : OpenSearchIntegTestCase() {
@Ignore
fun testPluginsAreInstalled() {
val request = ClusterHealthRequest()
val response = client().admin().cluster().health(request).actionGet()
assertEquals(ClusterHealthStatus.GREEN, response.status)
val nodesInfoRequest = NodesInfoRequest()
nodesInfoRequest.addMetric(NodesInfoRequest.Metric.PLUGINS.metricName())
val nodesInfoResponse = client().admin().cluster().nodesInfo(nodesInfoRequest).actionGet()
val pluginInfos = nodesInfoResponse.nodes[0].getInfo(PluginsAndModules::class.java).pluginInfos
assertTrue(
pluginInfos.stream()
.anyMatch { pluginInfo: PluginInfo -> pluginInfo.name == "opensearch-job-scheduler" }
)
assertTrue(
pluginInfos.stream()
.anyMatch { pluginInfo: PluginInfo -> pluginInfo.name == "opensearch-reports-scheduler" }
)
}
}