merge IPAM tests with rest

keeping them separate leads to too much duplication
This commit is contained in:
Matthias Radestock committed 2015-05-18 23:28:35 +01:00
1 parent 8e1ac2b300
commit 9017888b9c
6 files changed
+51 -122

No files matched your search

+9 -3
View File
@@ -4,14 +4,20 @@
C1=10.2.1.4
C2=10.2.1.7
UNIVERSE=10.2.2.0/24
start_suite "Ping over cross-host weave network"
start_suite "Ping over cross-host weave network (with and without IPAM)"
weave_on $HOST1 launch
weave_on $HOST2 launch $HOST1
weave_on $HOST1 launch -iprange $UNIVERSE
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
start_container $HOST1 $C1/24 --name=c1
start_container $HOST2 $C2/24 --name=c2
assert_raises "exec_on $HOST1 c1 $PING $C2"
start_container $HOST1 --name=c3
start_container $HOST2 --name=c4
C4=$(container_ip $HOST2 c4)
assert_raises "exec_on $HOST1 c3 $PING $C4"
end_suite
-17
View File
@@ -1,17 +0,0 @@
#! /bin/bash
. ./config.sh
UNIVERSE=10.2.1.0/24
start_suite "Ping over cross-host weave network with IPAM"
weave_on $HOST1 launch -iprange $UNIVERSE
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
start_container $HOST1 --name=c1
start_container $HOST2 --name=c2
C2=$(container_ip $HOST2 c2)
assert_raises "exec_on $HOST1 c1 $PING $C2"
end_suite
+29 -15
View File
@@ -6,7 +6,8 @@ C1=10.2.1.34
C2=10.2.1.37
C3=10.2.2.34
C4=10.2.2.37
EXP=10.2.1.101
EXP=10.2.2.101
UNIVERSE=10.2.3.0/24
weave_on1() {
assert_raises "weave_on $HOST1 $@"
@@ -23,45 +24,58 @@ exec_on1() {
check_container_connectivity() {
exec_on1 "c1 $PING $C2"
exec_on1 "c3 $PING $C4"
exec_on1 "c5 $PING $C6"
# fails due to #620
# exec_on1 "c3 ! $PING $C1"
# exec_on1 "c5 ! $PING $C1"
# exec_on1 "c5 ! $PING $C3"
}
start_suite "exposing weave network to host"
# expose/hide work prior to launching weave
# expose/hide with a CIDR work prior to launching weave
run_on1 "! $PING $EXP"
weave_on1 "expose $EXP/24"
run_on1 " $PING $EXP"
weave_on1 "hide $EXP/24"
run_on1 "! $PING $EXP"
weave_on $HOST1 launch
weave_on $HOST1 launch -iprange $UNIVERSE
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
start_container $HOST1 --name=c5
start_container $HOST1 --name=c6
C5=$(container_ip $HOST1 c5)
C6=$(container_ip $HOST1 c6)
# absence of host connectivity by default
run_on1 "! $PING $C1"
run_on1 "! $PING $C3"
run_on1 "! $PING $C5"
check_container_connectivity
# host connectivity after 'expose'
# host connectivity after 'expose', and idempotence of 'expose'
weave_on1 "expose $EXP/24"
run_on1 " $PING $C1"
run_on1 "! $PING $C3"
check_container_connectivity
# idempotence of 'expose'
weave_on1 "expose $EXP/24"
run_on1 "$PING $C1"
# no host connectivity after 'hide'
weave_on1 "hide $EXP/24"
run_on1 "! $PING $C1"
run_on1 " $PING $C3"
run_on1 "! $PING $C5"
weave_on1 "expose"
weave_on1 "expose"
run_on1 "! $PING $C1"
run_on1 " $PING $C3"
run_on1 " $PING $C5"
check_container_connectivity
# idempotence of 'hide'
# no host connectivity after 'hide', and idempotence of 'hide'
weave_on1 "hide $EXP/24"
weave_on1 "hide $EXP/24"
run_on1 "! $PING $C3"
run_on1 " $PING $C5"
weave_on1 "hide"
weave_on1 "hide"
run_on1 "! $PING $C5"
end_suite
-59
View File
@@ -1,59 +0,0 @@
#! /bin/bash
. ./config.sh
R1=10.2.1.0/24
C3=10.2.2.34
C4=10.2.2.37
weave_on1() {
assert_raises "weave_on $HOST1 $@"
}
run_on1() {
assert_raises "run_on $HOST1 $@"
}
exec_on1() {
assert_raises "exec_on $HOST1 $@"
}
check_container_connectivity() {
exec_on1 "c2 $PING $C1"
exec_on1 "c3 $PING $C4"
# fails due to #620
# exec_on1 "c3 ! $PING $C1"
}
start_suite "exposing weave network to host with IPAM"
weave_on $HOST1 launch -iprange $R1
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
run_on1 "! $PING $C1"
check_container_connectivity
# host connectivity after 'expose'
weave_on1 "expose"
run_on1 " $PING $C1"
run_on1 "! $PING $C3"
check_container_connectivity
# idempotence of 'expose'
weave_on1 "expose"
run_on1 " $PING $C1"
# no host connectivity after 'hide'
weave_on1 "hide"
run_on1 "! $PING $C1"
# idempotence of 'hide'
weave_on1 "hide"
end_suite
+13 -6
View File
@@ -4,21 +4,28 @@
C1=10.2.3.78
C2=10.2.3.34
NAME=seetwo.weave.local
UNIVERSE=10.2.4.0/24
NAME2=seetwo.weave.local
NAME4=seefour.weave.local
start_suite "Resolve names across hosts"
start_suite "Resolve names across hosts (with and without IPAM)"
weave_on $HOST1 launch
weave_on $HOST2 launch $HOST1
weave_on $HOST1 launch -iprange $UNIVERSE
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
start_container $HOST2 $C2/24 --name=c2 -h $NAME
start_container $HOST2 $C2/24 --name=c2 -h $NAME2
start_container $HOST2 --name=c4 -h $NAME4
start_container_with_dns $HOST1 $C1/24 --name=c1
start_container_with_dns $HOST1 --name=c3
C4=$(container_ip $HOST2 c4)
assert_dns_record $HOST1 c1 $NAME $C2
assert_dns_record $HOST1 c1 $NAME2 $C2
assert_dns_record $HOST1 c3 $NAME4 $C4
assert_raises "exec_on $HOST1 c1 getent hosts 8.8.8.8 | grep google"
assert_raises "exec_on $HOST1 c3 getent hosts 8.8.8.8 | grep google"
end_suite
-22
View File
@@ -1,22 +0,0 @@
#! /bin/bash
. ./config.sh
UNIVERSE=10.2.3.0/24
NAME=seetwo.weave.local
start_suite "Resolve names over cross-host weave network with IPAM"
weave_on $HOST1 launch -iprange $UNIVERSE
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
start_container $HOST2 --name=c2 -h $NAME
start_container_with_dns $HOST1 --name=c1
C2=$(container_ip $HOST2 c2)
assert_dns_record $HOST1 c1 $NAME $C2
end_suite