blob: 441b13cdc877a68abffefc560e6a50efb81a6a62 [file] [log] [blame]
Sergey Galkinea5a9ae2019-11-18 15:15:07 +04001import requests
Oleksii Zhurba020fab42017-11-01 20:13:28 +00002import pytest
3
4
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -05005@pytest.mark.smoke
Oleksii Zhurba25215d92019-01-31 16:35:57 -06006@pytest.mark.usefixtures('check_openstack')
7def test_ui_horizon(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -05008 IP = local_salt_client.pillar_get(
9 tgt='horizon:server',
10 param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050011 proto = local_salt_client.pillar_get(
12 param='_param:cluster_public_protocol')
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050013 if not IP:
mkraynove9404042018-12-04 10:42:41 +040014 pytest.skip("Horizon is not enabled on this environment")
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050015 result = local_salt_client.cmd_any(
16 tgt=ctl_nodes_pillar,
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050017 param='curl -k {0}://{1}/auth/login/ 2>&1 | \
18 grep Login'.format(proto, IP),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000019 expr_form='pillar')
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020020 assert len(result) != 0, (
21 'Horizon login page is not reachable on {} from ctl nodes.'.format(IP))
Oleksii Zhurba020fab42017-11-01 20:13:28 +000022
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')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030026def test_public_openstack(local_salt_client):
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(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030033 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020034 param='curl -k {}/ 2>&1 | grep stable'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030035 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030036 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020037 'Public Openstack url is not reachable on {} from ctl '
38 'nodes'.format(url)
39 )
Oleksii Zhurba25215d92019-01-31 16:35:57 -060040
41
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050042@pytest.mark.sl_dup
43#stacklight-pytest?
44@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030045@pytest.mark.usefixtures('check_kibana')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030046def test_internal_ui_kibana(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050047 IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050048 ssl = local_salt_client.pillar_get(
49 tgt='kibana:server',
50 param='haproxy:proxy:listen:kibana:binds:ssl:enabled')
51 proto = "https" if ssl == "True" else "http"
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030052 port = '5601'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050053 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000054 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030055 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020056 param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030057 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030058 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020059 'Internal Kibana login page is not reachable on {} from ctl '
60 'nodes'.format(url)
61 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030062
63
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050064@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030065@pytest.mark.usefixtures('check_kibana')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030066def test_public_ui_kibana(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050067 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050068 proto = local_salt_client.pillar_get(
69 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030070 port = '5601'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -050071 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030072 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030073 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020074 param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +030075 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030076 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020077 'Public Kibana login page is not reachable on {} from ctl '
78 'nodes'.format(url)
79 )
Oleksii Zhurba020fab42017-11-01 20:13:28 +000080
81
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -050082@pytest.mark.sl_dup
83#stacklight-pytest?
84@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +030085@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -060086def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050087 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +030088 protocol = 'http'
89 port = '15010'
90 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +000091 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -050092 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020093 param='curl {}/graph 2>&1 | grep Prometheus'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +000094 expr_form='pillar')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030095 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +020096 'Internal Prometheus page is not reachable on {} from ctl '
97 'nodes'.format(url)
98 )
Oleksii Zhurba020fab42017-11-01 20:13:28 +000099
100
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500101@pytest.mark.smoke
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300102@pytest.mark.usefixtures('check_prometheus')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300103def test_public_ui_prometheus(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500104 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400105 prometheus_password_old = local_salt_client.pillar_get(
106 param='_param:keepalived_prometheus_vip_password_generated')
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200107 prometheus_password_generated = local_salt_client.pillar_get(
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400108 param='_param:prometheus_server_proxy_password_generated')
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200109 # New password in 2019.2.7
110 prometheus_password_from_nginx = local_salt_client.pillar_get(
111 tgt="nginx:server",
112 param='_param:nginx_proxy_prometheus_server_password')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500113 proto = local_salt_client.pillar_get(
114 param='_param:cluster_public_protocol')
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400115 proxies = {"http": None, "https": None}
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200116
117 if prometheus_password_from_nginx:
118 prometheus_password = prometheus_password_from_nginx
119 elif prometheus_password_generated:
120 prometheus_password = prometheus_password_generated
121 else:
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400122 prometheus_password = prometheus_password_old
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200123
124 url = '{0}://{1}:15010/graph'.format(proto, IP)
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400125 response = requests.get(
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200126 url,
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400127 proxies=proxies,
128 auth=('prometheus', prometheus_password))
129 assert response.status_code == 200, (
130 'Issues with accessing public prometheus ui on {}:\n{}'.format(
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200131 url, response.text)
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400132 )
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300133 assert response.content.decode().find('Prometheus Time Series Collection') > -1, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200134 'Public Prometheus page is not reachable on {} from ctl '
135 'nodes'.format(url)
136 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300137
138
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500139@pytest.mark.sl_dup
140#stacklight-pytest?
141@pytest.mark.full
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300142@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600143def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500144 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300145 protocol = 'http'
146 port = '15011'
147 url = "{}://{}:{}".format(protocol, IP, port)
148 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500149 tgt=ctl_nodes_pillar,
150 param='curl -s {}/ | grep Alertmanager'.format(url),
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300151 expr_form='pillar')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300152 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200153 'Internal AlertManager page is not reachable on {} from ctl '
154 'nodes'.format(url)
155 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300156
157
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500158@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300159@pytest.mark.usefixtures('check_prometheus')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300160def test_public_ui_alert_manager(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500161 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200162 alertmanager_password_old = local_salt_client.pillar_get(
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400163 param='_param:keepalived_prometheus_vip_password_generated')
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200164 alertmanager_password_generated = local_salt_client.pillar_get(
165 param='_param:prometheus_alertmanager_proxy_password_generated')
166 # New password location in 2019.2.7
167 alertmanager_from_nginx = local_salt_client.pillar_get(
168 tgt="nginx:server",
169 param='_param:nginx_proxy_prometheus_alertmanager_password')
170
171 if alertmanager_from_nginx:
172 alertmanager_password = alertmanager_from_nginx
173 elif alertmanager_password_generated:
174 alertmanager_password = alertmanager_password_generated
175 else:
176 alertmanager_password = alertmanager_password_old
177
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500178 proto = local_salt_client.pillar_get(
179 param='_param:cluster_public_protocol')
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400180 proxies = {"http": None, "https": None}
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200181 url = '{0}://{1}:15011/'.format(proto, IP)
182
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400183 response = requests.get(
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200184 url,
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400185 proxies=proxies,
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200186 auth=('alertmanager', alertmanager_password))
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400187 assert response.status_code == 200, (
188 'Issues with accessing public alert manager ui on {}:\n{}'.format(
Hanna Arhipovafae5b5b2019-12-09 15:57:55 +0200189 url, response.text)
Sergey Galkinea5a9ae2019-11-18 15:15:07 +0400190 )
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300191 assert response.content.decode().find('<title>Alertmanager</title>') > -1, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200192 'Public AlertManager page is not reachable on {} '
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300193 'from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200194 )
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000195
196
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500197@pytest.mark.sl_dup
198#stacklight-pytest?
199@pytest.mark.full
Oleksii Zhurba8ce9fcf2018-10-05 18:38:22 +0300200@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600201def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500202 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300203 protocol = 'http'
204 port = '15013'
205 url = "{}://{}:{}".format(protocol, IP, port)
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000206 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500207 tgt=ctl_nodes_pillar,
208 param='curl {}/login 2>&1 | grep Grafana'.format(url),
Oleksii Zhurba020fab42017-11-01 20:13:28 +0000209 expr_form='pillar')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300210 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200211 'Internal Grafana page is not reachable on {} '
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300212 'from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200213 )
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300214
215
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500216@pytest.mark.smoke
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300217@pytest.mark.usefixtures('check_grafana')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300218def test_public_ui_grafana(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500219 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500220 proto = local_salt_client.pillar_get(
221 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300222 port = '8084'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500223 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300224 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300225 tgt="I@nginx:server and not I@salt:master",
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500226 param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300227 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300228 assert len(result[list(result.keys())[0]]) != 0, (
Ievgeniia Zadorozhna09b1ae82019-01-28 13:06:01 +0300229 'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200230 )
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300231
232
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500233@pytest.mark.sl_dup
234#stacklight-pytest?
235@pytest.mark.full
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300236@pytest.mark.usefixtures('check_alerta')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600237def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500238 IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300239 protocol = 'http'
240 port = '15017'
241 url = "{}://{}:{}".format(protocol, IP, port)
242 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500243 tgt=ctl_nodes_pillar,
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200244 param='curl {}/ 2>&1 | grep Alerta'.format(url),
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300245 expr_form='pillar')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300246 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200247 'Internal Alerta page is not reachable on {} from '
248 'ctl nodes'.format(url)
249 )
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300250
251
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500252@pytest.mark.smoke
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300253@pytest.mark.usefixtures('check_alerta')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300254def test_public_ui_alerta(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500255 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500256 proto = local_salt_client.pillar_get(
257 param='_param:cluster_public_protocol')
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300258 port = '15017'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500259 url = "{}://{}:{}".format(proto, IP, port)
Ievgeniia Zadorozhnadf243ef2018-11-08 18:17:17 +0300260 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300261 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200262 param='curl -k {}/ 2>&1 | grep Alerta'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300263 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300264 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200265 'Public Alerta page is not reachable on {} from ctl nodes'.format(url))
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600266
267
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500268@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500269@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600270@pytest.mark.usefixtures('check_drivetrain')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300271def test_public_ui_jenkins(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500272 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500273 proto = local_salt_client.pillar_get(
274 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600275 port = '8081'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500276 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600277 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300278 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200279 param='curl -k {}/ 2>&1 | grep Authentication'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300280 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300281 assert len(result[list(result.keys())[0]]) != 0, (
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600282 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url)
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200283 )
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600284
285
Oleksii Zhurba5b15b9b2019-05-09 18:53:40 -0500286@pytest.mark.smoke
Oleksii Zhurbabcb27cd2019-04-23 17:04:20 -0500287@pytest.mark.usefixtures('check_openstack')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600288@pytest.mark.usefixtures('check_drivetrain')
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300289def test_public_ui_gerrit(local_salt_client):
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -0500290 IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500291 proto = local_salt_client.pillar_get(
292 param='_param:cluster_public_protocol')
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600293 port = '8070'
Oleksii Zhurba85f55fe2019-06-10 17:30:53 -0500294 url = "{}://{}:{}".format(proto, IP, port)
Oleksii Zhurba25215d92019-01-31 16:35:57 -0600295 result = local_salt_client.cmd(
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300296 tgt="I@nginx:server and not I@salt:master",
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200297 param='curl -k {}/ 2>&1 | grep "Gerrit Code Review"'.format(url),
Hanna Arhipovae53b38b2021-07-05 18:53:35 +0300298 expr_form='compound')
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +0300299 assert len(result[list(result.keys())[0]]) != 0, (
Dmitriy Kruglova34a3042019-08-20 11:45:35 +0200300 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url))