blob: 69c0f6a984b43b6890af7f99950200522419e690 [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
24def 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
36def test_ui_prometheus(local_salt_client):
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050037 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000038 result = local_salt_client.cmd(
39 'keystone:server',
40 'cmd.run',
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050041 ['curl http://{}:15010/graph 2>&1 | \
42 grep Prometheus'.format(IP)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000043 expr_form='pillar')
44 assert len(result[result.keys()[0]]) != 0, \
45 'Prometheus page is not reachable on {} from ctl nodes'.format(IP)
46
47
48def test_ui_alert_manager(local_salt_client):
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050049 IP = utils.get_monitoring_ip('stacklight_monitor_address')
Oleksii Zhurba020fab42017-11-01 20:13:28 +000050 result = local_salt_client.cmd(
51 'keystone:server',
52 'cmd.run',
Oleksii Zhurbab31323f2017-11-20 15:35:19 -060053 ['curl -s http://{}:15011/ | grep Alertmanager'.format(IP)],
Oleksii Zhurba020fab42017-11-01 20:13:28 +000054 expr_form='pillar')
55 assert len(result[result.keys()[0]]) != 0, \
56 'AlertManager page is not reachable on {} from ctl nodes'.format(IP)
57
58
59def test_ui_grafana(local_salt_client):
60 IP = utils.get_monitoring_ip('cluster_public_host')
61 result = local_salt_client.cmd(
62 'keystone:server',
63 'cmd.run',
64 ['curl http://{}:15013/login 2>&1 | grep Grafana'.format(IP)],
65 expr_form='pillar')
66 assert len(result[result.keys()[0]]) != 0, \
67 'Grafana page is not reachable on {} from ctl nodes'.format(IP)