Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 1 | import pytest |
| 2 | |
| 3 | |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 4 | @pytest.mark.usefixtures('check_openstack') |
| 5 | def test_ui_horizon(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 6 | IP = local_salt_client.pillar_get( |
| 7 | tgt='horizon:server', |
| 8 | param='_param:cluster_public_host') |
| 9 | if not IP: |
mkraynov | e940404 | 2018-12-04 10:42:41 +0400 | [diff] [blame] | 10 | pytest.skip("Horizon is not enabled on this environment") |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 11 | 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 Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 15 | expr_form='pillar') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 16 | assert len(result) != 0, \ |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 17 | 'Horizon login page is not reachable on {} from ctl nodes'.format( |
| 18 | IP[0]) |
| 19 | |
| 20 | |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 21 | @pytest.mark.usefixtures('check_openstack') |
| 22 | def test_public_openstack(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 23 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 24 | protocol = 'https' |
| 25 | port = '5000' |
| 26 | url = "{}://{}:{}/v3".format(protocol, IP, port) |
| 27 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 28 | tgt=ctl_nodes_pillar, |
| 29 | param='curl -k {}/ 2>&1 | \ |
| 30 | grep stable'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 31 | 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 Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 36 | @pytest.mark.usefixtures('check_kibana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 37 | def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 38 | IP = local_salt_client.pillar_get(param='_param:stacklight_log_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 39 | protocol = 'http' |
| 40 | port = '5601' |
| 41 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 42 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 43 | tgt=ctl_nodes_pillar, |
| 44 | param='curl {}/app/kibana 2>&1 | \ |
| 45 | grep loading'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 46 | expr_form='pillar') |
| 47 | assert len(result[result.keys()[0]]) != 0, \ |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 48 | 'Internal Kibana login page is not reachable on {} ' \ |
| 49 | 'from ctl nodes'.format(url) |
| 50 | |
| 51 | |
| 52 | @pytest.mark.usefixtures('check_kibana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 53 | def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 54 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 55 | protocol = 'https' |
| 56 | port = '5601' |
| 57 | url = "{}://{}:{}".format(protocol, IP, port) |
| 58 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 59 | tgt=ctl_nodes_pillar, |
| 60 | param='curl {}/app/kibana 2>&1 | \ |
| 61 | grep loading'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 62 | 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 Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 66 | |
| 67 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 68 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 69 | def test_internal_ui_prometheus(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 70 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 71 | protocol = 'http' |
| 72 | port = '15010' |
| 73 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 74 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 75 | tgt=ctl_nodes_pillar, |
| 76 | param='curl {}/graph 2>&1 | \ |
| 77 | grep Prometheus'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 78 | expr_form='pillar') |
| 79 | assert len(result[result.keys()[0]]) != 0, \ |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 80 | 'Internal Prometheus page is not reachable on {} ' \ |
| 81 | 'from ctl nodes'.format(url) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 82 | |
| 83 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 84 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 85 | def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 86 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 87 | protocol = 'https' |
| 88 | port = '15010' |
| 89 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 90 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 91 | tgt=ctl_nodes_pillar, |
| 92 | param='curl {}/graph 2>&1 | \ |
| 93 | grep Prometheus'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 94 | expr_form='pillar') |
| 95 | assert len(result[result.keys()[0]]) != 0, \ |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 96 | 'Public Prometheus page is not reachable on {} ' \ |
| 97 | 'from ctl nodes'.format(url) |
| 98 | |
| 99 | |
| 100 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 101 | def test_internal_ui_alert_manager(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 102 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 103 | protocol = 'http' |
| 104 | port = '15011' |
| 105 | url = "{}://{}:{}".format(protocol, IP, port) |
| 106 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 107 | tgt=ctl_nodes_pillar, |
| 108 | param='curl -s {}/ | grep Alertmanager'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 109 | 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') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 116 | def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 117 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 118 | protocol = 'https' |
| 119 | port = '15011' |
| 120 | url = "{}://{}:{}".format(protocol, IP, port) |
| 121 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 122 | tgt=ctl_nodes_pillar, |
| 123 | param='curl -s {}/ | grep Alertmanager'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 124 | 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 Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 128 | |
| 129 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame] | 130 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 131 | def test_internal_ui_grafana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 132 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 133 | protocol = 'http' |
| 134 | port = '15013' |
| 135 | url = "{}://{}:{}".format(protocol, IP, port) |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 136 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 137 | tgt=ctl_nodes_pillar, |
| 138 | param='curl {}/login 2>&1 | grep Grafana'.format(url), |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 139 | expr_form='pillar') |
| 140 | assert len(result[result.keys()[0]]) != 0, \ |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 141 | 'Internal Grafana page is not reachable on {} ' \ |
| 142 | 'from ctl nodes'.format(url) |
| 143 | |
| 144 | |
| 145 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 146 | def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 147 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 148 | protocol = 'https' |
| 149 | port = '8084' |
| 150 | url = "{}://{}:{}".format(protocol, IP, port) |
| 151 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 152 | tgt=ctl_nodes_pillar, |
| 153 | param='curl {}/login 2>&1 | grep Grafana'.format(url), |
Ievgeniia Zadorozhna | 09b1ae8 | 2019-01-28 13:06:01 +0300 | [diff] [blame] | 154 | expr_form='pillar') |
| 155 | assert len(result[result.keys()[0]]) != 0, \ |
| 156 | 'Public Grafana page is not reachable on {} from ctl nodes'.format(url) |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 157 | |
| 158 | |
| 159 | @pytest.mark.usefixtures('check_alerta') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 160 | def test_internal_ui_alerta(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 161 | IP = local_salt_client.pillar_get(param='_param:stacklight_monitor_address') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 162 | protocol = 'http' |
| 163 | port = '15017' |
| 164 | url = "{}://{}:{}".format(protocol, IP, port) |
| 165 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 166 | tgt=ctl_nodes_pillar, |
| 167 | param='curl {}/ 2>&1 | \ |
| 168 | grep Alerta'.format(url), |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 169 | 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') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 175 | def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar): |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 176 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 177 | protocol = 'https' |
| 178 | port = '15017' |
| 179 | url = "{}://{}:{}".format(protocol, IP, port) |
| 180 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 181 | tgt=ctl_nodes_pillar, |
| 182 | param='curl {}/ 2>&1 | \ |
| 183 | grep Alerta'.format(url), |
Ievgeniia Zadorozhna | df243ef | 2018-11-08 18:17:17 +0300 | [diff] [blame] | 184 | expr_form='pillar') |
| 185 | assert len(result[result.keys()[0]]) != 0, \ |
| 186 | 'Public Alerta page is not reachable on {} from ctl nodes'.format(url) |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 187 | |
| 188 | |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame^] | 189 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 190 | @pytest.mark.usefixtures('check_drivetrain') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 191 | def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar): |
| 192 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 193 | protocol = 'https' |
| 194 | port = '8081' |
| 195 | url = "{}://{}:{}".format(protocol, IP, port) |
| 196 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 197 | tgt=ctl_nodes_pillar, |
| 198 | param='curl -k {}/ 2>&1 | \ |
| 199 | grep Authentication'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 200 | 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 | |
Oleksii Zhurba | bcb27cd | 2019-04-23 17:04:20 -0500 | [diff] [blame^] | 205 | @pytest.mark.usefixtures('check_openstack') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 206 | @pytest.mark.usefixtures('check_drivetrain') |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 207 | def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar): |
| 208 | IP = local_salt_client.pillar_get(param='_param:cluster_public_host') |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 209 | protocol = 'https' |
| 210 | port = '8070' |
| 211 | url = "{}://{}:{}".format(protocol, IP, port) |
| 212 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 213 | tgt=ctl_nodes_pillar, |
| 214 | param='curl -k {}/ 2>&1 | \ |
| 215 | grep "Gerrit Code Review"'.format(url), |
Oleksii Zhurba | 25215d9 | 2019-01-31 16:35:57 -0600 | [diff] [blame] | 216 | expr_form='pillar') |
| 217 | assert len(result[result.keys()[0]]) != 0, \ |
| 218 | 'Public Gerrit page is not reachable on {} from ctl nodes'.format(url) |