Merge ~canonical-kernel-team/+git/autotest-client-tests:sjf/docker_fix_lp2009351 into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Sean Feole
Status: Merged
Merged at revision: 2eba936bbfc38ec50381bab8bda59ae3b602487a
Proposed branch: ~canonical-kernel-team/+git/autotest-client-tests:sjf/docker_fix_lp2009351
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 52 lines (+8/-11)
2 files modified
ubuntu_docker_smoke_test/the-test (+4/-1)
ubuntu_fan_smoke_test/ubuntu_fan_smoke_test.sh (+4/-10)
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Francis Ginther Approve
Andrei Gherzan Approve
Review via email: mp+438399@code.launchpad.net

Description of the change

ubuntu_docker_smoke && ubuntu_fan test: Proxy

BugLink: https://bugs.launchpad.net/bugs/2009351

- Append HTTPS_PROXY and NO_PROXY variables to docker http-proxy.conf
These values are required to allow communication with
registry-1.docker.io/v2/ when in the Openstack Cloud

- In the ubuntu fan test, remove the wget attempt for index.docker.io
The URI was invalid and returned a http 404 error, in this case
triggering the `else` and unsetting the http_proxy.

The check itself was not valid, due to Canonicals internal firewall
rules, index-docker and registry-docker are 2 separate acls and each
need to be configured for the network under test.

To post a comment you must log in.
Revision history for this message
Andrei Gherzan (agherzan) wrote :

Looks good.

review: Approve
Revision history for this message
Sean Feole (sfeole) wrote :

The following was tested on Openstack Cloud to ensure HTTP Values were set. It was also tested in the AWS Cloud to ensure the HTTP Values were not set. Both tests passed as expected

Revision history for this message
Francis Ginther (fginther) wrote :

Thanks for testing on AWS.

+1

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

LGTM, thanks!

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubuntu_docker_smoke_test/the-test b/ubuntu_docker_smoke_test/the-test
2index 8810d15..9854e90 100755
3--- a/ubuntu_docker_smoke_test/the-test
4+++ b/ubuntu_docker_smoke_test/the-test
5@@ -17,11 +17,14 @@ elif echo "" | nc -w 2 10.245.64.1 3128 >/dev/null 2>&1; then
6 export http_proxy="http://10.245.64.1:3128"
7 fi
8
9+# Configure Docker Proxy LP2009351
10 if [ -n "$http_proxy" ]; then
11 command -v systemctl &> /dev/null
12 if [ $? -eq 0 ]; then
13 [ ! -d /etc/systemd/system/docker.service.d ] && mkdir /etc/systemd/system/docker.service.d
14- echo -e "[Service]\nEnvironment=HTTP_PROXY=$http_proxy\n" > /etc/systemd/system/docker.service.d/http-proxy.conf
15+ echo -ne "[Service]\nEnvironment=HTTP_PROXY=$http_proxy\n" > /etc/systemd/system/docker.service.d/http-proxy.conf
16+ echo -ne "Environment=HTTPS_PROXY=$http_proxy\n" >> /etc/systemd/system/docker.service.d/http-proxy.conf
17+ echo -ne "Environment=NO_PROXY=127.0.0.1\n" >> /etc/systemd/system/docker.service.d/http-proxy.conf
18 systemctl daemon-reload
19 systemctl restart docker
20 else
21diff --git a/ubuntu_fan_smoke_test/ubuntu_fan_smoke_test.sh b/ubuntu_fan_smoke_test/ubuntu_fan_smoke_test.sh
22index 8b10b85..c5f98e5 100755
23--- a/ubuntu_fan_smoke_test/ubuntu_fan_smoke_test.sh
24+++ b/ubuntu_fan_smoke_test/ubuntu_fan_smoke_test.sh
25@@ -39,14 +39,6 @@ fi
26 export http_proxy
27 export https_proxy
28
29-URI="http://index.docker.io/v1/repositories/library/ubuntu/images"
30-if wget -q -O/dev/null $URI; then
31- echo $INFO
32-else
33- unset http_proxy
34- unset https_proxy
35-fi
36-
37 if [ -n "$http_proxy" ]; then
38 if [ ! -d /etc/systemd/system/docker.service.d ]; then
39 mkdir /etc/systemd/system/docker.service.d
40@@ -58,8 +50,10 @@ if [ -n "$http_proxy" ]; then
41 systemctl daemon-reload
42 systemctl restart docker.service
43
44- echo -ne "[Service]\nEnvironment=\"HTTP_PROXY=$http_proxy\"\n" \
45- > /etc/systemd/system/docker.service.d/http-proxy.conf
46+ # Configure Docker Proxy LP2009351
47+ echo -ne "[Service]\nEnvironment=HTTP_PROXY=$http_proxy\n" > /etc/systemd/system/docker.service.d/http-proxy.conf
48+ echo -ne "Environment=HTTPS_PROXY=$http_proxy\n" >> /etc/systemd/system/docker.service.d/http-proxy.conf
49+ echo -ne "Environment=NO_PROXY=127.0.0.1\n" >> /etc/systemd/system/docker.service.d/http-proxy.conf
50 systemctl daemon-reload
51 systemctl restart docker.service
52 fi

Subscribers

People subscribed via source and target branches

to all changes: