[CVP] Refactor salt client class
Change-Id: I91cfffe1c8d5df0224657ce9e36be9063b56f0b3
Related-PROD: PROD-28981
Related-PROD: PROD-28729
Related-PROD: PROD-28624
Related-PROD: PROD-29286
diff --git a/test_set/cvp-sanity/tests/test_oss.py b/test_set/cvp-sanity/tests/test_oss.py
index 58a4151..a9623db 100644
--- a/test_set/cvp-sanity/tests/test_oss.py
+++ b/test_set/cvp-sanity/tests/test_oss.py
@@ -4,25 +4,19 @@
def test_oss_status(local_salt_client):
- result = local_salt_client.cmd(
- 'docker:swarm:role:master',
- 'pillar.fetch',
- ['haproxy:proxy:listen:stats:binds:address'],
- expr_form='pillar')
- HAPROXY_STATS_IP = [node for node in result if result[node]]
+ HAPROXY_STATS_IP = local_salt_client.pillar_get(
+ tgt='docker:swarm:role:master',
+ param='haproxy:proxy:listen:stats:binds:address')
proxies = {"http": None, "https": None}
csv_result = requests.get('http://{}:9600/haproxy?stats;csv"'.format(
- result[HAPROXY_STATS_IP[0]]),
+ HAPROXY_STATS_IP),
proxies=proxies).content
data = csv_result.lstrip('# ')
wrong_data = []
list_of_services = ['aptly', 'openldap', 'gerrit', 'jenkins', 'postgresql',
'pushkin', 'rundeck', 'elasticsearch']
for service in list_of_services:
- check = local_salt_client.cmd(
- '{}:client'.format(service),
- 'test.ping',
- expr_form='pillar')
+ check = local_salt_client.test_ping(tgt='{}:client'.format(service))
if check:
lines = [row for row in csv.DictReader(data.splitlines())
if service in row['pxname']]