aboutsummaryrefslogtreecommitdiff
path: root/tests/check-logs.sh
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2020-07-22 13:50:17 +0200
committerMichal Nasiadka <mnasiadka@gmail.com>2023-11-29 17:42:44 +0000
commitba54f8cddaf24a9da5c51c575a4679726136d68b (patch)
tree29b9eb99c4b1c50bc59b545346ce5846c6500900 /tests/check-logs.sh
parent0b1a59dd8cc2b402b5a0ad9b02144edd1daf40ca (diff)
downloadkolla-ansible-ba54f8cddaf24a9da5c51c575a4679726136d68b.tar.gz
kolla-ansible-ba54f8cddaf24a9da5c51c575a4679726136d68b.zip
CI: Fail on fluentd log parsing errors
Change-Id: Ie3963f5ed20f7fb61ef2e03f0cf12a4ea1c87c9c
Diffstat (limited to 'tests/check-logs.sh')
-rwxr-xr-xtests/check-logs.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/check-logs.sh b/tests/check-logs.sh
index 33806845d..fa5447c82 100755
--- a/tests/check-logs.sh
+++ b/tests/check-logs.sh
@@ -8,6 +8,7 @@ set -o pipefail
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
+declare -a fluentchecks=("got incomplete line before first line" "pattern not matched")
function check_openstack_log_file_for_level {
# $1: file
@@ -22,6 +23,12 @@ function check_fluentd_log_file_for_level {
sudo egrep "\[$2\]:" $1
}
+function check_fluentd_log_file_for_content {
+ # $1: file
+ # $2: content
+ sudo egrep " $2 " $1
+}
+
function check_docker_log_file_for_sigkill {
sudo journalctl --no-pager -u ${CONTAINER_ENGINE}.service | grep "signal 9"
}
@@ -73,7 +80,6 @@ for level in CRITICAL ERROR WARNING; do
fi
done
-
# check fluentd errors (we consider them critical)
fluentd_log_file=/var/log/kolla/fluentd/fluentd.log
fluentd_error_summary_file=/tmp/logs/kolla/fluentd-error.log
@@ -84,6 +90,16 @@ if check_fluentd_log_file_for_level $fluentd_log_file error >/dev/null; then
echo >> $fluentd_error_summary_file
fi
+for string in "${fluentchecks[@]}"; do
+ fluentd_file=/tmp/logs/kolla/fluentd-errors.log
+ if check_fluentd_log_file_for_content $fluentd_log_file "$string" >/dev/null; then
+ any_critical=1
+ echo "$string" >> $fluentd_file
+ check_fluentd_log_file_for_content $fluentd_log_file "$string" >> $fluentd_file
+ echo >> $fluentd_file
+ fi
+done
+
if check_docker_log_file_for_sigkill >/dev/null; then
any_critical=1
echo "(critical) Found containers killed using signal 9 (SIGKILL) in docker logs."