diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2025-06-25 09:24:52 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2025-06-25 19:31:21 +0000 |
| commit | 4595bc7dce28e28a92c75296f0e782e9651ecaa2 (patch) | |
| tree | a2a13e4218b468fee51ac311ffe33864f43639d0 /tests/check-logs.sh | |
| parent | d1b1c55b6439d8f4da752e7ce0a1c8e8070b22bc (diff) | |
| download | kolla-ansible-4595bc7dce28e28a92c75296f0e782e9651ecaa2.tar.gz kolla-ansible-4595bc7dce28e28a92c75296f0e782e9651ecaa2.zip | |
CI: Fix check-logs.sh routine for finding missing fluentd logs
Change-Id: Ie5afd40ffb5517cd0d77c46b55a304ad0c7d4007
Diffstat (limited to 'tests/check-logs.sh')
| -rwxr-xr-x | tests/check-logs.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/check-logs.sh b/tests/check-logs.sh index ebf973848..2b5ded2cf 100755 --- a/tests/check-logs.sh +++ b/tests/check-logs.sh @@ -30,7 +30,7 @@ function check_fluentd_log_file_for_content { } function check_fluentd_missing_logs { - code=0 + code=1 for file in $(sudo find /var/log/kolla/ -type f -name '*.log' | grep -v '^$'); do case $file in /var/log/kolla/ansible.log) @@ -91,7 +91,10 @@ function check_fluentd_missing_logs { continue ;; *) - sudo grep -q "following tail of $file" /var/log/kolla/fluentd/fluentd.log || echo "no match for $file" && code=1 + if ! sudo grep -q "following tail of $file" $fluentd_log_file; then + echo "no match for $file" + code=0 + fi ;; esac done @@ -151,7 +154,7 @@ for level in CRITICAL ERROR WARNING; do fi done -if [ -d /var/log/kolla ]; then +if sudo test -d /var/log/kolla; then # 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 |
