Bugfix: use fuel public endpoint rather than internal one 49/49849/2
authorxudan <xudan16@huawei.com>
Tue, 2 Jan 2018 07:12:30 +0000 (02:12 -0500)
committerxudan <xudan16@huawei.com>
Tue, 2 Jan 2018 07:24:50 +0000 (02:24 -0500)
1. The internal endpoint url of fuel is http.
2. Dovetail won't pass cacert to functest and yardstick containers if it's http.
3. For functest and rally, even if it uses internal url in the openrc file,
   they will still use public one somewhere.
4. Use fuel public endpoint which is https, so all containers will work with
   the cacert.

Change-Id: I3326c8d66bcad44ea81169ce0938cb0e247f498c
Signed-off-by: xudan <xudan16@huawei.com>
jjb/dovetail/dovetail-run.sh

index cccc55f..80c9929 100755 (executable)
@@ -185,6 +185,7 @@ dovetail_home_volume="-v ${DOVETAIL_HOME}:${DOVETAIL_HOME}"
 DOCKER_REPO='opnfv/dovetail'
 if [ "$(uname -m)" = 'aarch64' ]; then
     DOCKER_REPO="${DOCKER_REPO}_$(uname -m)"
+    DOCKER_TAG="latest"
 fi
 
 echo "Dovetail: Pulling image ${DOCKER_REPO}:${DOCKER_TAG}"
@@ -213,6 +214,15 @@ if [ $(docker ps | grep "${DOCKER_REPO}:${DOCKER_TAG}" | wc -l) == 0 ]; then
     exit 1
 fi
 
+if [[ ! "${SUT_BRANCH}" =~ "danube" && ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then
+    source_cmd="source ${OPENRC}"
+    get_public_url_cmd="openstack --insecure endpoint list --service keystone --interface public | sed -n 4p | awk '{print \$14}'"
+    public_url=$(sudo docker exec "$container_id" /bin/bash -c "${source_cmd} && ${get_public_url_cmd}")
+    sed -i 's#OS_AUTH_URL=.*#OS_AUTH_URL='"${public_url}"'#g' ${OPENRC}
+    sed -i 's/internal/public/g' ${OPENRC}
+    cat ${OPENRC}
+fi
+
 # Modify tempest_conf.yaml file
 tempest_conf_file=${DOVETAIL_CONFIG}/tempest_conf.yaml
 if [[ ${INSTALLER_TYPE} == 'compass' || ${INSTALLER_TYPE} == 'apex' ]]; then