blob: 0c65451069ddb7acffda398d8ba14136810c0691 [file] [log] [blame]
Oleksii Zhurba020fab42017-11-01 20:13:28 +00001import pytest
2
3
Oleksii Zhurba25215d92019-01-31 16:35:57 -06004@pytest.mark.usefixtures('check_openstack')
5def test_ui_horizon(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -05006 IP = local_salt_client.pillar_get(
7 tgt='horizon:server',
8 param='_param:cluster_public_host')
9 if not IP:
mkraynove9404042018-12-04 10:42:41 +040010 pytest.skip("Horizon is not enabled on this environment")
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050011 result = local_salt_client.cmd_any(
12 tgt=ctl_nodes_pillar,
13 param='curl --insecure https://{}/auth/login/ 2>&1 | \
14 grep Login'.format(IP),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000015 expr_form='pillar')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050016 assert len(result) != 0, \
Oleksii Zhurba020fab42017-11-01 20:13:28 +000017 'Horizon login page is not reachable on {} from ctl nodes'.format(
18 IP[0])
19
20
Oleksii Zhurba25215d92019-01-31 16:35:57 -060021@pytest.mark.usefixtures('check_openstack')
22def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050023 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060024 protocol = 'https'
25 port = '5000'
26 url = "{}://{}:{}/v3".format(protocol, IP, port)
27 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050028 tgt=ctl_nodes_pillar,
29 param='curl -k {}/ 2>&1 | \
30 grep stable'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -060031 expr_form='pillar')
32 assert len(result[result.keys()[0]]) != 0, \
33 'Public Openstack url is not reachable on {} from ctl nodes'.format(url)
34
35
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030036@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060037def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050038 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030039 protocol = 'http'
40 port = '5601'
41 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000042 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050043 tgt=ctl_nodes_pillar,
44 param='curl {}/app/kibana 2>&1 | \
45 grep loading'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000046 expr_form='pillar')
47 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030048 'Internal Kibana login page is not reachable on {} ' \
49 'from ctl nodes'.format(url)
50
51
52@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060053def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050054 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030055 protocol = 'https'
56 port = '5601'
57 url = "{}://{}:{}".format(protocol, IP, port)
58 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050059 tgt=ctl_nodes_pillar,
60 param='curl {}/app/kibana 2>&1 | \
61 grep loading'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030062 expr_form='pillar')
63 assert len(result[result.keys()[0]]) != 0, \
64 'Public Kibana login page is not reachable on {} ' \
65 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000066
67
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030068@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060069def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050070 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030071 protocol = 'http'
72 port = '15010'
73 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000074 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050075 tgt=ctl_nodes_pillar,
76 param='curl {}/graph 2>&1 | \
77 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000078 expr_form='pillar')
79 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030080 'Internal Prometheus page is not reachable on {} ' \
81 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000082
83
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030084@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060085def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050086 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030087 protocol = 'https'
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 'Public Prometheus page is not reachable on {} ' \
97 'from ctl nodes'.format(url)
98
99
100@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600101def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500102 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300103 protocol = 'http'
104 port = '15011'
105 url = "{}://{}:{}".format(protocol, IP, port)
106 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500107 tgt=ctl_nodes_pillar,
108 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300109 expr_form='pillar')
110 assert len(result[result.keys()[0]]) != 0, \
111 'Internal AlertManager page is not reachable on {} ' \
112 'from ctl nodes'.format(url)
113
114
115@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600116def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500117 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300118 protocol = 'https'
119 port = '15011'
120 url = "{}://{}:{}".format(protocol, IP, port)
121 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500122 tgt=ctl_nodes_pillar,
123 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300124 expr_form='pillar')
125 assert len(result[result.keys()[0]]) != 0, \
126 'Public AlertManager page is not reachable on {} ' \
127 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000128
129
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300130@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600131def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500132 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300133 protocol = 'http'
134 port = '15013'
135 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000136 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500137 tgt=ctl_nodes_pillar,
138 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000139 expr_form='pillar')
140 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300141 'Internal Grafana page is not reachable on {} ' \
142 'from ctl nodes'.format(url)
143
144
145@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600146def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500147 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300148 protocol = 'https'
149 port = '8084'
150 url = "{}://{}:{}".format(protocol, IP, port)
151 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500152 tgt=ctl_nodes_pillar,
153 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300154 expr_form='pillar')
155 assert len(result[result.keys()[0]]) != 0, \
156 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300157
158
159@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600160def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500161 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300162 protocol = 'http'
163 port = '15017'
164 url = "{}://{}:{}".format(protocol, IP, port)
165 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500166 tgt=ctl_nodes_pillar,
167 param='curl {}/ 2>&1 | \
168 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300169 expr_form='pillar')
170 assert len(result[result.keys()[0]]) != 0, \
171 'Internal Alerta page is not reachable on {} from ctl nodes'.format(url)
172
173
174@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600175def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500176 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300177 protocol = 'https'
178 port = '15017'
179 url = "{}://{}:{}".format(protocol, IP, port)
180 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500181 tgt=ctl_nodes_pillar,
182 param='curl {}/ 2>&1 | \
183 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300184 expr_form='pillar')
185 assert len(result[result.keys()[0]]) != 0, \
186 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600187
188
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500189@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600190@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500191def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
192 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600193 protocol = 'https'
194 port = '8081'
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 -k {}/ 2>&1 | \
199 grep Authentication'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600200 expr_form='pillar')
201 assert len(result[result.keys()[0]]) != 0, \
202 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
203
204
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500205@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600206@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500207def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
208 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600209 protocol = 'https'
210 port = '8070'
211 url = "{}://{}:{}".format(protocol, IP, port)
212 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500213 tgt=ctl_nodes_pillar,
214 param='curl -k {}/ 2>&1 | \
215 grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600216 expr_form='pillar')
217 assert len(result[result.keys()[0]]) != 0, \
218 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)