From 9017888b9c22cbdce6e5a5ae585b52491ca47d32 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 18 May 2015 23:28:35 +0100 Subject: [PATCH] merge IPAM tests with rest keeping them separate leads to too much duplication --- test/100_cross_hosts_test.sh | 12 +++++-- test/120_ipam_test.sh | 17 ---------- test/130_expose_test.sh | 44 ++++++++++++++++--------- test/140_ipam_expose_test.sh | 59 ---------------------------------- test/210_dns_multicast_test.sh | 19 +++++++---- test/250_dns_ipam_test.sh | 22 ------------- 6 files changed, 51 insertions(+), 122 deletions(-) delete mode 100755 test/120_ipam_test.sh delete mode 100755 test/140_ipam_expose_test.sh delete mode 100755 test/250_dns_ipam_test.sh diff --git a/test/100_cross_hosts_test.sh b/test/100_cross_hosts_test.sh index 678b3f0e..869be0ec 100755 --- a/test/100_cross_hosts_test.sh +++ b/test/100_cross_hosts_test.sh @@ -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 diff --git a/test/120_ipam_test.sh b/test/120_ipam_test.sh deleted file mode 100755 index efd7c804..00000000 --- a/test/120_ipam_test.sh +++ /dev/null @@ -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 diff --git a/test/130_expose_test.sh b/test/130_expose_test.sh index d0a26e2a..abe38b0f 100755 --- a/test/130_expose_test.sh +++ b/test/130_expose_test.sh @@ -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 diff --git a/test/140_ipam_expose_test.sh b/test/140_ipam_expose_test.sh deleted file mode 100755 index 11b40994..00000000 --- a/test/140_ipam_expose_test.sh +++ /dev/null @@ -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 diff --git a/test/210_dns_multicast_test.sh b/test/210_dns_multicast_test.sh index ead67e95..097ef027 100755 --- a/test/210_dns_multicast_test.sh +++ b/test/210_dns_multicast_test.sh @@ -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 diff --git a/test/250_dns_ipam_test.sh b/test/250_dns_ipam_test.sh deleted file mode 100755 index b8988a54..00000000 --- a/test/250_dns_ipam_test.sh +++ /dev/null @@ -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