blob: d8e6a32ceb380a0e54c79148318d30e947dc2450 [file] [log] [blame]
Oleksii Zhurba020fab42017-11-01 20:13:28 +00001import pytest
2
3
Oleksii Zhurba23c18332019-05-09 18:53:40 -05004@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -06005@pytest.mark.usefixtures('check_openstack')
6def test_ui_horizon(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +03007 IP = local_salt_client.pillar_get(
8 tgt='horizon:server',
9 param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050010 proto = local_salt_client.pillar_get(
11 param='_param:cluster_public_protocol')
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030012 if not IP:
mkraynove9404042018-12-04 10:42:41 +040013 pytest.skip("Horizon is not enabled on this environment")
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030014 result = local_salt_client.cmd_any(
15 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -050016 param='curl -k {0}://{1}/auth/login/ 2>&1 | \
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050017 grep Login'.format(proto, IP),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000018 expr_form='pillar')
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030019 assert len(result) != 0, \
Oleksii Zhurba020fab42017-11-01 20:13:28 +000020 'Horizon login page is not reachable on {} from ctl nodes'.format(
21 IP[0])
22
23
Oleksii Zhurba23c18332019-05-09 18:53:40 -050024@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060025@pytest.mark.usefixtures('check_openstack')
26def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030027 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050028 proto = local_salt_client.pillar_get(
29 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060030 port = '5000'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050031 url = "{}://{}:{}/v3".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060032 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030033 tgt=ctl_nodes_pillar,
34 param='curl -k {}/ 2>&1 | \
35 grep stable'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060036 expr_form='pillar')
37 assert len(result[result.keys()[0]]) != 0, \
38 'Public Openstack url is not reachable on {} from ctl nodes'.format(url)
39
40
Oleksii Zhurba23c18332019-05-09 18:53:40 -050041@pytest.mark.sl_dup
42#stacklight-pytest?
43@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030044@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060045def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030046 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050047 ssl = local_salt_client.pillar_get(
48 tgt='kibana:server',
49 param='haproxy:proxy:listen:kibana:binds:ssl:enabled')
50 proto = "https" if ssl == "True" else "http"
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060051 port = '5601'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050052 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000053 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030054 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -050055 param='curl -k {}/app/kibana 2>&1 | \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030056 grep loading'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000057 expr_form='pillar')
58 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060059 'Internal Kibana login page is not reachable on {} ' \
60 'from ctl nodes'.format(url)
61
62
Oleksii Zhurba23c18332019-05-09 18:53:40 -050063@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060064@pytest.mark.usefixtures('check_kibana')
65def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030066 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050067 proto = local_salt_client.pillar_get(
68 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060069 port = '5601'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050070 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060071 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030072 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -050073 param='curl -k {}/app/kibana 2>&1 | \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030074 grep loading'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060075 expr_form='pillar')
76 assert len(result[result.keys()[0]]) != 0, \
77 'Public Kibana login page is not reachable on {} ' \
78 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000079
80
Oleksii Zhurba23c18332019-05-09 18:53:40 -050081@pytest.mark.sl_dup
82#stacklight-pytest?
83@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030084@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060085def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030086 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060087 protocol = 'http'
88 port = '15010'
89 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000090 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030091 tgt=ctl_nodes_pillar,
92 param='curl {}/graph 2>&1 | \
93 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000094 expr_form='pillar')
95 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060096 'Internal Prometheus page is not reachable on {} ' \
97 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000098
99
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500100@pytest.mark.smoke
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300101@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600102def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300103 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500104 proto = local_salt_client.pillar_get(
105 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600106 port = '15010'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500107 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000108 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300109 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500110 param='curl -k {}/graph 2>&1 | \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300111 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000112 expr_form='pillar')
113 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600114 'Public Prometheus page is not reachable on {} ' \
115 'from ctl nodes'.format(url)
116
117
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500118@pytest.mark.sl_dup
119#stacklight-pytest?
120@pytest.mark.full
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600121@pytest.mark.usefixtures('check_prometheus')
122def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300123 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600124 protocol = 'http'
125 port = '15011'
126 url = "{}://{}:{}".format(protocol, IP, port)
127 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300128 tgt=ctl_nodes_pillar,
129 param='curl -s {}/ | grep Alertmanager'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600130 expr_form='pillar')
131 assert len(result[result.keys()[0]]) != 0, \
132 'Internal AlertManager page is not reachable on {} ' \
133 'from ctl nodes'.format(url)
134
135
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500136@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600137@pytest.mark.usefixtures('check_prometheus')
138def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300139 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500140 proto = local_salt_client.pillar_get(
141 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600142 port = '15011'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500143 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600144 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300145 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500146 param='curl -k -s {}/ | grep Alertmanager'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600147 expr_form='pillar')
148 assert len(result[result.keys()[0]]) != 0, \
149 'Public AlertManager page is not reachable on {} ' \
150 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000151
152
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500153@pytest.mark.sl_dup
154#stacklight-pytest?
155@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300156@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600157def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300158 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600159 protocol = 'http'
160 port = '15013'
161 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000162 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300163 tgt=ctl_nodes_pillar,
164 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000165 expr_form='pillar')
166 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600167 'Internal Grafana page is not reachable on {} ' \
168 'from ctl nodes'.format(url)
169
170
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500171@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600172@pytest.mark.usefixtures('check_grafana')
173def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300174 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500175 proto = local_salt_client.pillar_get(
176 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600177 port = '8084'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500178 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600179 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300180 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500181 param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600182 expr_form='pillar')
183 assert len(result[result.keys()[0]]) != 0, \
184 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
185
186
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500187@pytest.mark.sl_dup
188#stacklight-pytest?
189@pytest.mark.full
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600190@pytest.mark.usefixtures('check_alerta')
191def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300192 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600193 protocol = 'http'
194 port = '15017'
195 url = "{}://{}:{}".format(protocol, IP, port)
196 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300197 tgt=ctl_nodes_pillar,
198 param='curl {}/ 2>&1 | \
199 grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600200 expr_form='pillar')
201 assert len(result[result.keys()[0]]) != 0, \
202 'Internal Alerta page is not reachable on {} from ctl nodes'.format(url)
203
204
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500205@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600206@pytest.mark.usefixtures('check_alerta')
207def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300208 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500209 proto = local_salt_client.pillar_get(
210 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600211 port = '15017'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500212 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600213 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300214 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500215 param='curl -k {}/ 2>&1 | \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300216 grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600217 expr_form='pillar')
218 assert len(result[result.keys()[0]]) != 0, \
219 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)
220
221
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500222@pytest.mark.smoke
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300223@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600224@pytest.mark.usefixtures('check_drivetrain')
225def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300226 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500227 proto = local_salt_client.pillar_get(
228 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600229 port = '8081'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500230 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600231 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300232 tgt=ctl_nodes_pillar,
233 param='curl -k {}/ 2>&1 | \
234 grep Authentication'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600235 expr_form='pillar')
236 assert len(result[result.keys()[0]]) != 0, \
237 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
238
239
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500240@pytest.mark.smoke
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300241@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600242@pytest.mark.usefixtures('check_drivetrain')
243def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300244 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500245 proto = local_salt_client.pillar_get(
246 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600247 port = '8070'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500248 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600249 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300250 tgt=ctl_nodes_pillar,
251 param='curl -k {}/ 2>&1 | \
252 grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600253 expr_form='pillar')
254 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500255 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)