diff options
author | Johannes 'fish' Ziemke <github@freigeist.org> | 2016-12-21 11:51:53 +0100 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2016-12-21 11:51:53 +0100 |
commit | ac406e652e2f7751e2248f030c1b5a5b615efdf4 (patch) | |
tree | 873e350bbe150d4e1a5c0903c621568ee9d948bf /end-to-end-test.sh | |
parent | 481392d75cbcb9ae94f47b448f411311c5c54560 (diff) | |
download | prometheus_node_collector-ac406e652e2f7751e2248f030c1b5a5b615efdf4.tar.bz2 prometheus_node_collector-ac406e652e2f7751e2248f030c1b5a5b615efdf4.tar.xz prometheus_node_collector-ac406e652e2f7751e2248f030c1b5a5b615efdf4.zip |
Print log if error occurs
Diffstat (limited to 'end-to-end-test.sh')
-rwxr-xr-x | end-to-end-test.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/end-to-end-test.sh b/end-to-end-test.sh index 8efd36b..e68fd2a 100755 --- a/end-to-end-test.sh +++ b/end-to-end-test.sh | |||
@@ -24,7 +24,6 @@ collectors=$(cat << COLLECTORS | |||
24 | megacli | 24 | megacli |
25 | COLLECTORS | 25 | COLLECTORS |
26 | ) | 26 | ) |
27 | |||
28 | cd "$(dirname $0)" | 27 | cd "$(dirname $0)" |
29 | 28 | ||
30 | port="$((10000 + (RANDOM % 10000)))" | 29 | port="$((10000 + (RANDOM % 10000)))" |
@@ -74,11 +73,13 @@ fi | |||
74 | echo $! > "${tmpdir}/node_exporter.pid" | 73 | echo $! > "${tmpdir}/node_exporter.pid" |
75 | 74 | ||
76 | finish() { | 75 | finish() { |
77 | if [ ${verbose} -ne 0 ] | 76 | if [ $? -ne 0 -o ${verbose} -ne 0 ] |
78 | then | 77 | then |
79 | echo "LOG =====================" | 78 | cat << EOF >&2 |
80 | cat "${tmpdir}/node_exporter.log" | 79 | LOG ===================== |
81 | echo "=========================" | 80 | $(cat "${tmpdir}/node_exporter.log") |
81 | ========================= | ||
82 | EOF | ||
82 | fi | 83 | fi |
83 | 84 | ||
84 | if [ ${update} -ne 0 ] | 85 | if [ ${update} -ne 0 ] |