[CVP] Use correct proto in UI tests according to reclass

Change-Id: I6646d8752ae221e36b5f77d71dfd4e51f62b970c
Related-PROD: PROD-30969
Related-PROD: PROD-30859
(cherry picked from commit 7d4f07eb6e058eda4f7fe2af811ea3b0abb8a6fc)
diff --git a/test_set/cvp-sanity/tests/test_ui_addresses.py b/test_set/cvp-sanity/tests/test_ui_addresses.py
index 40ff120..22e4a7f 100644
--- a/test_set/cvp-sanity/tests/test_ui_addresses.py
+++ b/test_set/cvp-sanity/tests/test_ui_addresses.py
@@ -7,12 +7,14 @@
     IP = local_salt_client.pillar_get(
         tgt='horizon:server',
         param='_param:cluster_public_host')
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     if not IP:
         pytest.skip("Horizon is not enabled on this environment")
     result = local_salt_client.cmd_any(
         tgt=ctl_nodes_pillar,
-        param='curl --insecure https://{}/auth/login/ 2>&1 | \
-               grep Login'.format(IP),
+        param='curl -k {0}://{1}/auth/login/ 2>&1 | \
+               grep Login'.format(proto, IP),
         expr_form='pillar')
     assert len(result) != 0, \
         'Horizon login page is not reachable on {} from ctl nodes'.format(
@@ -23,9 +25,10 @@
 @pytest.mark.usefixtures('check_openstack')
 def test_public_openstack(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '5000'
-    url = "{}://{}:{}/v3".format(protocol, IP, port)
+    url = "{}://{}:{}/v3".format(proto, IP, port)
     result = local_salt_client.cmd(
         tgt=ctl_nodes_pillar,
         param='curl -k {}/ 2>&1 | \
@@ -41,12 +44,15 @@
 @pytest.mark.usefixtures('check_kibana')
 def test_internal_ui_kibana(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:stacklight_log_address')
-    protocol = 'http'
+    ssl = local_salt_client.pillar_get(
+        tgt='kibana:server',
+        param='haproxy:proxy:listen:kibana:binds:ssl:enabled')
+    proto = "https" if ssl == "True" else "http"
     port = '5601'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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, \
@@ -58,12 +64,13 @@
 @pytest.mark.usefixtures('check_kibana')
 def test_public_ui_kibana(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '5601'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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, \
@@ -94,12 +101,13 @@
 @pytest.mark.usefixtures('check_prometheus')
 def test_public_ui_prometheus(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '15010'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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, \
@@ -129,12 +137,13 @@
 @pytest.mark.usefixtures('check_prometheus')
 def test_public_ui_alert_manager(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '15011'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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 {} ' \
@@ -163,12 +172,13 @@
 @pytest.mark.usefixtures('check_grafana')
 def test_public_ui_grafana(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '8084'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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)
@@ -196,12 +206,13 @@
 @pytest.mark.usefixtures('check_alerta')
 def test_public_ui_alerta(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '15017'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    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, \
@@ -213,9 +224,10 @@
 @pytest.mark.usefixtures('check_drivetrain')
 def test_public_ui_jenkins(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '8081'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    url = "{}://{}:{}".format(proto, IP, port)
     result = local_salt_client.cmd(
         tgt=ctl_nodes_pillar,
         param='curl -k {}/ 2>&1 | \
@@ -230,13 +242,14 @@
 @pytest.mark.usefixtures('check_drivetrain')
 def test_public_ui_gerrit(local_salt_client, ctl_nodes_pillar):
     IP = local_salt_client.pillar_get(param='_param:cluster_public_host')
-    protocol = 'https'
+    proto = local_salt_client.pillar_get(
+        param='_param:cluster_public_protocol')
     port = '8070'
-    url = "{}://{}:{}".format(protocol, IP, port)
+    url = "{}://{}:{}".format(proto, IP, port)
     result = local_salt_client.cmd(
         tgt=ctl_nodes_pillar,
         param='curl -k {}/ 2>&1 | \
                grep "Gerrit Code Review"'.format(url),
         expr_form='pillar')
     assert len(result[result.keys()[0]]) != 0, \
-        'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)
\ No newline at end of file
+        'Public Gerrit page is not reachable on {} from ctl nodes'.format(url)