[fuel] Handle os cacert for baremetal deployments 83/40383/4
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Mon, 28 Aug 2017 10:21:24 +0000 (14:21 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Mon, 28 Aug 2017 16:49:04 +0000 (20:49 +0400)
Change-Id: I02503772dc5ed59562c2e0aba96280e2cae1da50
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
jjb/functest/set-functest-env.sh
utils/fetch_os_creds.sh

index e54c3bf..3c4e8c4 100755 (executable)
@@ -6,15 +6,20 @@ set +o pipefail
 
 [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
 
 
 [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
 
+DEPLOY_TYPE=baremetal
+[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt
+HOST_ARCH=$(uname -m)
+
 # Prepare OpenStack credentials volume
 # Prepare OpenStack credentials volume
+rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds"
+
 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
     rc_file_vol="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds"
 elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then
     cacert_file_vol="-v ${HOME}/os_cacert:/home/opnfv/functest/conf/os_cacert"
     echo "export OS_CACERT=/home/opnfv/functest/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh
 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
     rc_file_vol="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds"
 elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then
     cacert_file_vol="-v ${HOME}/os_cacert:/home/opnfv/functest/conf/os_cacert"
     echo "export OS_CACERT=/home/opnfv/functest/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh
-    rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds"
-else
-    rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds"
+elif [[ ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then
+    cacert_file_vol="-v ${HOME}/os_cacert:/etc/ssl/certs/mcp_os_cacert"
 fi
 
 
 fi
 
 
@@ -23,10 +28,6 @@ if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FOR
     sudo iptables -I FORWARD -j RETURN
 fi
 
     sudo iptables -I FORWARD -j RETURN
 fi
 
-DEPLOY_TYPE=baremetal
-[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt
-HOST_ARCH=$(uname -m)
-
 echo "Functest: Start Docker and prepare environment"
 
 if [ "$BRANCH" != 'stable/danube' ]; then
 echo "Functest: Start Docker and prepare environment"
 
 if [ "$BRANCH" != 'stable/danube' ]; then
index 312e1ac..377930d 100755 (executable)
@@ -112,6 +112,10 @@ if [ "$installer_type" == "fuel" ]; then
 
         info "Fetching rc file from controller $controller_ip..."
         ssh ${ssh_options} ubuntu@${controller_ip} "sudo cat /root/keystonercv3" > $dest_path
 
         info "Fetching rc file from controller $controller_ip..."
         ssh ${ssh_options} ubuntu@${controller_ip} "sudo cat /root/keystonercv3" > $dest_path
+
+        if [[ $BUILD_TAG =~ "baremetal" ]]; then
+            ssh ${ssh_options} ubuntu@${installer_ip} "cat /etc/ssl/certs/os_cacert" > $os_cacert
+        fi
     else
         #ip_fuel="10.20.0.2"
         env=$(sshpass -p r00tme ssh 2>/dev/null ${ssh_options} root@${installer_ip} \
     else
         #ip_fuel="10.20.0.2"
         env=$(sshpass -p r00tme ssh 2>/dev/null ${ssh_options} root@${installer_ip} \