diff --git a/integration/100_launch_test.sh b/integration/100_launch_test.sh deleted file mode 100755 index 45dba69fa0..0000000000 --- a/integration/100_launch_test.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch scope and check it boots" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch - -wait_for_containers "$HOST1" 60 weave weaveproxy weavescope - -has_container "$HOST1" weave -has_container "$HOST1" weaveproxy -has_container "$HOST1" weavescope - -scope_end_suite diff --git a/integration/105_launch_sans_weave_test.sh b/integration/105_launch_sans_weave_test.sh deleted file mode 100755 index ac27d5aa73..0000000000 --- a/integration/105_launch_sans_weave_test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch scope (without weave installed) and check it boots" - -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 diff --git a/integration/106_launch_with_peers_test.sh b/integration/106_launch_with_peers_test.sh deleted file mode 100755 index 84b5ced685..0000000000 --- a/integration/106_launch_with_peers_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch scope and check it boots, with a spurious host arg" - -scope_on "$HOST1" launch noatrealhost.foo - -wait_for_containers "$HOST1" 60 weavescope - -has_container "$HOST1" weavescope - -scope_end_suite diff --git a/integration/110_shutdown_test.sh b/integration/110_shutdown_test.sh deleted file mode 100755 index 855001b454..0000000000 --- a/integration/110_shutdown_test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Check scope exits cleanly within 5 seconds" - -scope_on "$HOST1" launch -sleep 5 -scope_on "$HOST1" stop - -sleep 5 - -# Save stdout for debugging output -exec 3>&1 -assert_raises "docker_on $HOST1 logs weavescope 2>&1 | grep 'app exiting' || (docker_on $HOST1 logs weavescope 2>&3 ; false)" -assert_raises "docker_on $HOST1 logs weavescope 2>&1 | grep 'probe exiting' || (docker_on $HOST1 logs weavescope 2>&3 ; false)" -assert_raises "docker_on $HOST1 inspect --format='{{.State.Running}}' weavescope" "false" - -scope_end_suite diff --git a/integration/115_topologies_test.sh b/integration/115_topologies_test.sh deleted file mode 100755 index ca502a2a92..0000000000 --- a/integration/115_topologies_test.sh +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test some key topologies are not empty" - -scope_on "$HOST1" launch - -wait_for_containers "$HOST1" 60 weavescope - -topology_is_not_empty() { - local host="$1" - local topology="$2" - local timeout="${5:-60}" - - for _ in $(seq "$timeout"); do - local report - local count - report="$(curl -s "http://$host:4040/api/report")" - count=$(echo "$report" | jq -r ".$topology.nodes | length > 0" 2>/dev/null) - - if [ "$count" = "true" ]; then - assert "curl -s http://$host:4040/api/report | jq -r '.$topology.nodes | length > 0'" true - return - fi - sleep 1 - done - - echo "Failed to find any nodes in the $topology topology after $timeout secs" - assert "curl -s http://$host:4040/api/report | jq -r '.$topology.nodes | length > 0'" true -} - -topology_is_not_empty "$HOST1" Endpoint -topology_is_not_empty "$HOST1" Process -topology_is_not_empty "$HOST1" Container -topology_is_not_empty "$HOST1" ContainerImage -topology_is_not_empty "$HOST1" Host - -scope_end_suite diff --git a/integration/200_clustering_2_test.sh b/integration/200_clustering_2_test.sh deleted file mode 100755 index 07c6a6cf8e..0000000000 --- a/integration/200_clustering_2_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch 2 scopes and check they cluster automatically" - -weave_on "$HOST1" launch "$HOST1" "$HOST2" -weave_on "$HOST2" launch "$HOST1" "$HOST2" - -scope_on "$HOST1" launch -scope_on "$HOST2" launch - -docker_on "$HOST1" run -dit --name db1 peterbourgon/tns-db -docker_on "$HOST2" run -dit --name db2 peterbourgon/tns-db - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports - -check() { - has_container "$1" weave 2 - has_container "$1" weaveproxy 2 - has_container "$1" weavescope 2 - has_container "$1" db1 - has_container "$1" db2 -} - -check "$HOST1" -check "$HOST2" - -scope_end_suite diff --git a/integration/205_clustering_sans_weave_2_test.sh b/integration/205_clustering_sans_weave_2_test.sh deleted file mode 100755 index ad6a95c91f..0000000000 --- a/integration/205_clustering_sans_weave_2_test.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch 2 scopes and check they cluster (without weave)" - -scope_on "$HOST1" launch "$HOST2" -scope_on "$HOST2" launch "$HOST1" - -docker_on "$HOST1" run -dit --name db1 peterbourgon/tns-db -docker_on "$HOST2" run -dit --name db2 peterbourgon/tns-db - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports. - -check() { - has_container "$1" weave 0 - has_container "$1" weaveproxy 0 - has_container "$1" weavescope 2 - has_container "$1" db1 - has_container "$1" db2 -} - -check "$HOST1" -check "$HOST2" - -scope_end_suite diff --git a/integration/210_clustering_custom_hostname_2_test.sh b/integration/210_clustering_custom_hostname_2_test.sh deleted file mode 100755 index 043487659b..0000000000 --- a/integration/210_clustering_custom_hostname_2_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch 2 scopes and check they cluster automatically, with custom weave domain" - -weave_on "$HOST1" launch --dns-domain foo.local "$HOST1" "$HOST2" -weave_on "$HOST2" launch --dns-domain foo.local "$HOST1" "$HOST2" - -scope_on "$HOST1" launch --weave.hostname=bar.foo.local -scope_on "$HOST2" launch --weave.hostname bar.foo.local - -docker_on "$HOST1" run -dit --name db1 peterbourgon/tns-db -docker_on "$HOST2" run -dit --name db2 peterbourgon/tns-db - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports - -check() { - has_container "$1" weave 2 - has_container "$1" weaveproxy 2 - has_container "$1" weavescope 2 - has_container "$1" db1 - has_container "$1" db2 -} - -check "$HOST1" -check "$HOST2" - -scope_end_suite diff --git a/integration/215_clustering_split_2_test.sh b/integration/215_clustering_split_2_test.sh deleted file mode 100755 index 7acf794123..0000000000 --- a/integration/215_clustering_split_2_test.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Launch 2 scopes and check they cluster (without weave)" - -scope_on "$HOST1" launch --no-app "$HOST2" -scope_on "$HOST2" launch --no-probe - -docker_on "$HOST1" run -dit --name db1 peterbourgon/tns-db - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports. - -has_container "$HOST2" weavescope -has_container "$HOST2" db1 - -scope_end_suite diff --git a/integration/300_internet_edge_test.sh b/integration/300_internet_edge_test.sh deleted file mode 100755 index 1a7992f54b..0000000000 --- a/integration/300_internet_edge_test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connections from the Internet [DISABLED]" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch - -## Test disabled: it is currently flaky -## https://github.com/weaveworks/scope/issues/2308 - -# docker_on "$HOST1" run -d -p 80:80 --name nginx nginx -# -# do_connections() { -# while true; do -# curl -s "http://$HOST1:80/" >/dev/null || true -# sleep 1 -# done -# } -# do_connections & -# -# wait_for_containers "$HOST1" 60 nginx "The Internet" -# -# has_connection_by_id containers "$HOST1" "in-theinternet" "$(node_id containers "$HOST1" nginx)" -# -# kill %do_connections - -scope_end_suite diff --git a/integration/301_internet_edge_with_ebpf_test.sh b/integration/301_internet_edge_with_ebpf_test.sh deleted file mode 100755 index e5ba57415f..0000000000 --- a/integration/301_internet_edge_with_ebpf_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connections from the Internet [DISABLED]" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch --probe.ebpf.connections=true - -## Test disabled: it is currently flaky -## https://github.com/weaveworks/scope/issues/2308 - -# docker_on "$HOST1" run -d -p 80:80 --name nginx nginx -# -# do_connections() { -# while true; do -# curl -s "http://$HOST1:80/" >/dev/null || true -# sleep 1 -# done -# } -# do_connections & -# -# wait_for_containers "$HOST1" 60 nginx "The Internet" -# -# has_connection_by_id containers "$HOST1" "in-theinternet" "$(node_id containers "$HOST1" nginx)" -# -# endpoints_have_ebpf "$HOST1" -# -# kill %do_connections - -scope_end_suite diff --git a/integration/310_container_to_container_edge_test.sh b/integration/310_container_to_container_edge_test.sh index bb67b9fd00..28961c3089 100755 --- a/integration/310_container_to_container_edge_test.sh +++ b/integration/310_container_to_container_edge_test.sh @@ -1,4 +1,6 @@ -#! /bin/bash +#! /bin/bash -x + +export DEBUG=1 # shellcheck disable=SC1091 . ./config.sh diff --git a/integration/311_container_to_container_edge_with_ebpf_test.sh b/integration/311_container_to_container_edge_with_ebpf_test.sh deleted file mode 100755 index 7c66be7b92..0000000000 --- a/integration/311_container_to_container_edge_with_ebpf_test.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connections between containers, with ebpf connection tracking enabled" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch --probe.ebpf.connections=true -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" - -wait_for_containers "$HOST1" 60 nginx client - -has_container "$HOST1" nginx -has_container "$HOST1" client - -list_containers "$HOST1" -list_connections "$HOST1" - -has_connection containers "$HOST1" client nginx - -endpoints_have_ebpf "$HOST1" - -scope_end_suite diff --git a/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh b/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh deleted file mode 100755 index 820114e9a1..0000000000 --- a/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connection between containers in same network namespace, with ebpf connection tracking enabled" - -scope_on "$HOST1" launch --probe.ebpf.connections=true -docker_on "$HOST1" run -d --name nginx nginx -docker_on "$HOST1" run -d --net=container:nginx --name client albanc/dialer /go/bin/dialer connectshortlived localhost:80 - -wait_for_containers "$HOST1" 60 nginx client - -has_container "$HOST1" nginx -has_container "$HOST1" client - -list_containers "$HOST1" -list_connections "$HOST1" - -has_connection containers "$HOST1" client nginx - -endpoints_have_ebpf "$HOST1" - -scope_end_suite diff --git a/integration/313_container_to_container_edge_with_ebpf_proc_fallback_test.sh b/integration/313_container_to_container_edge_with_ebpf_proc_fallback_test.sh deleted file mode 100755 index 7bdfc9bd25..0000000000 --- a/integration/313_container_to_container_edge_with_ebpf_proc_fallback_test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connections between containers, with ebpf proc fallback" - -weave_on "$HOST1" launch -# Manually start scope in order to set -# `WEAVESCOPE_DOCKER_ARGS="-v /tmp:/sys/kernel/debug/tracing:ro"` -# to make ebpf fail and test the proc fallback. -DOCKER_HOST=tcp://${HOST1}:${DOCKER_PORT} CHECKPOINT_DISABLE=true \ - WEAVESCOPE_DOCKER_ARGS="-v /tmp:/sys/kernel/debug/tracing:ro" \ - "${SCOPE}" launch --probe.ebpf.connections=true -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" - -wait_for_containers "$HOST1" 60 nginx client - -has_container "$HOST1" nginx -has_container "$HOST1" client -has_connection containers "$HOST1" client nginx - -# Save stdout for debugging output -exec 3>&1 -assert_raises "docker_on $HOST1 logs weavescope 2>&1 | grep 'Error setting up the eBPF tracker, falling back to proc scanning' || (docker_on $HOST1 logs weavescope 2>&3 ; false)" - -scope_end_suite diff --git a/integration/320_container_edge_cross_host_2_test.sh b/integration/320_container_edge_cross_host_2_test.sh deleted file mode 100755 index 5a0d3b19c2..0000000000 --- a/integration/320_container_edge_cross_host_2_test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test short lived connections between containers on different hosts" - -weave_on "$HOST1" launch "$HOST1" "$HOST2" -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" - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports - -check() { - has_container "$1" nginx - has_container "$1" client - has_connection containers "$1" client nginx -} - -check "$HOST1" -check "$HOST2" - -scope_end_suite diff --git a/integration/330_process_edge_test.sh b/integration/330_process_edge_test.sh deleted file mode 100755 index e986d13cef..0000000000 --- a/integration/330_process_edge_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -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 \ - nc nginx.weave.local 80 || true; \ - sleep 1; \ -done" - -wait_for processes "$HOST1" 60 "nginx: worker process" nc - -has processes "$HOST1" "nginx: worker process" -has processes "$HOST1" nc -has_connection processes "$HOST1" nc "nginx: worker process" - -scope_end_suite diff --git a/integration/340_process_edge_across_host_2_test.sh b/integration/340_process_edge_across_host_2_test.sh deleted file mode 100755 index 9947e7fbf2..0000000000 --- a/integration/340_process_edge_across_host_2_test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test long connections (procspy) between processes on different hosts" - -weave_on "$HOST1" launch "$HOST1" "$HOST2" -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 \ - nc nginx.weave.local 80 || true; \ - sleep 1; \ -done" - -sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports - -check() { - has processes "$1" "nginx: worker process" - has processes "$1" nc - has_connection processes "$1" nc "nginx: worker process" -} - -check "$HOST1" -check "$HOST2" - -scope_end_suite diff --git a/integration/410_container_control_test.sh b/integration/410_container_control_test.sh deleted file mode 100755 index 02f731f149..0000000000 --- a/integration/410_container_control_test.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test container controls" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch - -CID=$(weave_on "$HOST1" run -dti --name alpine alpine /bin/sh) - -wait_for_containers "$HOST1" 60 alpine - -assert "docker_on $HOST1 inspect --format='{{.State.Running}}' alpine" "true" -PROBEID=$(docker_on "$HOST1" logs weavescope 2>&1 | grep "probe starting" | sed -n 's/^.*ID \([0-9a-f]*\)$/\1/p') - -# Execute 'echo foo' in a container tty and check its output -PIPEID=$(curl -s -f -X POST "http://$HOST1:4040/api/control/$PROBEID/$CID;/docker_exec_container" | jq -r '.pipe') -assert "(sleep 1 && echo 'echo foo' && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb" "alpine:/# 6necho foo\nfoo\nalpine:/# 6n" - -assert_raises "curl -f -X POST 'http://$HOST1:4040/api/control/$PROBEID/$CID;/docker_stop_container'" - -sleep 5 -assert "docker_on $HOST1 inspect --format='{{.State.Running}}' alpine" "false" - -scope_end_suite diff --git a/integration/420_host_control_test.sh b/integration/420_host_control_test.sh deleted file mode 100755 index fe461b091f..0000000000 --- a/integration/420_host_control_test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/bash - -# shellcheck disable=SC1091 -. ./config.sh - -start_suite "Test host controls" - -weave_on "$HOST1" launch -scope_on "$HOST1" launch - -sleep 10 - -PROBEID=$(docker_on "$HOST1" logs weavescope 2>&1 | grep "probe starting" | sed -n 's/^.*ID \([0-9a-f]*\)$/\1/p') -HOSTID=$($SSH "$HOST1" hostname) - -# Execute 'echo foo' in the host tty and check its output -PIPEID=$(curl -s -f -X POST "http://$HOST1:4040/api/control/$PROBEID/$HOSTID;/host_exec" | jq -r '.pipe') -assert "(sleep 1 && echo \"PS1=''; echo foo\" && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb | tail -n 1" "foo\n" - -scope_end_suite diff --git a/integration/config.sh b/integration/config.sh index 72eb51fdfa..eec5ad049c 100644 --- a/integration/config.sh +++ b/integration/config.sh @@ -91,6 +91,9 @@ has_connection_by_id() { local edge edge=$(echo "$nodes" | (jq -r ".nodes[\"$from_id\"].adjacency | contains([\"$to_id\"])" || true) 2>/dev/null) nodes=$(curl -s "http://$host:4040/api/topology/${view}?system=show" || true) + echo "NODES follow\n\n\n" + echo "$nodes" + echo "\n\n\n" if [ "$edge" = "true" ]; then echo "Found edge $from -> $to after $i secs" assert "curl -s http://$host:4040/api/topology/${view}?system=show | jq -r '.nodes[\"$from_id\"].adjacency | contains([\"$to_id\"])'" true