From 8bff3e9a67c931a9b61c8a5d5df7f70b42a4c690 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 24 May 2022 09:31:30 +0100
Subject: [PATCH] CI: Fix prometheus-efk scenario with TLS enabled

Change-Id: Ic55a7384c298ef517aa4b7f0eaa67d53b5d70df0
---
 tests/run.yml                | 2 ++
 tests/test-prometheus-efk.sh | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/tests/run.yml b/tests/run.yml
index e2c66f8b5d..208e85bc36 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -521,6 +521,8 @@
             cmd: test-prometheus-efk.sh
             executable: /bin/bash
             chdir: "{{ kolla_ansible_src_dir }}"
+          environment:
+            TLS_ENABLED: "{{ tls_enabled }}"
           when: scenario == "prometheus-efk"
 
         - name: Run test-venus.sh script
diff --git a/tests/test-prometheus-efk.sh b/tests/test-prometheus-efk.sh
index 86406223ad..436b2b8d5a 100755
--- a/tests/test-prometheus-efk.sh
+++ b/tests/test-prometheus-efk.sh
@@ -39,6 +39,9 @@ function check_elasticsearch {
         --location
         --fail
     )
+    if [[ "$TLS_ENABLED" = "True" ]]; then
+        args+=(--cacert $OS_CACERT)
+    fi
     if ! curl "${args[@]}" $ELASTICSEARCH_URL > $output_path; then
         return 1
     fi