Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 1 | import requests |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 2 | import pytest |
| 3 | |
| 4 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 5 | @pytest.mark.smoke |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 6 | @pytest.mark.usefixtures('check_openstack') |
| 7 | def test_ui_horizon(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 8 | IP = local_salt_client.pillar_get( |
| 9 | tgt='horizon:server', |
| 10 | param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 11 | proto = local_salt_client.pillar_get( |
| 12 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 13 | if not IP: |
mkraynov | e940404 | 2018-12-04 10:42:41 +0400 | [diff] [blame] | 14 | pytest.skip("Horizon is not enabled on this environment") |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 15 | result = local_salt_client.cmd_any( |
| 16 | tgt=ctl_nodes_pillar, |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 17 | param='curl -k {0}://{1}/auth/login/ 2>&1 | \ |
| 18 | grep Login'.format(proto, IP), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 19 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 20 | assert len(result) != 0, ( |
| 21 | 'Horizon login page is not reachable on {} from ctl nodes.'.format(IP)) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 22 | |
| 23 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 24 | @pytest.mark.smoke |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 25 | @pytest.mark.usefixtures('check_openstack') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 26 | def test_public_openstack(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 27 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 28 | proto = local_salt_client.pillar_get( |
| 29 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 30 | port = '5000' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 31 | url = "{}://{}:{}/v3".format(proto, IP, port) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 32 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 33 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 34 | param='curl -k {}/ 2>&1 | grep stable'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 35 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 36 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 37 | 'Public Openstack url is not reachable on {} from ctl ' |
| 38 | 'nodes'.format(url) |
| 39 | ) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 40 | |
| 41 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 42 | @pytest.mark.sl_dup |
| 43 | #stacklight-pytest? |
| 44 | @pytest.mark.full |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 45 | @pytest.mark.usefixtures('check_kibana') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 46 | def test_internal_ui_kibana(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 47 | IP = local_salt_client.pillar_get(param='_param:stacklight_log_address') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 48 | 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 Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 52 | port = '5601' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 53 | url = "{}://{}:{}".format(proto, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 54 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 55 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 56 | param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 57 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 58 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 59 | 'Internal Kibana login page is not reachable on {} from ctl ' |
| 60 | 'nodes'.format(url) |
| 61 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 62 | |
| 63 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 64 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 65 | @pytest.mark.usefixtures('check_kibana') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 66 | def test_public_ui_kibana(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 67 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 68 | proto = local_salt_client.pillar_get( |
| 69 | param='_param:cluster_public_protocol') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 70 | port = '5601' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 71 | url = "{}://{}:{}".format(proto, IP, port) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 72 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 73 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 74 | param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 75 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 76 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 77 | 'Public Kibana login page is not reachable on {} from ctl ' |
| 78 | 'nodes'.format(url) |
| 79 | ) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 80 | |
| 81 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 82 | @pytest.mark.sl_dup |
| 83 | #stacklight-pytest? |
| 84 | @pytest.mark.full |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 85 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 86 | def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 87 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 88 | protocol = 'http' |
| 89 | port = '15010' |
| 90 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 91 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 92 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 93 | param='curl {}/graph 2>&1 | grep Prometheus'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 94 | expr_form='pillar') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 95 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 96 | 'Internal Prometheus page is not reachable on {} from ctl ' |
| 97 | 'nodes'.format(url) |
| 98 | ) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 99 | |
| 100 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 101 | @pytest.mark.smoke |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 102 | @pytest.mark.usefixtures('check_prometheus') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 103 | def test_public_ui_prometheus(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 104 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 105 | prometheus_password_old = local_salt_client.pillar_get( |
| 106 | param='_param:keepalived_prometheus_vip_password_generated') |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 107 | prometheus_password_generated = local_salt_client.pillar_get( |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 108 | param='_param:prometheus_server_proxy_password_generated') |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 109 | # 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 Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 113 | proto = local_salt_client.pillar_get( |
| 114 | param='_param:cluster_public_protocol') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 115 | proxies = {"http": None, "https": None} |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 116 | |
| 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 Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 122 | prometheus_password = prometheus_password_old |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 123 | |
| 124 | url = '{0}://{1}:15010/graph'.format(proto, IP) |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 125 | response = requests.get( |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 126 | url, |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 127 | proxies=proxies, |
| 128 | auth=('prometheus', prometheus_password)) |
| 129 | assert response.status_code == 200, ( |
| 130 | 'Issues with accessing public prometheus ui on {}:\n{}'.format( |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 131 | url, response.text) |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 132 | ) |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 133 | assert response.content.decode().find('Prometheus Time Series Collection') > -1, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 134 | 'Public Prometheus page is not reachable on {} from ctl ' |
| 135 | 'nodes'.format(url) |
| 136 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 137 | |
| 138 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 139 | @pytest.mark.sl_dup |
| 140 | #stacklight-pytest? |
| 141 | @pytest.mark.full |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 142 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 143 | def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 144 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 145 | protocol = 'http' |
| 146 | port = '15011' |
| 147 | url = "{}://{}:{}".format(protocol, IP, port) |
| 148 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 149 | tgt=ctl_nodes_pillar, |
| 150 | param='curl -s {}/ | grep Alertmanager'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 151 | expr_form='pillar') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 152 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 153 | 'Internal AlertManager page is not reachable on {} from ctl ' |
| 154 | 'nodes'.format(url) |
| 155 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 156 | |
| 157 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 158 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 159 | @pytest.mark.usefixtures('check_prometheus') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 160 | def test_public_ui_alert_manager(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 161 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 162 | alertmanager_password_old = local_salt_client.pillar_get( |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 163 | param='_param:keepalived_prometheus_vip_password_generated') |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 164 | 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 Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 178 | proto = local_salt_client.pillar_get( |
| 179 | param='_param:cluster_public_protocol') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 180 | proxies = {"http": None, "https": None} |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 181 | url = '{0}://{1}:15011/'.format(proto, IP) |
| 182 | |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 183 | response = requests.get( |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 184 | url, |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 185 | proxies=proxies, |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 186 | auth=('alertmanager', alertmanager_password)) |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 187 | assert response.status_code == 200, ( |
| 188 | 'Issues with accessing public alert manager ui on {}:\n{}'.format( |
Hanna Arhipova | fae5b5b | 2019-12-09 15:57:55 +0200 | [diff] [blame] | 189 | url, response.text) |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame] | 190 | ) |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 191 | assert response.content.decode().find('<title>Alertmanager</title>') > -1, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 192 | 'Public AlertManager page is not reachable on {} ' |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 193 | 'from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 194 | ) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 195 | |
| 196 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 197 | @pytest.mark.sl_dup |
| 198 | #stacklight-pytest? |
| 199 | @pytest.mark.full |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 200 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 201 | def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 202 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 203 | protocol = 'http' |
| 204 | port = '15013' |
| 205 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 206 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 207 | tgt=ctl_nodes_pillar, |
| 208 | param='curl {}/login 2>&1 | grep Grafana'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 209 | expr_form='pillar') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 210 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 211 | 'Internal Grafana page is not reachable on {} ' |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 212 | 'from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 213 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 214 | |
| 215 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 216 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 217 | @pytest.mark.usefixtures('check_grafana') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 218 | def test_public_ui_grafana(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 219 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 220 | proto = local_salt_client.pillar_get( |
| 221 | param='_param:cluster_public_protocol') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 222 | port = '8084' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 223 | url = "{}://{}:{}".format(proto, IP, port) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 224 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 225 | tgt="I@nginx:server and not I@salt:master", |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 226 | param='curl -k {}/login 2>&1 | grep Grafana'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 227 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 228 | assert len(result[list(result.keys())[0]]) != 0, ( |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 229 | 'Public Grafana page is not reachable on {} from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 230 | ) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 231 | |
| 232 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 233 | @pytest.mark.sl_dup |
| 234 | #stacklight-pytest? |
| 235 | @pytest.mark.full |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 236 | @pytest.mark.usefixtures('check_alerta') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 237 | def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 238 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 239 | protocol = 'http' |
| 240 | port = '15017' |
| 241 | url = "{}://{}:{}".format(protocol, IP, port) |
| 242 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 243 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 244 | param='curl {}/ 2>&1 | grep Alerta'.format(url), |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 245 | expr_form='pillar') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 246 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 247 | 'Internal Alerta page is not reachable on {} from ' |
| 248 | 'ctl nodes'.format(url) |
| 249 | ) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 250 | |
| 251 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 252 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 253 | @pytest.mark.usefixtures('check_alerta') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 254 | def test_public_ui_alerta(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 255 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 256 | proto = local_salt_client.pillar_get( |
| 257 | param='_param:cluster_public_protocol') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 258 | port = '15017' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 259 | url = "{}://{}:{}".format(proto, IP, port) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 260 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 261 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 262 | param='curl -k {}/ 2>&1 | grep Alerta'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 263 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 264 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 265 | 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 266 | |
| 267 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 268 | @pytest.mark.smoke |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame] | 269 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 270 | @pytest.mark.usefixtures('check_drivetrain') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 271 | def test_public_ui_jenkins(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 272 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 273 | proto = local_salt_client.pillar_get( |
| 274 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 275 | port = '8081' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 276 | url = "{}://{}:{}".format(proto, IP, port) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 277 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 278 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 279 | param='curl -k {}/ 2>&1 | grep Authentication'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 280 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 281 | assert len(result[list(result.keys())[0]]) != 0, ( |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 282 | 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 283 | ) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 284 | |
| 285 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 286 | @pytest.mark.smoke |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame] | 287 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 288 | @pytest.mark.usefixtures('check_drivetrain') |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 289 | def test_public_ui_gerrit(local_salt_client): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 290 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 291 | proto = local_salt_client.pillar_get( |
| 292 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 293 | port = '8070' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 294 | url = "{}://{}:{}".format(proto, IP, port) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 295 | result = local_salt_client.cmd( |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 296 | tgt="I@nginx:server and not I@salt:master", |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 297 | param='curl -k {}/ 2>&1 | grep "Gerrit Code Review"'.format(url), |
Hanna Arhipova | e53b38b | 2021-07-05 18:53:35 +0300 | [diff] [blame^] | 298 | expr_form='compound') |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 299 | assert len(result[list(result.keys())[0]]) != 0, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 300 | 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)) |