aboutsummaryrefslogtreecommitdiffstats
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:08:49 +0100
commitb1924aa709a6ce74952e461a07a2fc10c2f2aae3 (patch)
tree3ab3aac31a7137edc6108b9a7cc52a274a70c9ff /docker/prepare_env.sh
parent99c413688b68cb78181845ea891ea4db451abf40 (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 542df0e7..58fa514e 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..."