blob: 22e4a7fb0bff0b9767584effbdba0f1045c386a0 [file] [log] [blame]
Oleksii Zhurba020fab42017-11-01 20:13:28 +00001import pytest
2
3
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -05004@pytest.mark.smoke
Oleksii Zhurba25215d92019-01-31 16:35:57 -06005@pytest.mark.usefixtures('check_openstack')
6def test_ui_horizon(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -05007 IP = local_salt_client.pillar_get(
8 tgt='horizon:server',
9 param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050010 proto = local_salt_client.pillar_get(
11 param='_param:cluster_public_protocol')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050012 if not IP:
mkraynove9404042018-12-04 10:42:41 +040013 pytest.skip("Horizon is not enabled on this environment")
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050014 result = local_salt_client.cmd_any(
15 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050016 param='curl -k {0}://{1}/auth/login/ 2>&1 | \
17 grep Login'.format(proto, IP),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000018 expr_form='pillar')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050019 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 Zhurba5b15b9b2019-05-09 18:53:40 -050024@pytest.mark.smoke
Oleksii Zhurba25215d92019-01-31 16:35:57 -060025@pytest.mark.usefixtures('check_openstack')
26def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050027 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050028 proto = local_salt_client.pillar_get(
29 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060030 port = '5000'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050031 url = "{}://{}:{}/v3".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -060032 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050033 tgt=ctl_nodes_pillar,
34 param='curl -k {}/ 2>&1 | \
35 grep stable'.format(url),
Oleksii Zhurba25215d92019-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 Zhurba5b15b9b2019-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 Zhurba25215d92019-01-31 16:35:57 -060045def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050046 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Oleksii Zhurba85f55fe2019-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"
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030051 port = '5601'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050052 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000053 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050054 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050055 param='curl -k {}/app/kibana 2>&1 | \
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050056 grep loading'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000057 expr_form='pillar')
58 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030059 'Internal Kibana login page is not reachable on {} ' \
60 'from ctl nodes'.format(url)
61
62
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050063@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030064@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060065def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050066 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050067 proto = local_salt_client.pillar_get(
68 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030069 port = '5601'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050070 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030071 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050072 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050073 param='curl -k {}/app/kibana 2>&1 | \
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050074 grep loading'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030075 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 Zhurba5b15b9b2019-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 Zhurba25215d92019-01-31 16:35:57 -060085def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050086 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030087 protocol = 'http'
88 port = '15010'
89 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000090 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050091 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, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030096 'Internal Prometheus page is not reachable on {} ' \
97 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000098
99
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500100@pytest.mark.smoke
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300101@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600102def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500103 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500104 proto = local_salt_client.pillar_get(
105 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300106 port = '15010'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500107 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000108 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500109 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500110 param='curl -k {}/graph 2>&1 | \
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500111 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000112 expr_form='pillar')
113 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300114 'Public Prometheus page is not reachable on {} ' \
115 'from ctl nodes'.format(url)
116
117
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500118@pytest.mark.sl_dup
119#stacklight-pytest?
120@pytest.mark.full
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300121@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600122def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500123 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300124 protocol = 'http'
125 port = '15011'
126 url = "{}://{}:{}".format(protocol, IP, port)
127 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500128 tgt=ctl_nodes_pillar,
129 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300130 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 Zhurba5b15b9b2019-05-09 18:53:40 -0500136@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300137@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600138def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500139 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500140 proto = local_salt_client.pillar_get(
141 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300142 port = '15011'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500143 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300144 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500145 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500146 param='curl -k -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300147 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 Zhurba5b15b9b2019-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 Zhurba25215d92019-01-31 16:35:57 -0600157def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500158 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300159 protocol = 'http'
160 port = '15013'
161 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000162 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500163 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, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300167 'Internal Grafana page is not reachable on {} ' \
168 'from ctl nodes'.format(url)
169
170
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500171@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300172@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600173def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500174 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500175 proto = local_salt_client.pillar_get(
176 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300177 port = '8084'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500178 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300179 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500180 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500181 param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300182 expr_form='pillar')
183 assert len(result[result.keys()[0]]) != 0, \
184 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300185
186
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500187@pytest.mark.sl_dup
188#stacklight-pytest?
189@pytest.mark.full
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300190@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600191def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500192 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300193 protocol = 'http'
194 port = '15017'
195 url = "{}://{}:{}".format(protocol, IP, port)
196 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500197 tgt=ctl_nodes_pillar,
198 param='curl {}/ 2>&1 | \
199 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300200 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 Zhurba5b15b9b2019-05-09 18:53:40 -0500205@pytest.mark.smoke
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300206@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600207def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500208 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500209 proto = local_salt_client.pillar_get(
210 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300211 port = '15017'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500212 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300213 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500214 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500215 param='curl -k {}/ 2>&1 | \
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500216 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300217 expr_form='pillar')
218 assert len(result[result.keys()[0]]) != 0, \
219 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600220
221
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500222@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500223@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600224@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500225def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
226 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500227 proto = local_salt_client.pillar_get(
228 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600229 port = '8081'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500230 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600231 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500232 tgt=ctl_nodes_pillar,
233 param='curl -k {}/ 2>&1 | \
234 grep Authentication'.format(url),
Oleksii Zhurba25215d92019-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 Zhurba5b15b9b2019-05-09 18:53:40 -0500240@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500241@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600242@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500243def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
244 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500245 proto = local_salt_client.pillar_get(
246 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600247 port = '8070'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500248 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600249 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500250 tgt=ctl_nodes_pillar,
251 param='curl -k {}/ 2>&1 | \
252 grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600253 expr_form='pillar')
254 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500255 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)