blob: 5e6ccdb71d412264f99a88ade3c13c0136a6b940 [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')
Dmitriy Kruglova34a3042019-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 Zhurba5b15b9b2019-05-09 18:53:40 -050023@pytest.mark.smoke
Oleksii Zhurba25215d92019-01-31 16:35:57 -060024@pytest.mark.usefixtures('check_openstack')
25def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050026 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050027 proto = local_salt_client.pillar_get(
28 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060029 port = '5000'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050030 url = "{}://{}:{}/v3".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -060031 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050032 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020033 param='curl -k {}/ 2>&1 | grep stable'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -060034 expr_form='pillar')
Dmitriy Kruglova34a3042019-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 Zhurba25215d92019-01-31 16:35:57 -060039
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,
Dmitriy Kruglova34a3042019-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 Kruglova34a3042019-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 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030061
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,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020073 param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030074 expr_form='pillar')
Dmitriy Kruglova34a3042019-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 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,
Dmitriy Kruglova34a3042019-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 Kruglova34a3042019-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 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,
Dmitriy Kruglova34a3042019-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 Kruglova34a3042019-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 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300116
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')
Dmitriy Kruglova34a3042019-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 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300135
136
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500137@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300138@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600139def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500140 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500141 proto = local_salt_client.pillar_get(
142 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300143 port = '15011'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500144 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300145 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500146 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500147 param='curl -k -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300148 expr_form='pillar')
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200149 assert len(result[result.keys()[0]]) != 0, (
150 'Public AlertManager page is not reachable on {} '
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300151 'from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200152 )
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000153
154
Oleksii Zhurba5b15b9b2019-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 Zhurba25215d92019-01-31 16:35:57 -0600159def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500160 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300161 protocol = 'http'
162 port = '15013'
163 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000164 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500165 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 Kruglova34a3042019-08-20 11:45:35 +0200168 assert len(result[result.keys()[0]]) != 0, (
169 'Internal Grafana page is not reachable on {} '
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300170 'from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200171 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300172
173
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500174@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300175@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600176def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500177 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500178 proto = local_salt_client.pillar_get(
179 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300180 port = '8084'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500181 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300182 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500183 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500184 param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300185 expr_form='pillar')
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200186 assert len(result[result.keys()[0]]) != 0, (
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300187 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200188 )
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300189
190
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500191@pytest.mark.sl_dup
192#stacklight-pytest?
193@pytest.mark.full
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300194@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600195def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500196 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300197 protocol = 'http'
198 port = '15017'
199 url = "{}://{}:{}".format(protocol, IP, port)
200 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500201 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200202 param='curl {}/ 2>&1 | grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300203 expr_form='pillar')
Dmitriy Kruglova34a3042019-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 )
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300208
209
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500210@pytest.mark.smoke
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300211@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600212def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500213 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500214 proto = local_salt_client.pillar_get(
215 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300216 port = '15017'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500217 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300218 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500219 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200220 param='curl -k {}/ 2>&1 | grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300221 expr_form='pillar')
Dmitriy Kruglova34a3042019-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 Zhurba25215d92019-01-31 16:35:57 -0600224
225
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500226@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500227@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600228@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500229def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
230 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500231 proto = local_salt_client.pillar_get(
232 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600233 port = '8081'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500234 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600235 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500236 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200237 param='curl -k {}/ 2>&1 | grep Authentication'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600238 expr_form='pillar')
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200239 assert len(result[result.keys()[0]]) != 0, (
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600240 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200241 )
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600242
243
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500244@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500245@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600246@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500247def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
248 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500249 proto = local_salt_client.pillar_get(
250 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600251 port = '8070'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500252 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600253 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500254 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200255 param='curl -k {}/ 2>&1 | grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600256 expr_form='pillar')
Dmitriy Kruglova34a3042019-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))