blob: 5e6ccdb71d412264f99a88ade3c13c0136a6b940 [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')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020019 assert len(result) != 0, (
20 'Horizon login page is not reachable on {} from ctl nodes.'.format(IP))
Oleksii Zhurba020fab42017-11-01 20:13:28 +000021
22
Oleksii Zhurba23c18332019-05-09 18:53:40 -050023@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060024@pytest.mark.usefixtures('check_openstack')
25def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030026 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050027 proto = local_salt_client.pillar_get(
28 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060029 port = '5000'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -050030 url = "{}://{}:{}/v3".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060031 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030032 tgt=ctl_nodes_pillar,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020033 param='curl -k {}/ 2>&1 | grep stable'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060034 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020035 assert len(result[result.keys()[0]]) != 0, (
36 'Public Openstack url is not reachable on {} from ctl '
37 'nodes'.format(url)
38 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060039
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,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020055 param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000056 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020057 assert len(result[result.keys()[0]]) != 0, (
58 'Internal Kibana login page is not reachable on {} from ctl '
59 'nodes'.format(url)
60 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060061
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,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020073 param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060074 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020075 assert len(result[result.keys()[0]]) != 0, (
76 'Public Kibana login page is not reachable on {} from ctl '
77 'nodes'.format(url)
78 )
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,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020092 param='curl {}/graph 2>&1 | grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000093 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020094 assert len(result[result.keys()[0]]) != 0, (
95 'Internal Prometheus page is not reachable on {} from ctl '
96 'nodes'.format(url)
97 )
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,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200110 param='curl -k {}/graph 2>&1 | grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000111 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200112 assert len(result[result.keys()[0]]) != 0, (
113 'Public Prometheus page is not reachable on {} from ctl '
114 'nodes'.format(url)
115 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600116
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')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200131 assert len(result[result.keys()[0]]) != 0, (
132 'Internal AlertManager page is not reachable on {} from ctl '
133 'nodes'.format(url)
134 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600135
136
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500137@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600138@pytest.mark.usefixtures('check_prometheus')
139def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300140 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500141 proto = local_salt_client.pillar_get(
142 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600143 port = '15011'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500144 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600145 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300146 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500147 param='curl -k -s {}/ | grep Alertmanager'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600148 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200149 assert len(result[result.keys()[0]]) != 0, (
150 'Public AlertManager page is not reachable on {} '
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600151 'from ctl nodes'.format(url)
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200152 )
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000153
154
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500155@pytest.mark.sl_dup
156#stacklight-pytest?
157@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300158@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600159def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300160 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600161 protocol = 'http'
162 port = '15013'
163 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000164 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300165 tgt=ctl_nodes_pillar,
166 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000167 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200168 assert len(result[result.keys()[0]]) != 0, (
169 'Internal Grafana page is not reachable on {} '
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600170 'from ctl nodes'.format(url)
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200171 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600172
173
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500174@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600175@pytest.mark.usefixtures('check_grafana')
176def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300177 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500178 proto = local_salt_client.pillar_get(
179 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600180 port = '8084'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500181 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600182 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300183 tgt=ctl_nodes_pillar,
Oleksii Zhurba612ce7c2019-06-19 14:56:34 -0500184 param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600185 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200186 assert len(result[result.keys()[0]]) != 0, (
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600187 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200188 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600189
190
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500191@pytest.mark.sl_dup
192#stacklight-pytest?
193@pytest.mark.full
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600194@pytest.mark.usefixtures('check_alerta')
195def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300196 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600197 protocol = 'http'
198 port = '15017'
199 url = "{}://{}:{}".format(protocol, IP, port)
200 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300201 tgt=ctl_nodes_pillar,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200202 param='curl {}/ 2>&1 | grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600203 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200204 assert len(result[result.keys()[0]]) != 0, (
205 'Internal Alerta page is not reachable on {} from '
206 'ctl nodes'.format(url)
207 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600208
209
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500210@pytest.mark.smoke
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600211@pytest.mark.usefixtures('check_alerta')
212def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300213 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500214 proto = local_salt_client.pillar_get(
215 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600216 port = '15017'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500217 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600218 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300219 tgt=ctl_nodes_pillar,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200220 param='curl -k {}/ 2>&1 | grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600221 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200222 assert len(result[result.keys()[0]]) != 0, (
223 'Public Alerta page is not reachable on {} from ctl nodes'.format(url))
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600224
225
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500226@pytest.mark.smoke
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300227@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600228@pytest.mark.usefixtures('check_drivetrain')
229def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300230 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500231 proto = local_salt_client.pillar_get(
232 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600233 port = '8081'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500234 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600235 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300236 tgt=ctl_nodes_pillar,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200237 param='curl -k {}/ 2>&1 | grep Authentication'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600238 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200239 assert len(result[result.keys()[0]]) != 0, (
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600240 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200241 )
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600242
243
Oleksii Zhurba23c18332019-05-09 18:53:40 -0500244@pytest.mark.smoke
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300245@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600246@pytest.mark.usefixtures('check_drivetrain')
247def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300248 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500249 proto = local_salt_client.pillar_get(
250 param='_param:cluster_public_protocol')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600251 port = '8070'
Oleksii Zhurba7d4f07e2019-06-10 17:30:53 -0500252 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600253 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300254 tgt=ctl_nodes_pillar,
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200255 param='curl -k {}/ 2>&1 | grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600256 expr_form='pillar')
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +0200257 assert len(result[result.keys()[0]]) != 0, (
258 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url))