From 891568d6d76d2545c465e2b8cadc010ca065c0a6 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 23 Dec 2024 17:35:32 +0100 Subject: [PATCH] CI: Add unreadable files to check-logs.sh fluentd emits a warn message when it can't read a file "unreadable. It is excluded and would be examined next time." Depends-On: https://review.opendev.org/c/openstack/kolla/+/939055 Depends-On: https://review.opendev.org/c/openstack/kolla/+/939088 Change-Id: I4313b6918c381ec5e79e78df2f9a0cbaf25df53e --- tests/check-logs.sh | 6 +++--- tests/get_logs.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/check-logs.sh b/tests/check-logs.sh index 18a9fcfee3..951b372537 100755 --- a/tests/check-logs.sh +++ b/tests/check-logs.sh @@ -8,7 +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:") +declare -a fluentchecks=("got incomplete line before first line" "pattern not matched:" "unreadable. It is excluded and would be examined next time." "Permission denied @ rb_sysopen") function check_openstack_log_file_for_level { # $1: file @@ -26,7 +26,7 @@ function check_fluentd_log_file_for_level { function check_fluentd_log_file_for_content { # $1: file # $2: content - sudo egrep " $2 " $1 + sudo egrep "$2" $1 } function check_docker_log_file_for_sigkill { @@ -96,7 +96,7 @@ for string in "${fluentchecks[@]}"; do if check_fluentd_log_file_for_content $fluentd_log_file "$string" >/dev/null; then any_critical=1 echo "(critical) Found some error log messages in fluentd logs. Matches in $fluentd_file" - echo "$string" >> $fluentd_file + echo "Check: $string" >> $fluentd_file check_fluentd_log_file_for_content $fluentd_log_file "$string" >> $fluentd_file echo >> $fluentd_file fi diff --git a/tests/get_logs.sh b/tests/get_logs.sh index 10f64aea50..55dbca03fb 100644 --- a/tests/get_logs.sh +++ b/tests/get_logs.sh @@ -28,6 +28,8 @@ copy_logs() { elif [ "$CONTAINER_ENGINE" = "podman" ]; then cp -rL /etc/containers/ ${LOG_DIR}/system_configs/ fi + # List all permissions to log files + ls -lLR /var/log/kolla > ${LOG_DIR}/system_logs/ls_lr_var_log_kolla.txt # Remove /var/log/kolla link to not double the data uploaded unlink /var/log/kolla cp -rvnL /var/log/* ${LOG_DIR}/system_logs/