From 162da635229c829e4238637c57ef18dfa9b9a3b2 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 24 Jun 2017 22:17:47 +0100 Subject: [PATCH 1/3] remove remnants of the weaveproxy and weaveplugin containers --- .gitignore | 2 -- .../weave-docker-api/troubleshooting-proxy.md | 28 ------------------- test/090_docker_restart_policy_2_test.sh | 2 +- test/config.sh | 7 ++--- 4 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 site/weave-docker-api/troubleshooting-proxy.md diff --git a/.gitignore b/.gitignore index 47c9056e..ed8b528e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,7 +37,6 @@ coverage.html prog/weaver/weaver prog/weavedns/weavedns prog/weavehosts/weavehosts -prog/weaveproxy/weaveproxy prog/sigproxy/sigproxy prog/weavewait/weavewait prog/weavewait/weavewait_noop @@ -55,7 +54,6 @@ releases weave*.tar.gz prog/weaver/weave prog/weaveexec/weavehosts -prog/weaveexec/weaveproxy prog/weaveexec/weavewait prog/weaveexec/weavewait_noop prog/weaveexec/weavewait_nomcast diff --git a/site/weave-docker-api/troubleshooting-proxy.md b/site/weave-docker-api/troubleshooting-proxy.md deleted file mode 100644 index 62a3c871..00000000 --- a/site/weave-docker-api/troubleshooting-proxy.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Troubleshooting -menu_order: 60 -search_type: Documentation ---- - -The command - - weave status - -reports on the current status of various Weave Net components, including -the proxy, if it is running: - -``` -... - Service: proxy - Address: tcp://127.0.0.1:12375 -... -``` - -Information on the operation of the proxy can be obtained from the -weaveproxy container logs using: - - docker logs weaveproxy - -**See Also** - - * [Troubleshooting Weave](/site/troubleshooting.md) diff --git a/test/090_docker_restart_policy_2_test.sh b/test/090_docker_restart_policy_2_test.sh index 938bd834..e22dbd8f 100755 --- a/test/090_docker_restart_policy_2_test.sh +++ b/test/090_docker_restart_policy_2_test.sh @@ -12,7 +12,7 @@ assert_raises "check_restart $HOST1 weave" # in the old containers being removed and new ones created weave_on $HOST1 stop weave_on $HOST1 launch --no-restart -assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy" "no" +assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave" "no" assert_raises "! check_restart $HOST1 weave" # Relaunch to prevent the `weave stop` in `end_suite` diff --git a/test/config.sh b/test/config.sh index 2174934e..6ed34cf4 100644 --- a/test/config.sh +++ b/test/config.sh @@ -136,9 +136,7 @@ stop_weave_on() { host=$1 weave_on $host stop 1>/dev/null 2>&1 || true if [ -n "$COVERAGE" ]; then - for C in weaveplugin weave ; do - collect_coverage $host $C - done + collect_coverage $host weave fi } @@ -322,8 +320,7 @@ check_restart() { start_suite() { for host in $HOSTS; do [ -z "$DEBUG" ] || echo "Cleaning up on $host: removing all containers and resetting weave" - PLUGIN_FILTER=$(docker_on $host inspect -f 'grep -v {{printf "%.12s" .Id}}' weaveplugin 2>/dev/null) || PLUGIN_FILTER=cat - rm_containers $host $(docker_on $host ps -aq 2>/dev/null | $PLUGIN_FILTER) + rm_containers $host $(docker_on $host ps -aq 2>/dev/null) weave_on $host reset 2>/dev/null run_on $host sudo rm -f /opt/cni/bin/weave-plugin-latest /opt/cni/bin/weave-net /opt/cni/bin/weave-ipam /etc/cni/net.d/10-weave.conf done From 73b29050b9852c9d3b321f264dab69e3a595f0ba Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 24 Jun 2017 23:10:47 +0100 Subject: [PATCH 2/3] update tools to weaveplugin-free version --- tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools b/tools index 80dd78e6..11400eaa 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit 80dd78e6e35e2b5d24960a8b128675cfe22707d4 +Subproject commit 11400eaa2cea2f954fb3e5ecdf5e5d63649c25c8 From c256daceb096967963ef29e4ac7b2465e2e993f3 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 25 Jun 2017 20:17:53 +0100 Subject: [PATCH 3/3] don't panic when TestMain is invoked as a regular test Just no-op instead. This change is necessary because previously a recent build-tools change no longer excludes prog/* from unit testing since other projects actually do have genuine tests under there. --- prog/weaver/main_test.go | 5 +++-- testing/util.go | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/prog/weaver/main_test.go b/prog/weaver/main_test.go index 1873f4a3..c9cfe8b3 100644 --- a/prog/weaver/main_test.go +++ b/prog/weaver/main_test.go @@ -7,6 +7,7 @@ import ( ) func TestMain(t *testing.T) { - weavetest.TrimTestArgs() - main() + if weavetest.TrimTestArgs() { + main() + } } diff --git a/testing/util.go b/testing/util.go index aed7ae31..f87dba65 100644 --- a/testing/util.go +++ b/testing/util.go @@ -35,8 +35,9 @@ func stackTrace(all bool) string { return string(buf[:stacklen]) } -// TrimTestArgs finds the first -- in os.Args and trim all args before that -func TrimTestArgs() { +// TrimTestArgs finds the first -- in os.Args and trim all args before +// that, returning true when a -- was in fact found. +func TrimTestArgs() bool { i, l := 0, len(os.Args) for ; i < l; i++ { if os.Args[i] == "--" { @@ -44,7 +45,8 @@ func TrimTestArgs() { } } if i == l { - panic("Specify weave args after --") + return false } os.Args = append(os.Args[:1], os.Args[i+1:l]...) + return true }