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 | |
| 24 | def test_ui_kibana(local_salt_client): |
| 25 | IP = utils.get_monitoring_ip('stacklight_log_address') |
| 26 | result = local_salt_client.cmd( |
| 27 | 'keystone:server', |
| 28 | 'cmd.run', |
| 29 | ['curl http://{}:5601/app/kibana 2>&1 | \ |
| 30 | grep loading'.format(IP)], |
| 31 | expr_form='pillar') |
| 32 | assert len(result[result.keys()[0]]) != 0, \ |
| 33 | 'Kibana login page is not reachable on {} from ctl nodes'.format(IP) |
| 34 | |
| 35 | |
| 36 | def test_ui_prometheus(local_salt_client): |
| 37 | pytest.skip("This test doesn't work. Skipped") |
| 38 | IP = utils.get_monitoring_ip('keepalived_prometheus_vip_address') |
| 39 | result = local_salt_client.cmd( |
| 40 | 'keystone:server', |
| 41 | 'cmd.run', |
| 42 | ['curl http://{}:15010/ 2>&1 | \ |
| 43 | grep loading'.format(IP)], |
| 44 | expr_form='pillar') |
| 45 | assert len(result[result.keys()[0]]) != 0, \ |
| 46 | 'Prometheus page is not reachable on {} from ctl nodes'.format(IP) |
| 47 | |
| 48 | |
| 49 | def test_ui_alert_manager(local_salt_client): |
| 50 | IP = utils.get_monitoring_ip('cluster_public_host') |
| 51 | result = local_salt_client.cmd( |
| 52 | 'keystone:server', |
| 53 | 'cmd.run', |
Oleksii Zhurba | b31323f | 2017-11-20 15:35:19 -0600 | [diff] [blame^] | 54 | ['curl -s http://{}:15011/ | grep Alertmanager'.format(IP)], |
Oleksii Zhurba | 020fab4 | 2017-11-01 20:13:28 +0000 | [diff] [blame] | 55 | expr_form='pillar') |
| 56 | assert len(result[result.keys()[0]]) != 0, \ |
| 57 | 'AlertManager page is not reachable on {} from ctl nodes'.format(IP) |
| 58 | |
| 59 | |
| 60 | def test_ui_grafana(local_salt_client): |
| 61 | IP = utils.get_monitoring_ip('cluster_public_host') |
| 62 | result = local_salt_client.cmd( |
| 63 | 'keystone:server', |
| 64 | 'cmd.run', |
| 65 | ['curl http://{}:15013/login 2>&1 | grep Grafana'.format(IP)], |
| 66 | expr_form='pillar') |
| 67 | assert len(result[result.keys()[0]]) != 0, \ |
| 68 | 'Grafana page is not reachable on {} from ctl nodes'.format(IP) |