Merge lp:~dernils/duplicity/Dockerfile into lp:~duplicity-team/duplicity/0.8-series

Proposed by nils
Status: Merged
Merged at revision: 1227
Proposed branch: lp:~dernils/duplicity/Dockerfile
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 44 lines (+16/-9)
1 file modified
testing/infrastructure/setup.sh (+16/-9)
To merge this branch: bzr merge lp:~dernils/duplicity/Dockerfile
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+324057@code.launchpad.net

Description of the change

Minor changes to the setup.sh file. Now having subnet name and IP of the subnet for testing as a variable.

To post a comment you must log in.
lp:~dernils/duplicity/Dockerfile updated
1227. By nils

minor changes to setup.sh

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testing/infrastructure/setup.sh'
2--- testing/infrastructure/setup.sh 2017-05-14 07:17:59 +0000
3+++ testing/infrastructure/setup.sh 2017-05-15 18:50:39 +0000
4@@ -22,24 +22,31 @@
5 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6 #
7
8+# Define the subnet and the name of the testnetwork that should be used for testing
9+subnet=10.10.10.0/24
10+testnetwork=testnetwork
11+ip_ssh_server=10.10.10.4
12+ip_ftp_server=10.10.10.3
13+ip_duplicity_test=10.10.10.2
14
15 # Check whether a specific docker network for testing is already exisitng. If not, create it.
16-docker network inspect testnetwork &> /dev/null
17+docker network inspect $testnetwork &> /dev/null
18
19 if [ $? -ne 0 ]; then
20 echo "docker testnetwork not found. Creating network."
21- docker network create --subnet=10.10.10.0/24 testnetwork
22+ docker network create --subnet=$subnet $testnetwork
23 fi
24
25-
26 # Remove all running instances of the test system and also remove the containers. This ensure
27 # that the test infrastructure is frehshly started.
28-docker rm -f $(docker stop $(docker ps -a -q --filter name=d70c0e18-37d5-11e7-a919-92ebcb67fe33-ftpd_server --format="{{.ID}}"))
29-docker rm -f $(docker stop $(docker ps -a -q --filter name=ee681ee4-37d5-11e7-a919-92ebcb67fe33-duplicity_ssh_server --format="{{.ID}}"))
30-docker rm -f $(docker stop $(docker ps -a -q --filter name=f3c09128-37d5-11e7-a919-92ebcb67fe33-duplicity_test --format="{{.ID}}"))
31+# We are using UUIDs as part of the names of the docker container to ensure that we do not accidentially touch other containers
32+docker rm -f $(docker stop $(docker ps -a -q --filter name=d70c0e18-37d5-11e7-a919-92ebcb67fe33-ftpd_server --format="{{.ID}}"))
33+docker rm -f $(docker stop $(docker ps -a -q --filter name=ee681ee4-37d5-11e7-a919-92ebcb67fe33-duplicity_ssh_server --format="{{.ID}}"))
34+docker rm -f $(docker stop $(docker ps -a -q --filter name=f3c09128-37d5-11e7-a919-92ebcb67fe33-duplicity_test --format="{{.ID}}"))
35
36
37 # Start the containers. Docker run will automatically download the image if necessary
38-docker run -d --net testnetwork --ip 10.10.10.3 --name d70c0e18-37d5-11e7-a919-92ebcb67fe33-ftpd_server -p 21:21 -p 30000-30009:30000-30009 -e "PUBLICHOST=localhost" dernils/duplicity_testinfrastructure_ftp
39-docker run -d --net testnetwork --ip 10.10.10.4 --name ee681ee4-37d5-11e7-a919-92ebcb67fe33-duplicity_ssh_server -p 22:22 -e "PUBLICHOST=localhost" dernils/duplicity_testinfrastructure_ssh:latest
40-docker run --name f3c09128-37d5-11e7-a919-92ebcb67fe33-duplicity_test --net testnetwork --ip 10.10.10.2 -it dernils/duplicitytest:latest
41+# Hand over the parameters for testing to the main docker container
42+docker run -d --net $testnetwork --ip $ip_ftp_server --name d70c0e18-37d5-11e7-a919-92ebcb67fe33-ftpd_server -p 21:21 -p 30000-30009:30000-30009 dernils/duplicity_testinfrastructure_ftp
43+docker run -d --net $testnetwork --ip $ip_ssh_server --name ee681ee4-37d5-11e7-a919-92ebcb67fe33-duplicity_ssh_server -p 22:22 dernils/duplicity_testinfrastructure_ssh:latest
44+docker run --name f3c09128-37d5-11e7-a919-92ebcb67fe33-duplicity_test --net $testnetwork --ip $ip_duplicity_test -e DUPLICITY_TESTNETWORK=$testnetwork -e DUPLICITY_SUBNET=$subnet -e "PUBLICHOST=localhost" -e DUPLICITY_IP_SSH_SERVER=$ip_ssh_server -e DUPLICITY_IP_FTP_SERVER=$ip_ftp_server -it dernils/duplicitytest:latest

Subscribers

People subscribed via source and target branches