blob: 0c65451069ddb7acffda398d8ba14136810c0691 [file] [log] [blame]
Oleksii Zhurba020fab42017-11-01 20:13:28 +00001import pytest
2
3
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -06004@pytest.mark.usefixtures('check_openstack')
5def test_ui_horizon(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +03006 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")
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030011 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')
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030016 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 Zhurba2c2dc942019-01-31 16:35:57 -060021@pytest.mark.usefixtures('check_openstack')
22def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030023 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060024 protocol = 'https'
25 port = '5000'
26 url = "{}://{}:{}/v3".format(protocol, IP, port)
27 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030028 tgt=ctl_nodes_pillar,
29 param='curl -k {}/ 2>&1 | \
30 grep stable'.format(url),
Oleksii Zhurba2c2dc942019-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 Zhurba2c2dc942019-01-31 16:35:57 -060037def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030038 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060039 protocol = 'http'
40 port = '5601'
41 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000042 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030043 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, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060048 'Internal Kibana login page is not reachable on {} ' \
49 'from ctl nodes'.format(url)
50
51
52@pytest.mark.usefixtures('check_kibana')
53def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030054 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060055 protocol = 'https'
56 port = '5601'
57 url = "{}://{}:{}".format(protocol, IP, port)
58 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030059 tgt=ctl_nodes_pillar,
60 param='curl {}/app/kibana 2>&1 | \
61 grep loading'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060062 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 Zhurba2c2dc942019-01-31 16:35:57 -060069def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030070 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060071 protocol = 'http'
72 port = '15010'
73 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000074 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030075 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, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060080 '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 Zhurba2c2dc942019-01-31 16:35:57 -060085def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030086 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -060087 protocol = 'https'
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 'Public Prometheus page is not reachable on {} ' \
97 'from ctl nodes'.format(url)
98
99
100@pytest.mark.usefixtures('check_prometheus')
101def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300102 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600103 protocol = 'http'
104 port = '15011'
105 url = "{}://{}:{}".format(protocol, IP, port)
106 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300107 tgt=ctl_nodes_pillar,
108 param='curl -s {}/ | grep Alertmanager'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600109 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')
116def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300117 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600118 protocol = 'https'
119 port = '15011'
120 url = "{}://{}:{}".format(protocol, IP, port)
121 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300122 tgt=ctl_nodes_pillar,
123 param='curl -s {}/ | grep Alertmanager'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600124 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 Zhurba2c2dc942019-01-31 16:35:57 -0600131def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300132 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600133 protocol = 'http'
134 port = '15013'
135 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000136 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300137 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, \
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600141 'Internal Grafana page is not reachable on {} ' \
142 'from ctl nodes'.format(url)
143
144
145@pytest.mark.usefixtures('check_grafana')
146def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300147 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600148 protocol = 'https'
149 port = '8084'
150 url = "{}://{}:{}".format(protocol, IP, port)
151 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300152 tgt=ctl_nodes_pillar,
153 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600154 expr_form='pillar')
155 assert len(result[result.keys()[0]]) != 0, \
156 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
157
158
159@pytest.mark.usefixtures('check_alerta')
160def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300161 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600162 protocol = 'http'
163 port = '15017'
164 url = "{}://{}:{}".format(protocol, IP, port)
165 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300166 tgt=ctl_nodes_pillar,
167 param='curl {}/ 2>&1 | \
168 grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600169 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')
175def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300176 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600177 protocol = 'https'
178 port = '15017'
179 url = "{}://{}:{}".format(protocol, IP, port)
180 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300181 tgt=ctl_nodes_pillar,
182 param='curl {}/ 2>&1 | \
183 grep Alerta'.format(url),
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600184 expr_form='pillar')
185 assert len(result[result.keys()[0]]) != 0, \
186 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)
187
188
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300189@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600190@pytest.mark.usefixtures('check_drivetrain')
191def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300192 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600193 protocol = 'https'
194 port = '8081'
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 -k {}/ 2>&1 | \
199 grep Authentication'.format(url),
Oleksii Zhurba2c2dc942019-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
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300205@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba2c2dc942019-01-31 16:35:57 -0600206@pytest.mark.usefixtures('check_drivetrain')
207def test_public_ui_gerrit(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 Zhurba2c2dc942019-01-31 16:35:57 -0600209 protocol = 'https'
210 port = '8070'
211 url = "{}://{}:{}".format(protocol, IP, port)
212 result = local_salt_client.cmd(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +0300213 tgt=ctl_nodes_pillar,
214 param='curl -k {}/ 2>&1 | \
215 grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba2c2dc942019-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)