File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
stackhpc_openstack_tests/monitoring Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
opensearch-py == 2.5.*
2
2
prometheus-api-client == 0.5.*
3
3
pytest-testinfra == 10.1.*
4
+ requests == 2.31.*
Original file line number Diff line number Diff line change 13
13
# under the License.
14
14
15
15
# TODO:
16
- # * Dashboard login
17
16
# * Cluster health
18
17
19
18
from opensearchpy import OpenSearch
20
19
import os
21
20
import pytest
21
+ import requests
22
22
23
23
from stackhpc_openstack_tests import utils
24
24
@@ -60,3 +60,15 @@ def test_opensearch_has_info_logs(opensearch):
60
60
# https://opensearch-project.github.io/opensearch-py/api-ref/clients/opensearch_client.html#opensearchpy.OpenSearch.search
61
61
result = opensearch .search (body = query , index = "flog-*" , size = 1 )
62
62
assert len (result ["hits" ]["hits" ]) == 1
63
+
64
+
65
+ def test_opensearch_dashboards_status ():
66
+ """Check that OpenSearch Dashboards is accessible and is in a green state."""
67
+ dashboard_url = os .environ ["OPENSEARCH_DASHBOARDS_URL" ]
68
+ dashboard_username = os .environ ["OPENSEARCH_DASHBOARDS_USERNAME" ]
69
+ dashboard_password = os .environ ["OPENSEARCH_DASHBOARDS_PASSWORD" ]
70
+ dashboard_url += "/api/status"
71
+ result = requests .get (dashboard_url , auth = (dashboard_username , dashboard_password ))
72
+ assert result .ok
73
+ result = result .json ()
74
+ assert result ["status" ]["overall" ]["state" ] == "green"
You can’t perform that action at this time.
0 commit comments