Correct proxy configuration for VNF VM 63/62563/1
authorThierry ALLENO <thierry.alleno@orange.com>
Mon, 17 Sep 2018 13:10:18 +0000 (15:10 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 19 Sep 2018 14:23:46 +0000 (16:23 +0200)
The configuration of proxy for apt is missing in ubuntu images.
Line Feed is missing in cloudify conf files.

Change-Id: I3237b914e993c57f4fe3ed568690d2d9a41c0bdf
Signed-off-by: Thierry ALLENO <thierry.alleno@orange.com>
(cherry picked from commit be864b0de9f0f990984ad9e3c2d20b694e1b2c26)

functest/ci/add_proxy.sh

index d191538..3244f24 100644 (file)
@@ -22,6 +22,13 @@ NO_PROXY=${no_proxy:-"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
 EOF
 }
 
+add_proxy_apt () {
+    cat << EOF >> "$1"
+Acquire::http::Proxy "${http_proxy:-http://proxy:8080}";
+Acquire::https::Proxy "${https_proxy:-http://proxy:8080}";
+EOF
+}
+
 tmpdir=$(mktemp -d)
 for image in $images; do
     if [ ! -f "$image" ]; then
@@ -31,9 +38,14 @@ for image in $images; do
     guestmount -a "${image}" -i --rw "${tmpdir}"
     add_proxy "${tmpdir}/etc/environment"
     if [[ ${image} == *"cloudify-manager"* ]]; then
+        echo >> "${tmpdir}/etc/sysconfig/cloudify-mgmtworker"
         add_proxy "${tmpdir}/etc/sysconfig/cloudify-mgmtworker"
+        echo >> "${tmpdir}/etc/sysconfig/cloudify-restservice"
         add_proxy "${tmpdir}/etc/sysconfig/cloudify-restservice"
     fi
+    if [[ ${image} == "ubuntu"* ]]; then
+        add_proxy_apt "${tmpdir}/etc/apt/apt.conf"
+    fi
     guestunmount "${tmpdir}"
 done