Skip to content

Commit

Permalink
Merge pull request #2641 from weaveworks/2640-no-weave-run
Browse files Browse the repository at this point in the history
make integration tests pass with latest Weave Net release (2.0)

Fixes #2640.
  • Loading branch information
rade authored Jun 25, 2017
2 parents 40bb28a + b2f14a9 commit bc9e0e3
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 33 deletions.
3 changes: 1 addition & 2 deletions integration/100_launch_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ start_suite "Launch scope and check it boots"
weave_on "$HOST1" launch
scope_on "$HOST1" launch

wait_for_containers "$HOST1" 60 weave weaveproxy weavescope
wait_for_containers "$HOST1" 60 weave weavescope

has_container "$HOST1" weave
has_container "$HOST1" weaveproxy
has_container "$HOST1" weavescope

scope_end_suite
1 change: 0 additions & 1 deletion integration/105_launch_sans_weave_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ scope_on "$HOST1" launch
wait_for_containers "$HOST1" 60 weavescope

has_container "$HOST1" weave 0
has_container "$HOST1" weaveproxy 0
has_container "$HOST1" weavescope

scope_end_suite
1 change: 0 additions & 1 deletion integration/200_clustering_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and

check() {
has_container "$1" weave 2
has_container "$1" weaveproxy 2
has_container "$1" weavescope 2
has_container "$1" db1
has_container "$1" db2
Expand Down
1 change: 0 additions & 1 deletion integration/205_clustering_sans_weave_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and

check() {
has_container "$1" weave 0
has_container "$1" weaveproxy 0
has_container "$1" weavescope 2
has_container "$1" db1
has_container "$1" db2
Expand Down
1 change: 0 additions & 1 deletion integration/210_clustering_custom_hostname_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and

check() {
has_container "$1" weave 2
has_container "$1" weaveproxy 2
has_container "$1" weavescope 2
has_container "$1" db1
has_container "$1" db2
Expand Down
8 changes: 3 additions & 5 deletions integration/310_container_to_container_edge_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ start_suite "Test short lived connections between containers"

weave_on "$HOST1" launch
scope_on "$HOST1" launch
weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \
sleep 1; \
done"

server_on "$HOST1"
client_on "$HOST1"

wait_for_containers "$HOST1" 60 nginx client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ start_suite "Test short lived connections between containers, without ebpf conne

weave_on "$HOST1" launch
scope_on "$HOST1" launch --probe.ebpf.connections=false
weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \
sleep 1; \
done"

server_on "$HOST1"
client_on "$HOST1"

wait_for_containers "$HOST1" 60 nginx client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ weave_on "$HOST1" launch
DOCKER_HOST=tcp://${HOST1}:${DOCKER_PORT} CHECKPOINT_DISABLE=true \
WEAVESCOPE_DOCKER_ARGS="-v /tmp:/sys/kernel/debug/tracing:ro" \
"${SCOPE}" launch
weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \
sleep 1; \
done"

server_on "$HOST1"
client_on "$HOST1"

wait_for_containers "$HOST1" 60 nginx client

Expand Down
4 changes: 2 additions & 2 deletions integration/314_container_accept_before_kretprobe_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ weave_on "$HOST1" launch
# Launch the server before Scope to make sure it calls accept() before Scope's
# kretprobe on the accept function is installed. We use busybox' nc instead of
# Alpine's nc so that it blocks on the accept() syscall.
weave_on "$HOST1" run -d --name server busybox /bin/sh -c "while true; do \
weave_proxy_on "$HOST1" run -d --name server busybox /bin/sh -c "while true; do \
date ;
sleep 1 ;
done | nc -l -p 8080"
Expand All @@ -19,7 +19,7 @@ scope_on "$HOST1" launch
wait_for_containers "$HOST1" 60 server
has_container "$HOST1" server

weave_on "$HOST1" run -d --name client busybox /bin/sh -c "ping -c 5 server.weave.local; \
weave_proxy_on "$HOST1" run -d --name client busybox /bin/sh -c "ping -c 5 server.weave.local; \
while true; do \
date ;
sleep 1 ;
Expand Down
7 changes: 2 additions & 5 deletions integration/320_container_edge_cross_host_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ weave_on "$HOST2" launch "$HOST1" "$HOST2"
scope_on "$HOST1" launch
scope_on "$HOST2" launch

weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST2" run -d --name client alpine /bin/sh -c "while true; do \
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \
sleep 1; \
done"
server_on "$HOST1"
client_on "$HOST2"

sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports

Expand Down
5 changes: 3 additions & 2 deletions integration/330_process_edge_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ start_suite "Test long connections (procspy) between processes"

weave_on "$HOST1" launch
scope_on "$HOST1" launch --probe.conntrack=false
weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST1" run -dti --name client alpine /bin/sh -c "while true; do \

server_on "$HOST1"
weave_proxy_on "$HOST1" run -dti --name client alpine /bin/sh -c "while true; do \
nc nginx.weave.local 80 || true; \
sleep 1; \
done"
Expand Down
4 changes: 2 additions & 2 deletions integration/340_process_edge_across_host_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ weave_on "$HOST2" launch "$HOST1" "$HOST2"
scope_on "$HOST1" launch --probe.conntrack=false
scope_on "$HOST2" launch --probe.conntrack=false

weave_on "$HOST1" run -d --name nginx nginx
weave_on "$HOST2" run -dti --name client alpine /bin/sh -c "while true; do \
server_on "$HOST1"
weave_proxy_on "$HOST2" run -dti --name client alpine /bin/sh -c "while true; do \
nc nginx.weave.local 80 || true; \
sleep 1; \
done"
Expand Down
2 changes: 1 addition & 1 deletion integration/410_container_control_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ start_suite "Test container controls"
weave_on "$HOST1" launch
scope_on "$HOST1" launch

CID=$(weave_on "$HOST1" run -dti --name alpine alpine /bin/sh)
CID=$(weave_proxy_on "$HOST1" run -dti --name alpine alpine /bin/sh)

wait_for_containers "$HOST1" 60 alpine

Expand Down
18 changes: 18 additions & 0 deletions integration/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ weave_on() {
DOCKER_HOST=tcp://$host:$DOCKER_PORT CHECKPOINT_DISABLE=true "$WEAVE" "$@"
}

weave_proxy_on() {
local host=$1
shift 1
[ -z "$DEBUG" ] || greyly echo "Weave proxy on $host: $*" >&2
DOCKER_PORT=12375 docker_on "$host" "$@"
}

server_on() {
weave_proxy_on "$1" run -d --name nginx nginx
}

client_on() {
weave_proxy_on "$1" run -d --name client alpine /bin/sh -c "while true; do \
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \
sleep 1; \
done"
}

scope_end_suite() {
end_suite
for host in $HOSTS; do
Expand Down

0 comments on commit bc9e0e3

Please sign in to comment.