extract startup of simple container

There is now just one mention of the gliderlabs/alpine image outside config.sh.
This commit is contained in:
Matthias Radestock committed 2015-05-16 21:00:07 +01:00
1 parent ab244f76f6
commit 1c1bd817e1
13 files changed
+27 -25

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@ start_suite "Ping over cross-host weave network"
weave_on $HOST1 launch
weave_on $HOST2 launch $HOST1
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
start_container $HOST1 $C1/24 --name=c1
start_container $HOST2 $C2/24 --name=c2
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
end_suite
+2 -2
View File
@@ -10,8 +10,8 @@ start_suite "Ping over encrypted cross-host weave network"
weave_on $HOST1 launch -password notverysecure
weave_on $HOST2 launch -password notverysecure $HOST1
weave_on $HOST2 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C1/24 -t --name=c1 gliderlabs/alpine /bin/sh
start_container $HOST1 $C1/24 --name=c1
start_container $HOST2 $C2/24 --name=c2
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
end_suite
+2 -2
View File
@@ -9,8 +9,8 @@ start_suite "Ping over cross-host weave network with IPAM"
weave_on $HOST1 launch -iprange $UNIVERSE
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
weave_on $HOST1 run -t --name=c1 gliderlabs/alpine /bin/sh
weave_on $HOST2 run -t --name=c2 gliderlabs/alpine /bin/sh
start_container $HOST1 --name=c1
start_container $HOST2 --name=c2
C2=$(container_ip $HOST2 c2)
assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2"
+4 -8
View File
@@ -29,18 +29,14 @@ check_container_connectivity() {
# exec_on1 "c3 ! $PING $C1"
}
start_container() {
weave_on $HOST1 run $2/24 --name=$1 -t gliderlabs/alpine /bin/sh
}
start_suite "exposing weave network to host"
weave_on $HOST1 launch
start_container c1 $C1
start_container c2 $C2
start_container c3 $C3
start_container c4 $C4
start_container $HOST1 $C1/24 --name=c1
start_container $HOST1 $C2/24 --name=c2
start_container $HOST1 $C3/24 --name=c3
start_container $HOST1 $C4/24 --name=c4
# absence of host connectivity by default
run_on1 "! $PING $C1"
+4 -4
View File
@@ -31,10 +31,10 @@ start_suite "exposing weave network to host with IPAM"
weave_on $HOST1 launch -iprange $R1
weave_on $HOST1 run -t --name=c1 gliderlabs/alpine /bin/sh
weave_on $HOST1 run -t --name=c2 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C3/24 -t --name=c3 gliderlabs/alpine /bin/sh
weave_on $HOST1 run $C4/24 -t --name=c4 gliderlabs/alpine /bin/sh
start_container $HOST1 --name=c1
start_container $HOST1 --name=c2
start_container $HOST1 $C3/24 --name=c3
start_container $HOST1 $C4/24 --name=c4
C1=$(container_ip $HOST1 c1)
# absence of host connectivity by default
+1 -1
View File
@@ -10,7 +10,7 @@ start_suite "Resolve names on a single host"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
start_container $HOST1 $C2/24 --name=c2 -h $NAME
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -14,7 +14,7 @@ weave_on $HOST2 launch $HOST1
weave_on $HOST1 launch-dns 10.2.254.1/24 -debug
weave_on $HOST2 launch-dns 10.2.254.2/24 -debug
weave_on $HOST2 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
start_container $HOST2 $C2/24 --name=c2 -h $NAME
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -11,7 +11,7 @@ start_suite "Resolve names in custom domain"
weave_on $HOST1 launch-dns 10.2.254.1/24 --domain $DOMAIN.
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
start_container $HOST1 $C2/24 --name=c2 -h $NAME
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
assert_dns_record $HOST1 c1 $NAME $C2
+1 -1
View File
@@ -12,7 +12,7 @@ start_suite "Resolve unqualified names"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C1/24 -t --name=c1 -h $NAME gliderlabs/alpine /bin/sh
start_container $HOST1 $C1/24 --name=c1 -h $NAME
weave_on $HOST1 run --with-dns $C2/24 -t --name=c2 -h seetwo.$DOMAIN aanand/docker-dnsutils /bin/sh
weave_on $HOST1 run --with-dns $C3/24 -t --name=c3 --dns-search=weave.local aanand/docker-dnsutils /bin/sh
+1 -1
View File
@@ -11,7 +11,7 @@ start_suite "Add and remove names on a single host"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 run $C2/24 -t --name=c2 gliderlabs/alpine /bin/sh
start_container $HOST1 $C2/24 --name=c2
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
weave_on $HOST1 dns-add $C2 c2 -h $NAME2
+1 -1
View File
@@ -13,7 +13,7 @@ weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST2 launch-dns 10.2.254.2/24
weave_on $HOST2 run -t --name=c2 -h $NAME gliderlabs/alpine /bin/sh
start_container $HOST2 --name=c2 -h $NAME
weave_on $HOST1 run --with-dns -t --name=c1 aanand/docker-dnsutils /bin/sh
C2=$(container_ip $HOST2 c2)
+1 -1
View File
@@ -44,7 +44,7 @@ weave_on $HOST1 launch
weave_on $HOST1 launch-dns 10.254.254.254/24
# Run container with three cidrs
CID=$(weave_on $HOST1 run 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 -t --name=multicidr -h multicidr.weave.local gliderlabs/alpine /bin/sh | cut -b 1-12)
CID=$(start_container $HOST1 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 --name=multicidr -h multicidr.weave.local | cut -b 1-12)
assert_container_cidrs $HOST1 $CID 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.1.1 10.2.2.1 10.2.3.1
+6
View File
@@ -88,6 +88,12 @@ exec_on() {
docker -H tcp://$host:2375 exec $container $@
}
start_container() {
host=$1
shift 1
weave_on $host run $@ -t gliderlabs/alpine /bin/sh
}
container_ip() {
weave_on $1 ps $2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
}