Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 1 | from cvp_checks import utils |
| 2 | import pytest |
| 3 | |
| 4 | |
| 5 | def test_ui_horizon(local_salt_client): |
| 6 | salt_output = local_salt_client.cmd( |
| 7 | 'horizon:server', |
| 8 | 'pillar.get', |
Oleksii Zhurba | e37cdab | 2017-11-02 20:00:03 +0000 | [diff] [blame] | 9 | ['_param:cluster_public_host'], |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 10 | expr_form='pillar') |
| 11 | IP = [salt_output[node] for node in salt_output |
| 12 | if salt_output[node]] |
| 13 | result = local_salt_client.cmd( |
| 14 | 'keystone:server', |
| 15 | 'cmd.run', |
| 16 | ['curl --insecure https://{}/auth/login/ 2>&1 | \ |
| 17 | grep Login'.format(IP[0])], |
| 18 | expr_form='pillar') |
| 19 | assert len(result[result.keys()[0]]) != 0, \ |
| 20 | 'Horizon login page is not reachable on {} from ctl nodes'.format( |
| 21 | IP[0]) |
| 22 | |
| 23 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame^] | 24 | @pytest.mark.usefixtures('check_kibana') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 25 | def test_ui_kibana(local_salt_client): |
| 26 | IP = utils.get_monitoring_ip('stacklight_log_address') |
| 27 | result = local_salt_client.cmd( |
| 28 | 'keystone:server', |
| 29 | 'cmd.run', |
| 30 | ['curl http://{}:5601/app/kibana 2>&1 | \ |
| 31 | grep loading'.format(IP)], |
| 32 | expr_form='pillar') |
| 33 | assert len(result[result.keys()[0]]) != 0, \ |
| 34 | 'Kibana login page is not reachable on {} from ctl nodes'.format(IP) |
| 35 | |
| 36 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame^] | 37 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 38 | def test_ui_prometheus(local_salt_client): |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame] | 39 | IP = utils.get_monitoring_ip('stacklight_monitor_address') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 40 | result = local_salt_client.cmd( |
| 41 | 'keystone:server', |
| 42 | 'cmd.run', |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame] | 43 | ['curl http://{}:15010/graph 2>&1 | \ |
| 44 | grep Prometheus'.format(IP)], |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 45 | expr_form='pillar') |
| 46 | assert len(result[result.keys()[0]]) != 0, \ |
| 47 | 'Prometheus page is not reachable on {} from ctl nodes'.format(IP) |
| 48 | |
| 49 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame^] | 50 | @pytest.mark.usefixtures('check_prometheus') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 51 | def test_ui_alert_manager(local_salt_client): |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame] | 52 | IP = utils.get_monitoring_ip('stacklight_monitor_address') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 53 | result = local_salt_client.cmd( |
| 54 | 'keystone:server', |
| 55 | 'cmd.run', |
Oleksii Zhurba | b31323f | 2017-11-20 15:35:19 -0600 | [diff] [blame] | 56 | ['curl -s http://{}:15011/ | grep Alertmanager'.format(IP)], |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 57 | expr_form='pillar') |
| 58 | assert len(result[result.keys()[0]]) != 0, \ |
| 59 | 'AlertManager page is not reachable on {} from ctl nodes'.format(IP) |
| 60 | |
| 61 | |
Oleksii Zhurba | 8ce9fcf | 2018-10-05 18:38:22 +0300 | [diff] [blame^] | 62 | @pytest.mark.usefixtures('check_grafana') |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 63 | def test_ui_grafana(local_salt_client): |
| 64 | IP = utils.get_monitoring_ip('cluster_public_host') |
| 65 | result = local_salt_client.cmd( |
| 66 | 'keystone:server', |
| 67 | 'cmd.run', |
| 68 | ['curl http://{}:15013/login 2>&1 | grep Grafana'.format(IP)], |
| 69 | expr_form='pillar') |
| 70 | assert len(result[result.keys()[0]]) != 0, \ |
| 71 | 'Grafana page is not reachable on {} from ctl nodes'.format(IP) |