Port all changes from github
Change-Id: Ie78388290ad2780074327c26508cdce73805f0da
diff --git a/cvp_checks/tests/test_stacklight.py b/cvp_checks/tests/test_stacklight.py
index d554a91..f63b233 100644
--- a/cvp_checks/tests/test_stacklight.py
+++ b/cvp_checks/tests/test_stacklight.py
@@ -10,11 +10,14 @@
'pillar.get',
['_param:haproxy_elasticsearch_bind_host'],
expr_form='pillar')
+ proxies = {"http": None, "https": None}
for node in salt_output.keys():
IP = salt_output[node]
- assert requests.get('http://{}:9200/'.format(IP)).status_code == 200, \
+ assert requests.get('http://{}:9200/'.format(IP),
+ proxies=proxies).status_code == 200, \
'Cannot check elasticsearch url on {}.'.format(IP)
- resp = requests.get('http://{}:9200/_cat/health'.format(IP)).content
+ resp = requests.get('http://{}:9200/_cat/health'.format(IP),
+ proxies=proxies).content
assert resp.split()[3] == 'green', \
'elasticsearch status is not good {}'.format(
json.dumps(resp, indent=4))
@@ -42,8 +45,10 @@
['_param:haproxy_elasticsearch_bind_host'],
expr_form='pillar')
IP = salt_output.values()[0]
+ proxies = {"http": None, "https": None}
resp = json.loads(requests.post('http://{0}:9200/log-{1}/_search?pretty'.
format(IP, today),
+ proxies=proxies,
data='{"size": 0, "aggs": '
'{"uniq_hostname": '
'{"terms": {"size": 500, '
@@ -124,3 +129,15 @@
assert 'NOT OK' not in result.values(), \
'''Some containers are in incorrect state:
{}'''.format(json.dumps(result, indent=4))
+
+
+def test_running_telegraf_services(local_salt_client):
+ salt_output = local_salt_client.cmd('telegraf:agent',
+ 'service.status',
+ 'telegraf',
+ expr_form='pillar')
+ result = [{node: status} for node, status
+ in salt_output.items()
+ if status is False]
+ assert result == [], 'Telegraf service is not running ' \
+ 'on following nodes:'.format(result)