From b118662e7c4a151575d988452cda4f3a4903a524 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Fri, 18 Mar 2016 12:25:33 +0100 Subject: Fix support for CACERT and set OS_INSECURE=true JIRA: FUNCTEST-145 Change-Id: If8fce037117d7c7d16d08a558d0675cbfe5f9836 Signed-off-by: jose.lausuch --- docker/prepare_env.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'docker') 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..." -- cgit 1.2.3-korg