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.
This commit is contained in:
Matthias Radestock committed 2015-05-16 19:00:35 +01:00
1 parent a94d2ef277
commit 352e31c88b
4 files changed
+10 -29

No files matched your search

+2 -3
View File
@@ -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
+1 -3
View File
@@ -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"
+3 -5
View File
@@ -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
+4 -18
View File
@@ -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 <host>
weave_status_on() {
HOST=$1; shift
DOCKER_HOST=tcp://$HOST:2375 $WEAVE status
}
# weave_ps_on <host>
weave_ps_on() {
HOST=$1; shift
DOCKER_HOST=tcp://$HOST:2375 $WEAVE ps
}
# assert_container_cidrs <host> <cid> <cidr> [<cidr> ...]
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 <host> <cid> <fqdn> <ip> [<ip> ...]
@@ -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