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

Proposed by nils
Status: Merged
Merged at revision: 1237
Proposed branch: lp:~dernils/duplicity/docker-compose
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 124 lines (+76/-36)
2 files modified
testing/infrastructure/docker-compose.yml (+73/-0)
testing/infrastructure/setup.sh (+3/-36)
To merge this branch: bzr merge lp:~dernils/duplicity/docker-compose
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+325036@code.launchpad.net

Description of the change

Test Infrastructure now utilizing docker-compose

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'testing/infrastructure/docker-compose.yml'
2--- testing/infrastructure/docker-compose.yml 1970-01-01 00:00:00 +0000
3+++ testing/infrastructure/docker-compose.yml 2017-06-03 14:55:22 +0000
4@@ -0,0 +1,73 @@
5+#
6+# Copyright 2017 Nils Tekampe <nils@tekampe.org>
7+#
8+# This file is part of duplicity.
9+# This script sets up a test network for the tests of dupclicity
10+# This script takes the assumption that the containers for the testinfrastructure do deither run
11+# or they are removed. It is not intended to have stopped containers.
12+#
13+# Duplicity is free software; you can redistribute it and/or modify it
14+# under the terms of the GNU General Public License as published by the
15+# Free Software Foundation; either version 2 of the License, or (at your
16+# option) any later version.
17+#
18+# Duplicity is distributed in the hope that it will be useful, but
19+# WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+# General Public License for more details.
22+#
23+# You should have received a copy of the GNU General Public License
24+# along with duplicity; if not, write to the Free Software Foundation,
25+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26+#
27+
28+version: "3"
29+
30+services:
31+ duplicity_test:
32+ image: firstprime/duplicity_test
33+ ports:
34+ - "30000-30009:30000-30009"
35+ entrypoint: /bin/bash
36+ depends_on:
37+ - duplicity_ftp
38+ - duplicity_ssh
39+ stdin_open: true
40+ tty: true
41+ networks:
42+ duplicity_test_net:
43+ ipv4_address: 10.20.0.2
44+ environment:
45+ - DUPLICITY_IP_SSH_SERVER=10.20.0.3
46+ - DUPLICITY_IP_FTP_SERVER=10.20.0.4
47+
48+
49+ duplicity_ftp:
50+ image: firstprime/duplicity_ftp
51+ ports:
52+ - "2222:22"
53+ networks:
54+ duplicity_test_net:
55+ ipv4_address: 10.20.0.3
56+
57+
58+ duplicity_ssh:
59+ image: firstprime/duplicity_ssh
60+ ports:
61+ - "21:21"
62+ tty: true
63+ networks:
64+ duplicity_test_net:
65+ ipv4_address: 10.20.0.4
66+
67+
68+networks:
69+ duplicity_test_net:
70+ ipam:
71+ driver: default
72+ config:
73+ - subnet: 10.20.0.0/24
74+
75+
76+
77+
78
79=== modified file 'testing/infrastructure/setup.sh'
80--- testing/infrastructure/setup.sh 2017-05-21 19:45:56 +0000
81+++ testing/infrastructure/setup.sh 2017-06-03 14:55:22 +0000
82@@ -22,39 +22,6 @@
83 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
84 #
85
86-# Define the subnet and the name of the testnetwork that should be used for testing
87-SUBNET=10.20.0.0/24
88-SUBNET_BASE=10.20.0
89-TESTNETWORK=testnetwork
90-IP_DUPLICITY_SSH=${SUBNET_BASE}.4
91-IP_DUPLICITY_FTP=${SUBNET_BASE}.3
92-IP_DUPLICITY_TEST=${SUBNET_BASE}.2
93-
94-# Remove all running instances of the test system and also remove the containers. This ensures
95-# that the test infrastructure is frehshly started.
96-# We kill only containers nameed beginning with "duplicity_test_" to ensure that we do not
97-# accidentially touch other containers
98-
99-echo "Removing any running instances of duplicity_test_*"
100-docker rm -f $(docker ps -a -q --filter name=duplicity_test_) &> /dev/null
101-
102-echo "(Re)create docker testnetwork."
103-docker network rm ${TESTNETWORK} &> /dev/null
104-docker network create --subnet=${SUBNET} ${TESTNETWORK}
105-
106-# Start the containers. Docker run will automatically download the image if necessary
107-# Hand over the parameters for testing to the main docker container
108-
109-echo "Starting duplicity_test_ftp..."
110-docker run -d --net ${TESTNETWORK} --ip ${IP_DUPLICITY_FTP} --name duplicity_test_ftp \
111- -p 21:21 -p 30000-30009:30000-30009 -t firstprime/duplicity_ftp
112-
113-echo "Starting duplicity_test_ssh..."
114-docker run -d --net ${TESTNETWORK} --ip ${IP_DUPLICITY_SSH} --name duplicity_test_ssh \
115- -p 2222:22 -t firstprime/duplicity_ssh:latest
116-
117-echo "Starting duplicity_test_main..."
118-docker run --net ${TESTNETWORK} --ip ${IP_DUPLICITY_TEST} --name duplicity_test_main \
119- -e DUPLICITY_TESTNETWORK=${TESTNETWORK} -e DUPLICITY_SUBNET=${SUBNET} -e "PUBLICHOST=localhost" \
120- -e DUPLICITY_IP_SSH_SERVER=${IP_DUPLICITY_SSH} -e DUPLICITY_IP_FTP_SERVER=${IP_DUPLICITY_FTP} \
121- -it firstprime/duplicity_test:latest
122+
123+docker-compose up -d
124+docker-compose exec duplicity_test /bin/bash

Subscribers

People subscribed via source and target branches