[CVP] Fix condition and add verify=false for stacklight tests
Related-PROD: PROD-30969
Related-PROD: PROD-30859
Change-Id: I7554d456489a24cc0756bbc967f00520be444a1c
diff --git a/test_set/cvp-sanity/tests/test_stacklight.py b/test_set/cvp-sanity/tests/test_stacklight.py
index 84624a9..7340951 100644
--- a/test_set/cvp-sanity/tests/test_stacklight.py
+++ b/test_set/cvp-sanity/tests/test_stacklight.py
@@ -14,15 +14,15 @@
ssl = local_salt_client.pillar_get(
tgt='elasticsearch:server',
param='haproxy:proxy:listen:elasticsearch:binds:ssl:enabled')
- proto = "https" if ssl == "True" else "http"
+ proto = "https" if ssl else "http"
proxies = {"http": None, "https": None}
IP = salt_output
assert requests.get('{0}://{1}:9200/'.format(proto, IP),
- proxies=proxies).status_code == 200, \
+ proxies=proxies, verify=False).status_code == 200, \
'Cannot check elasticsearch url on {}.'.format(IP)
resp = requests.get('{0}://{1}:9200/_cat/health'.format(proto, IP),
- proxies=proxies).content
+ proxies=proxies, verify=False).content
assert resp.split()[3] == 'green', \
'elasticsearch status is not good {}'.format(
json.dumps(resp, indent=4))
@@ -50,10 +50,10 @@
ssl = local_salt_client.pillar_get(
tgt='kibana:server',
param='haproxy:proxy:listen:kibana:binds:ssl:enabled')
- proto = "https" if ssl == "True" else "http"
+ proto = "https" if ssl else "http"
resp = requests.get('{0}://{1}:5601/api/status'.format(proto, IP),
- proxies=proxies).content
+ proxies=proxies, verify=False).content
body = json.loads(resp)
assert body['status']['overall']['state'] == "green", \
"Kibana status is not expected: {}".format(
@@ -77,7 +77,7 @@
ssl = local_salt_client.pillar_get(
tgt='elasticsearch:server',
param='haproxy:proxy:listen:elasticsearch:binds:ssl:enabled')
- proto = "https" if ssl == "True" else "http"
+ proto = "https" if ssl else "http"
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
proxies = {"http": None, "https": None}
@@ -89,6 +89,7 @@
'{0}://{1}:9200/log-{2}/_search?pretty'.format(proto, IP, today),
proxies=proxies,
headers=headers,
+ verify = False,
data=data)
assert 200 == response.status_code, 'Unexpected code {}'.format(
response.text)
@@ -145,7 +146,7 @@
# TODO
nodes_info = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl -s {0}://{1}:15010/alerts | grep icon-chevron-down | '
+ param='curl -k -s {0}://{1}:15010/alerts | grep icon-chevron-down | '
'grep -v "0 active"'.format(proto, IP),
expr_form='pillar')
diff --git a/test_set/cvp-sanity/tests/test_ui_addresses.py b/test_set/cvp-sanity/tests/test_ui_addresses.py
index f6423f8..d8e6a32 100644
--- a/test_set/cvp-sanity/tests/test_ui_addresses.py
+++ b/test_set/cvp-sanity/tests/test_ui_addresses.py
@@ -13,7 +13,7 @@
pytest.skip("Horizon is not enabled on this environment")
result = local_salt_client.cmd_any(
tgt=ctl_nodes_pillar,
- param='curl --insecure {0}://{1}/auth/login/ 2>&1 | \
+ param='curl -k {0}://{1}/auth/login/ 2>&1 | \
grep Login'.format(proto, IP),
expr_form='pillar')
assert len(result) != 0, \
@@ -52,7 +52,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl {}/app/kibana 2>&1 | \
+ param='curl -k {}/app/kibana 2>&1 | \
grep loading'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \
@@ -70,7 +70,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl {}/app/kibana 2>&1 | \
+ param='curl -k {}/app/kibana 2>&1 | \
grep loading'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \
@@ -107,7 +107,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl {}/graph 2>&1 | \
+ param='curl -k {}/graph 2>&1 | \
grep Prometheus'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \
@@ -143,7 +143,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl -s {}/ | grep Alertmanager'.format(url),
+ param='curl -k -s {}/ | grep Alertmanager'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \
'Public AlertManager page is not reachable on {} ' \
@@ -178,7 +178,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl {}/login 2>&1 | grep Grafana'.format(url),
+ param='curl -k {}/login 2>&1 | grep Grafana'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \
'Public Grafana page is not reachable on {} from ctl nodes'.format(url)
@@ -212,7 +212,7 @@
url = "{}://{}:{}".format(proto, IP, port)
result = local_salt_client.cmd(
tgt=ctl_nodes_pillar,
- param='curl {}/ 2>&1 | \
+ param='curl -k {}/ 2>&1 | \
grep Alerta'.format(url),
expr_form='pillar')
assert len(result[result.keys()[0]]) != 0, \