blob: 1bb67ec91d9dcf35edef04f8838d947345cb65d1 [file] [log] [blame]
Hanna Arhipova16e93fb2019-01-23 19:03:01 +02001import utils
Oleksii Zhurba020fab42017-11-01 20:13:28 +00002import pytest
3
4
5def test_ui_horizon(local_salt_client):
6 salt_output = local_salt_client.cmd(
7 'horizon:server',
8 'pillar.get',
Oleksii Zhurbae37cdab2017-11-02 20:00:03 +00009 ['_param:cluster_public_host'],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000010 expr_form='pillar')
mkraynove9404042018-12-04 10:42:41 +040011 if not salt_output:
12 pytest.skip("Horizon is not enabled on this environment")
Oleksii Zhurba020fab42017-11-01 20:13:28 +000013 IP = [salt_output[node] for node in salt_output
14 if salt_output[node]]
15 result = local_salt_client.cmd(
16 'keystone:server',
17 'cmd.run',
18 ['curl --insecure https://{}/auth/login/ 2>&1 | \
19 grep Login'.format(IP[0])],
20 expr_form='pillar')
21 assert len(result[result.keys()[0]]) != 0, \
22 'Horizon login page is not reachable on {} from ctl nodes'.format(
23 IP[0])
24
25
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030026@pytest.mark.usefixtures('check_kibana')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030027def test_internal_ui_kibana(local_salt_client):
Oleksii Zhurba020fab42017-11-01 20:13:28 +000028 IP = utils.get_monitoring_ip('stacklight_log_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030029 protocol = 'http'
30 port = '5601'
31 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000032 result = local_salt_client.cmd(
33 'keystone:server',
34 'cmd.run',
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030035 ['curl {}/app/kibana 2>&1 | \
36 grep loading'.format(url)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000037 expr_form='pillar')
38 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030039 'Internal Kibana login page is not reachable on {} ' \
40 'from ctl nodes'.format(url)
41
42
43@pytest.mark.usefixtures('check_kibana')
44def test_public_ui_kibana(local_salt_client):
45 IP = utils.get_monitoring_ip('openstack_proxy_address')
46 protocol = 'https'
47 port = '5601'
48 url = "{}://{}:{}".format(protocol, IP, port)
49 result = local_salt_client.cmd(
50 'keystone:server',
51 'cmd.run',
52 ['curl {}/app/kibana 2>&1 | \
53 grep loading'.format(url)],
54 expr_form='pillar')
55 assert len(result[result.keys()[0]]) != 0, \
56 'Public Kibana login page is not reachable on {} ' \
57 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000058
59
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030060@pytest.mark.usefixtures('check_prometheus')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030061def test_internal_ui_prometheus(local_salt_client):
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050062 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030063 protocol = 'http'
64 port = '15010'
65 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000066 result = local_salt_client.cmd(
67 'keystone:server',
68 'cmd.run',
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030069 ['curl {}/graph 2>&1 | \
70 grep Prometheus'.format(url)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000071 expr_form='pillar')
72 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030073 'Internal Prometheus page is not reachable on {} ' \
74 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000075
76
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030077@pytest.mark.usefixtures('check_prometheus')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030078def test_public_ui_prometheus(local_salt_client):
79 IP = utils.get_monitoring_ip('openstack_proxy_address')
80 protocol = 'https'
81 port = '15010'
82 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000083 result = local_salt_client.cmd(
84 'keystone:server',
85 'cmd.run',
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030086 ['curl {}/graph 2>&1 | \
87 grep Prometheus'.format(url)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000088 expr_form='pillar')
89 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030090 'Public Prometheus page is not reachable on {} ' \
91 'from ctl nodes'.format(url)
92
93
94@pytest.mark.usefixtures('check_prometheus')
95def test_internal_ui_alert_manager(local_salt_client):
96 IP = utils.get_monitoring_ip('stacklight_monitor_address')
97 protocol = 'http'
98 port = '15011'
99 url = "{}://{}:{}".format(protocol, IP, port)
100 result = local_salt_client.cmd(
101 'keystone:server',
102 'cmd.run',
103 ['curl -s {}/ | grep Alertmanager'.format(url)],
104 expr_form='pillar')
105 assert len(result[result.keys()[0]]) != 0, \
106 'Internal AlertManager page is not reachable on {} ' \
107 'from ctl nodes'.format(url)
108
109
110@pytest.mark.usefixtures('check_prometheus')
111def test_public_ui_alert_manager(local_salt_client):
112 IP = utils.get_monitoring_ip('openstack_proxy_address')
113 protocol = 'https'
114 port = '15011'
115 url = "{}://{}:{}".format(protocol, IP, port)
116 result = local_salt_client.cmd(
117 'keystone:server',
118 'cmd.run',
119 ['curl -s {}/ | grep Alertmanager'.format(url)],
120 expr_form='pillar')
121 assert len(result[result.keys()[0]]) != 0, \
122 'Public AlertManager page is not reachable on {} ' \
123 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000124
125
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300126@pytest.mark.usefixtures('check_grafana')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300127def test_internal_ui_grafana(local_salt_client):
Oleksii Zhurba370459e2018-09-11 15:54:51 -0500128 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300129 protocol = 'http'
130 port = '15013'
131 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000132 result = local_salt_client.cmd(
133 'keystone:server',
134 'cmd.run',
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300135 ['curl {}/login 2>&1 | grep Grafana'.format(url)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000136 expr_form='pillar')
137 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300138 'Internal Grafana page is not reachable on {} ' \
139 'from ctl nodes'.format(url)
140
141
142@pytest.mark.usefixtures('check_grafana')
143def test_public_ui_grafana(local_salt_client):
144 IP = utils.get_monitoring_ip('openstack_proxy_address')
145 protocol = 'https'
146 port = '8084'
147 url = "{}://{}:{}".format(protocol, IP, port)
148 result = local_salt_client.cmd(
149 'keystone:server',
150 'cmd.run',
151 ['curl {}/login 2>&1 | grep Grafana'.format(url)],
152 expr_form='pillar')
153 assert len(result[result.keys()[0]]) != 0, \
154 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300155
156
157@pytest.mark.usefixtures('check_alerta')
158def test_internal_ui_alerta(local_salt_client):
159 IP = utils.get_monitoring_ip('stacklight_monitor_address')
160 protocol = 'http'
161 port = '15017'
162 url = "{}://{}:{}".format(protocol, IP, port)
163 result = local_salt_client.cmd(
164 'keystone:server',
165 'cmd.run',
166 ['curl {}/ 2>&1 | \
167 grep Alerta'.format(url)],
168 expr_form='pillar')
169 assert len(result[result.keys()[0]]) != 0, \
170 'Internal Alerta page is not reachable on {} from ctl nodes'.format(url)
171
172
173@pytest.mark.usefixtures('check_alerta')
174def test_public_ui_alerta(local_salt_client):
175 IP = utils.get_monitoring_ip('openstack_proxy_address')
176 protocol = 'https'
177 port = '15017'
178 url = "{}://{}:{}".format(protocol, IP, port)
179 result = local_salt_client.cmd(
180 'keystone:server',
181 'cmd.run',
182 ['curl {}/ 2>&1 | \
183 grep Alerta'.format(url)],
184 expr_form='pillar')
185 assert len(result[result.keys()[0]]) != 0, \
186 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)