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') |
| 26 | def test_public_openstack(local_salt_client, ctl_nodes_pillar): |
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( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 33 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 34 | param='curl -k {}/ 2>&1 | grep stable'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 35 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 36 | assert len(result[result.keys()[0]]) != 0, ( |
| 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') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 46 | def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar): |
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( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 55 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 56 | param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 57 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 58 | assert len(result[result.keys()[0]]) != 0, ( |
| 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') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 66 | def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar): |
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( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 73 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 74 | param='curl -k {}/app/kibana 2>&1 | grep loading'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 75 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 76 | assert len(result[result.keys()[0]]) != 0, ( |
| 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') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 95 | assert len(result[result.keys()[0]]) != 0, ( |
| 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') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 103 | def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar): |
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') |
| 107 | prometheus_password = local_salt_client.pillar_get( |
| 108 | param='_param:prometheus_server_proxy_password_generated') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 109 | proto = local_salt_client.pillar_get( |
| 110 | param='_param:cluster_public_protocol') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame^] | 111 | proxies = {"http": None, "https": None} |
| 112 | if prometheus_password == '': |
| 113 | prometheus_password = prometheus_password_old |
| 114 | response = requests.get( |
| 115 | '{0}://{1}:15010/graph'.format(proto, IP), |
| 116 | proxies=proxies, |
| 117 | auth=('prometheus', prometheus_password)) |
| 118 | assert response.status_code == 200, ( |
| 119 | 'Issues with accessing public prometheus ui on {}:\n{}'.format( |
| 120 | IP, response.text) |
| 121 | ) |
| 122 | assert response.content.find('Prometheus Time Series Collection') > -1, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 123 | 'Public Prometheus page is not reachable on {} from ctl ' |
| 124 | 'nodes'.format(url) |
| 125 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 126 | |
| 127 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 128 | @pytest.mark.sl_dup |
| 129 | #stacklight-pytest? |
| 130 | @pytest.mark.full |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 131 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 132 | def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 133 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 134 | protocol = 'http' |
| 135 | port = '15011' |
| 136 | url = "{}://{}:{}".format(protocol, IP, port) |
| 137 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 138 | tgt=ctl_nodes_pillar, |
| 139 | param='curl -s {}/ | grep Alertmanager'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 140 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 141 | assert len(result[result.keys()[0]]) != 0, ( |
| 142 | 'Internal AlertManager page is not reachable on {} from ctl ' |
| 143 | 'nodes'.format(url) |
| 144 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 145 | |
| 146 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 147 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 148 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 149 | def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 150 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame^] | 151 | alermanager_password_old = local_salt_client.pillar_get( |
| 152 | param='_param:keepalived_prometheus_vip_password_generated') |
| 153 | alermanager_password = local_salt_client.pillar_get( |
| 154 | param='_param:prometheus_alermanager_proxy_password_generated') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 155 | proto = local_salt_client.pillar_get( |
| 156 | param='_param:cluster_public_protocol') |
Sergey Galkin | ea5a9ae | 2019-11-18 15:15:07 +0400 | [diff] [blame^] | 157 | proxies = {"http": None, "https": None} |
| 158 | if alermanager_password == '': |
| 159 | alermanager_password = alermanager_password_old |
| 160 | response = requests.get( |
| 161 | '{0}://{1}:15011/'.format(proto, IP), |
| 162 | proxies=proxies, |
| 163 | auth=('alertmanager', alermanager_password)) |
| 164 | assert response.status_code == 200, ( |
| 165 | 'Issues with accessing public alert manager ui on {}:\n{}'.format( |
| 166 | IP, response.text) |
| 167 | ) |
| 168 | assert response.content.find('<title>Alertmanager</title>') > -1, ( |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 169 | 'Public AlertManager page is not reachable on {} ' |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 170 | 'from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 171 | ) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 172 | |
| 173 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 174 | @pytest.mark.sl_dup |
| 175 | #stacklight-pytest? |
| 176 | @pytest.mark.full |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 177 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 178 | def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 179 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 180 | protocol = 'http' |
| 181 | port = '15013' |
| 182 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 183 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 184 | tgt=ctl_nodes_pillar, |
| 185 | param='curl {}/login 2>&1 | grep Grafana'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 186 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 187 | assert len(result[result.keys()[0]]) != 0, ( |
| 188 | 'Internal Grafana page is not reachable on {} ' |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 189 | 'from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 190 | ) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 191 | |
| 192 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 193 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 194 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 195 | def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 196 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 197 | proto = local_salt_client.pillar_get( |
| 198 | param='_param:cluster_public_protocol') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 199 | port = '8084' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 200 | url = "{}://{}:{}".format(proto, IP, port) |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 201 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 202 | tgt=ctl_nodes_pillar, |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 203 | param='curl -k {}/login 2>&1 | grep Grafana'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 204 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 205 | assert len(result[result.keys()[0]]) != 0, ( |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 206 | 'Public Grafana page is not reachable on {} from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 207 | ) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 208 | |
| 209 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 210 | @pytest.mark.sl_dup |
| 211 | #stacklight-pytest? |
| 212 | @pytest.mark.full |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 213 | @pytest.mark.usefixtures('check_alerta') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 214 | def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 215 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 216 | protocol = 'http' |
| 217 | port = '15017' |
| 218 | url = "{}://{}:{}".format(protocol, IP, port) |
| 219 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 220 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 221 | param='curl {}/ 2>&1 | grep Alerta'.format(url), |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 222 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 223 | assert len(result[result.keys()[0]]) != 0, ( |
| 224 | 'Internal Alerta page is not reachable on {} from ' |
| 225 | 'ctl nodes'.format(url) |
| 226 | ) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 227 | |
| 228 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 229 | @pytest.mark.smoke |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 230 | @pytest.mark.usefixtures('check_alerta') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 231 | def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 232 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 233 | proto = local_salt_client.pillar_get( |
| 234 | param='_param:cluster_public_protocol') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 235 | port = '15017' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 236 | url = "{}://{}:{}".format(proto, IP, port) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 237 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 238 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 239 | param='curl -k {}/ 2>&1 | grep Alerta'.format(url), |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 240 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 241 | assert len(result[result.keys()[0]]) != 0, ( |
| 242 | 'Public Alerta page is not reachable on {} from ctl nodes'.format(url)) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 243 | |
| 244 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 245 | @pytest.mark.smoke |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame] | 246 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 247 | @pytest.mark.usefixtures('check_drivetrain') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 248 | def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar): |
| 249 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 250 | proto = local_salt_client.pillar_get( |
| 251 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 252 | port = '8081' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 253 | url = "{}://{}:{}".format(proto, IP, port) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 254 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 255 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 256 | param='curl -k {}/ 2>&1 | grep Authentication'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 257 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 258 | assert len(result[result.keys()[0]]) != 0, ( |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 259 | 'Public Jenkins page is not reachable on {} from ctl nodes'.format(url) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 260 | ) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 261 | |
| 262 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 263 | @pytest.mark.smoke |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame] | 264 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 265 | @pytest.mark.usefixtures('check_drivetrain') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 266 | def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar): |
| 267 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 268 | proto = local_salt_client.pillar_get( |
| 269 | param='_param:cluster_public_protocol') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 270 | port = '8070' |
Oleksii Zhurba | 85f55fe | 2019-06-10 17:30:53 -0500 | [diff] [blame] | 271 | url = "{}://{}:{}".format(proto, IP, port) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 272 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 273 | tgt=ctl_nodes_pillar, |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 274 | param='curl -k {}/ 2>&1 | grep "Gerrit Code Review"'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 275 | expr_form='pillar') |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 276 | assert len(result[result.keys()[0]]) != 0, ( |
| 277 | 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)) |