Apply suggestions from code review

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
Georg Lauterbach 2024-01-23 18:56:27 +01:00 committed by GitHub
parent 5da61f97ef
commit f9549829c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,8 @@ function _filter_service_log() {
shift 2 shift 2
local FILE="/var/log/supervisor/${SERVICE}.log" local FILE="/var/log/supervisor/${SERVICE}.log"
[[ -f ${FILE} ]] || FILE="/var/log/mail/${SERVICE}.log" # Fallback to alternative log location: # Alternative log location fallback:
[[ -f ${FILE} ]] || FILE="/var/log/mail/${SERVICE}.log"
_run_in_container grep "${@}" "${STRING}" "${FILE}" _run_in_container grep "${@}" "${STRING}" "${FILE}"
} }

View File

@ -139,9 +139,9 @@ function teardown_file() { _default_teardown ; }
_print_mail_log_of_queue_id_from_msgid 'rspamd-test-email-virus' _print_mail_log_of_queue_id_from_msgid 'rspamd-test-email-virus'
assert_output --partial 'milter-reject' assert_output --partial 'milter-reject'
assert_output --partial '5.7.1 ClamAV FOUND VIRUS "Eicar-Signature"' assert_output --partial '5.7.1 ClamAV FOUND VIRUS "Eicar-Signature"'
refute_output --partial "stored mail into mailbox 'INBOX'"
_print_mail_log_for_msgid 'dms-test-email-spam' _print_mail_log_for_msgid 'dms-test-email-spam'
refute_output --partial "stored mail into mailbox 'INBOX'"
assert_failure assert_failure
_count_files_in_directory_in_container /var/mail/localhost.localdomain/user1/new/ 1 _count_files_in_directory_in_container /var/mail/localhost.localdomain/user1/new/ 1
@ -273,8 +273,8 @@ function teardown_file() { _default_teardown ; }
_nc_wrapper 'nc/rspamd_imap_move_to_junk.txt' '0.0.0.0 143' _nc_wrapper 'nc/rspamd_imap_move_to_junk.txt' '0.0.0.0 143'
sleep 1 # wait for the transaction to finish sleep 1 # wait for the transaction to finish
_service_log_should_contain_string 'mail' 'imapsieve: Matched static mailbox rule \[1\]' _service_log_should_contain_string 'mail' 'imapsieve: Matched static mailbox rule [1]'
_service_log_should_not_contain_string 'mail' 'imapsieve: Matched static mailbox rule \[2\]' _service_log_should_not_contain_string 'mail' 'imapsieve: Matched static mailbox rule [2]'
_show_complete_mail_log _show_complete_mail_log
for LINE in "${LEARN_SPAM_LINES[@]}"; do for LINE in "${LEARN_SPAM_LINES[@]}"; do