summaryrefslogtreecommitdiffstats
path: root/docker/prepare_env.sh
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-03-18 12:25:33 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2016-03-18 15:16:44 +0100
commitb118662e7c4a151575d988452cda4f3a4903a524 (patch)
treedbe75a54b1ed7efc3960a7960280f93309940a09 /docker/prepare_env.sh
parent727cc9cdd5d8e8ed1389c27a255c6ee9ad3122d9 (diff)
Fix support for CACERT and set OS_INSECURE=true
JIRA: FUNCTEST-145 Change-Id: If8fce037117d7c7d16d08a558d0675cbfe5f9836 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'docker/prepare_env.sh')
-rwxr-xr-xdocker/prepare_env.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh
index 542df0e72..58fa514ec 100755
--- a/docker/prepare_env.sh
+++ b/docker/prepare_env.sh
@@ -210,8 +210,10 @@ mkdir -p ${FUNCTEST_RESULTS_DIR}/ODL
# Create Openstack credentials file
-if [ ! -f ${FUNCTEST_CONF_DIR}/openstack.creds ]; then
- ${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${FUNCTEST_CONF_DIR}/openstack.creds \
+# $creds is an env varialbe in the docker container pointing to
+# /home/opnfv/functest/conf/openstack.creds
+if [ ! -f ${creds} ]; then
+ ${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${creds} \
-i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
retval=$?
if [ $retval != 0 ]; then
@@ -221,8 +223,15 @@ if [ ! -f ${FUNCTEST_CONF_DIR}/openstack.creds ]; then
else
info "OpenStack credentials file given to the docker and stored in ${FUNCTEST_CONF_DIR}/openstack.creds."
fi
+
+# If we use SSL, by default use option OS_INSECURE=true which means that
+# the cacert will be self-signed
+if grep -Fq "OS_CACERT" ${creds}; then
+ echo "OS_INSECURE=true">>${creds};
+fi
+
# Source credentials
-source ${FUNCTEST_CONF_DIR}/openstack.creds
+source ${creds}
# Check OpenStack
info "Checking that the basic OpenStack services are functional..."