blob: 565da42e7160b3c878ee9fa152418dcdb24c06ea [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',
9 ['_param:openstack_proxy_address'],
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
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):
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
49def 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',
54 ['curl http://{}:15011/ 2>&1 | grep AlertManager'.format(IP)],
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
60def 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)