From 352e31c88b3c4534096f858fabeb7fb0bb1e9566 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 16 May 2015 19:00:35 +0100 Subject: [PATCH] remove all the `weave_on` hacks that existed because it was echoing a message to stdout, which it no longer does. As a result there is now no mention of the docker tcp host/port outside config.sh. --- test/120_ipam_test.sh | 5 ++--- test/140_ipam_expose_test.sh | 4 +--- test/250_dns_ipam_test.sh | 8 +++----- test/500_weave_multi_cidr_test.sh | 22 ++++------------------ 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/test/120_ipam_test.sh b/test/120_ipam_test.sh index f7cb15d1..0b75c068 100755 --- a/test/120_ipam_test.sh +++ b/test/120_ipam_test.sh @@ -11,8 +11,7 @@ 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 -# Note can't use weave_on here because it echoes the command -C2IP=$(DOCKER_HOST=tcp://$HOST2:2375 $WEAVE ps | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') -assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2IP" +C2=$(weave_on $HOST2 ps | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') +assert_raises "exec_on $HOST1 c1 ping -q -c 4 $C2" end_suite diff --git a/test/140_ipam_expose_test.sh b/test/140_ipam_expose_test.sh index b0ed95c1..1e828960 100755 --- a/test/140_ipam_expose_test.sh +++ b/test/140_ipam_expose_test.sh @@ -35,9 +35,7 @@ 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 - -# Note can't use weave_on here because it echoes the command -C1=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE ps c1 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') +C1=$(weave_on $HOST1 ps c1 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') # absence of host connectivity by default run_on1 "! $PING $C1" diff --git a/test/250_dns_ipam_test.sh b/test/250_dns_ipam_test.sh index 57298a51..3c4bef46 100755 --- a/test/250_dns_ipam_test.sh +++ b/test/250_dns_ipam_test.sh @@ -14,11 +14,9 @@ weave_on $HOST2 launch-dns 10.2.254.2/24 weave_on $HOST2 run -t --name=c2 -h seetwo.weave.local gliderlabs/alpine /bin/sh weave_on $HOST1 run --with-dns --name=c1 -t aanand/docker-dnsutils /bin/sh +C2=$(weave_on $HOST2 ps c2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') -# Note can't use weave_on here because it echoes the command -C2IP=$(DOCKER_HOST=tcp://$HOST2:2375 $WEAVE ps c2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') - -assert "exec_on $HOST1 c1 dig +short seetwo.weave.local" "$C2IP" -assert "exec_on $HOST1 c1 dig +short -x $C2IP" "seetwo.weave.local." +assert "exec_on $HOST1 c1 dig +short seetwo.weave.local" "$C2" +assert "exec_on $HOST1 c1 dig +short -x $C2" "seetwo.weave.local." end_suite diff --git a/test/500_weave_multi_cidr_test.sh b/test/500_weave_multi_cidr_test.sh index f9cdf3d8..989919c4 100755 --- a/test/500_weave_multi_cidr_test.sh +++ b/test/500_weave_multi_cidr_test.sh @@ -7,20 +7,6 @@ start_suite "Weave run/start/attach/detach with multiple cidr arguments" weave_on $HOST1 launch weave_on $HOST1 launch-dns 10.254.254.254/24 -# weave_status_on -weave_status_on() { - HOST=$1; shift - - DOCKER_HOST=tcp://$HOST:2375 $WEAVE status -} - -# weave_ps_on -weave_ps_on() { - HOST=$1; shift - - DOCKER_HOST=tcp://$HOST:2375 $WEAVE ps -} - # assert_container_cidrs [ ...] assert_container_cidrs() { HOST=$1; shift @@ -28,7 +14,7 @@ assert_container_cidrs() { CIDRS=$@ # Assert container has attached CIDRs - assert_raises "weave_ps_on $HOST | grep \"^$CID [^ ]* $CIDRS$\"" + assert_raises "weave_on $HOST ps | grep \"^$CID [^ ]* $CIDRS$\"" } # assert_zone_records [ ...] @@ -38,11 +24,11 @@ assert_zone_records() { FQDN=$1; shift # Assert correct number of records exist - assert "weave_status_on $HOST | grep \"^$CID\" | wc -l" $# + assert "weave_on $HOST status | grep \"^$CID\" | wc -l" $# # Assert correct records exist for IP in $@; do - assert_raises "weave_status_on $HOST | grep \"^$CID $IP $FQDN$\"" + assert_raises "weave_on $HOST status | grep \"^$CID $IP $FQDN$\"" done } @@ -58,7 +44,7 @@ assert_bridge_cidrs() { } # Run container with three cidrs -CID=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE 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=$(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) 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