blob: 40ff1206b8a43d1c8f316517224f2343e483139a [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')
10 if not IP:
mkraynove9404042018-12-04 10:42:41 +040011 pytest.skip("Horizon is not enabled on this environment")
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050012 result = local_salt_client.cmd_any(
13 tgt=ctl_nodes_pillar,
14 param='curl --insecure https://{}/auth/login/ 2>&1 | \
15 grep Login'.format(IP),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000016 expr_form='pillar')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050017 assert len(result) != 0, \
Oleksii Zhurba020fab42017-11-01 20:13:28 +000018 'Horizon login page is not reachable on {} from ctl nodes'.format(
19 IP[0])
20
21
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050022@pytest.mark.smoke
Oleksii Zhurba25215d92019-01-31 16:35:57 -060023@pytest.mark.usefixtures('check_openstack')
24def test_public_openstack(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050025 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060026 protocol = 'https'
27 port = '5000'
28 url = "{}://{}:{}/v3".format(protocol, IP, port)
29 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050030 tgt=ctl_nodes_pillar,
31 param='curl -k {}/ 2>&1 | \
32 grep stable'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -060033 expr_form='pillar')
34 assert len(result[result.keys()[0]]) != 0, \
35 'Public Openstack url is not reachable on {} from ctl nodes'.format(url)
36
37
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050038@pytest.mark.sl_dup
39#stacklight-pytest?
40@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030041@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060042def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050043 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030044 protocol = 'http'
45 port = '5601'
46 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000047 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050048 tgt=ctl_nodes_pillar,
49 param='curl {}/app/kibana 2>&1 | \
50 grep loading'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000051 expr_form='pillar')
52 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030053 'Internal Kibana login page is not reachable on {} ' \
54 'from ctl nodes'.format(url)
55
56
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050057@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030058@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060059def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050060 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030061 protocol = 'https'
62 port = '5601'
63 url = "{}://{}:{}".format(protocol, IP, port)
64 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050065 tgt=ctl_nodes_pillar,
66 param='curl {}/app/kibana 2>&1 | \
67 grep loading'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030068 expr_form='pillar')
69 assert len(result[result.keys()[0]]) != 0, \
70 'Public Kibana login page is not reachable on {} ' \
71 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000072
73
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050074@pytest.mark.sl_dup
75#stacklight-pytest?
76@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030077@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060078def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050079 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030080 protocol = 'http'
81 port = '15010'
82 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000083 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050084 tgt=ctl_nodes_pillar,
85 param='curl {}/graph 2>&1 | \
86 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000087 expr_form='pillar')
88 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030089 'Internal Prometheus page is not reachable on {} ' \
90 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000091
92
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050093@pytest.mark.smoke
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030094@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060095def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050096 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030097 protocol = 'https'
98 port = '15010'
99 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000100 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500101 tgt=ctl_nodes_pillar,
102 param='curl {}/graph 2>&1 | \
103 grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000104 expr_form='pillar')
105 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300106 'Public Prometheus page is not reachable on {} ' \
107 'from ctl nodes'.format(url)
108
109
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500110@pytest.mark.sl_dup
111#stacklight-pytest?
112@pytest.mark.full
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300113@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600114def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500115 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300116 protocol = 'http'
117 port = '15011'
118 url = "{}://{}:{}".format(protocol, IP, port)
119 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500120 tgt=ctl_nodes_pillar,
121 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300122 expr_form='pillar')
123 assert len(result[result.keys()[0]]) != 0, \
124 'Internal AlertManager page is not reachable on {} ' \
125 'from ctl nodes'.format(url)
126
127
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500128@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300129@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600130def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500131 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300132 protocol = 'https'
133 port = '15011'
134 url = "{}://{}:{}".format(protocol, IP, port)
135 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500136 tgt=ctl_nodes_pillar,
137 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300138 expr_form='pillar')
139 assert len(result[result.keys()[0]]) != 0, \
140 'Public AlertManager page is not reachable on {} ' \
141 'from ctl nodes'.format(url)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000142
143
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500144@pytest.mark.sl_dup
145#stacklight-pytest?
146@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300147@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600148def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500149 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300150 protocol = 'http'
151 port = '15013'
152 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000153 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500154 tgt=ctl_nodes_pillar,
155 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000156 expr_form='pillar')
157 assert len(result[result.keys()[0]]) != 0, \
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300158 'Internal Grafana page is not reachable on {} ' \
159 'from ctl nodes'.format(url)
160
161
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500162@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300163@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600164def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500165 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300166 protocol = 'https'
167 port = '8084'
168 url = "{}://{}:{}".format(protocol, IP, port)
169 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500170 tgt=ctl_nodes_pillar,
171 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300172 expr_form='pillar')
173 assert len(result[result.keys()[0]]) != 0, \
174 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300175
176
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500177@pytest.mark.sl_dup
178#stacklight-pytest?
179@pytest.mark.full
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300180@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600181def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500182 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300183 protocol = 'http'
184 port = '15017'
185 url = "{}://{}:{}".format(protocol, IP, port)
186 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500187 tgt=ctl_nodes_pillar,
188 param='curl {}/ 2>&1 | \
189 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300190 expr_form='pillar')
191 assert len(result[result.keys()[0]]) != 0, \
192 'Internal Alerta page is not reachable on {} from ctl nodes'.format(url)
193
194
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500195@pytest.mark.smoke
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300196@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600197def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500198 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300199 protocol = 'https'
200 port = '15017'
201 url = "{}://{}:{}".format(protocol, IP, port)
202 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500203 tgt=ctl_nodes_pillar,
204 param='curl {}/ 2>&1 | \
205 grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300206 expr_form='pillar')
207 assert len(result[result.keys()[0]]) != 0, \
208 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600209
210
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500211@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500212@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600213@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500214def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
215 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600216 protocol = 'https'
217 port = '8081'
218 url = "{}://{}:{}".format(protocol, IP, port)
219 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500220 tgt=ctl_nodes_pillar,
221 param='curl -k {}/ 2>&1 | \
222 grep Authentication'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600223 expr_form='pillar')
224 assert len(result[result.keys()[0]]) != 0, \
225 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
226
227
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500228@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500229@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600230@pytest.mark.usefixtures('check_drivetrain')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500231def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
232 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600233 protocol = 'https'
234 port = '8070'
235 url = "{}://{}:{}".format(protocol, IP, port)
236 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500237 tgt=ctl_nodes_pillar,
238 param='curl -k {}/ 2>&1 | \
239 grep "Gerrit Code Review"'.format(url),
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600240 expr_form='pillar')
241 assert len(result[result.keys()[0]]) != 0, \
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500242 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)