blob: ee022327e3838643201487a9077d5d0abc55b015 [file] [log] [blame]
Oleksii Zhurba020fab42017-11-01 20:13:28 +00001from cvp_checks import utils
2import pytest
3
4
5def test_ui_horizon(local_salt_client):
6 salt_output = local_salt_client.cmd(
7 'horizon:server',
8 'pillar.get',
Oleksii Zhurbae37cdab2017-11-02 20:00:03 +00009 ['_param:cluster_public_host'],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000010 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 Zhurba8ce9fcf2018-10-05 18:38:22 +030024@pytest.mark.usefixtures('check_kibana')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000025def 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 Zhurba8ce9fcf2018-10-05 18:38:22 +030037@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000038def test_ui_prometheus(local_salt_client):
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050039 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000040 result = local_salt_client.cmd(
41 'keystone:server',
42 'cmd.run',
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050043 ['curl http://{}:15010/graph 2>&1 | \
44 grep Prometheus'.format(IP)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000045 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 Zhurba8ce9fcf2018-10-05 18:38:22 +030050@pytest.mark.usefixtures('check_prometheus')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000051def test_ui_alert_manager(local_salt_client):
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050052 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000053 result = local_salt_client.cmd(
54 'keystone:server',
55 'cmd.run',
Oleksii Zhurbab31323f2017-11-20 15:35:19 -060056 ['curl -s http://{}:15011/ | grep Alertmanager'.format(IP)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000057 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 Zhurba8ce9fcf2018-10-05 18:38:22 +030062@pytest.mark.usefixtures('check_grafana')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000063def 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)