Redirect sanity checks' output to temporary files (and archive them as artifact files under CircleCLI).

This should make it easier to find and access relevant debugging information without polluting STDOUT and without any risk of log interleaving. See also:
- https://weaveworks.slack.com/archives/net/p1482154505001192
- https://weaveworks.slack.com/archives/net/p1482254780001493
This commit is contained in:
Marc CARRE committed 2017-01-09 09:17:45 +00:00
1 parent 172597a68d
commit f73fb5307f
2 files changed
+18 -6

No files matched your search

+2
View File
@@ -9,5 +9,7 @@ if [ -n "$TEST_AND_PUBLISH" ] ; then
cd $SRCDIR/test
eval $(./gce.sh hosts)
export COVERAGE=true
export WEAVE_NET_SANITY_CHECKS_FILES="/tmp/weave_net_sanity_check_*.log"
./run_all.sh
cp $WEAVE_NET_SANITY_CHECKS_FILES $CIRCLE_ARTIFACTS
fi
+16 -6
View File
@@ -5,6 +5,7 @@
set -e
begin=$(date +%s)
sanity_checks_files=${WEAVE_NET_SANITY_CHECKS_FILES:-"/tmp/weave_net_sanity_check_*.log"}
whitely echo Ping each host from the other
@@ -14,12 +15,17 @@ whitely echo Ping each host from the other
function check_ping() {
local output=$(run_on $1 $PING $2)
local status=$?
echo $output
echo "$output" >> "${sanity_checks_files/\*/$1}"
return $status
}
pids=""
for host in $HOSTS; do
cat >> "${sanity_checks_files/\*/$host}" <<EOF
# =====================================
# Host Ping Check: $host
# =====================================
EOF
for other in $HOSTS; do
if [ "$host" != "$other" ]; then
check_ping "$host" "$other" &
@@ -37,16 +43,20 @@ function check_docker() {
docker_info=$(docker_on $1 info)
docker_weave_version=$(docker_on $1 inspect -f {{.Created}} weaveworks/weave:${WEAVE_VERSION:-latest})
weave_version=$(weave_on $1 version)
cat << EOF
Host Version Info: $1
=====================================
cat >> "${sanity_checks_files/\*/$1}" << EOF
# =====================================
# Host Version Info: $1
# =====================================
# docker version
$docker_version
# docker info
$docker_info
# weave version
# docker inspect -f {{.Created}} weaveworks/weave:<version>
$docker_weave_version
# weave version
$weave_version
EOF
}