diff --git a/test/helper/log_and_filtering.bash b/test/helper/log_and_filtering.bash index b7b63018..a497962b 100644 --- a/test/helper/log_and_filtering.bash +++ b/test/helper/log_and_filtering.bash @@ -94,6 +94,7 @@ function _print_mail_log_of_queue_id_from_msgid() { run echo "${QUEUE_ID}" assert_line --regexp "^${QUEUE_ID_REGEX}$" + # Postfix specific logs: _filter_service_log 'mail' "${QUEUE_ID}" } @@ -104,5 +105,6 @@ function _print_mail_log_for_msgid() { local MSG_ID=$(__construct_msgid "${1:?The local-part for MSG_ID was not provided}") shift 1 + # Dovecot specific logs: _filter_service_log 'mail' "msgid=${MSG_ID}" } diff --git a/test/helper/sending.bash b/test/helper/sending.bash index 60a4e359..0159ae8c 100644 --- a/test/helper/sending.bash +++ b/test/helper/sending.bash @@ -123,7 +123,7 @@ function _send_email_with_msgid() { local MSG_ID=$(__construct_msgid "${1:?The local-part for MSG_ID was not provided}") shift 1 - _send_email "${@}" --header "Message-Id: ${MID}" + _send_email "${@}" --header "Message-Id: ${MSG_ID}" } # Send a spam e-mail by utilizing GTUBE. diff --git a/test/tests/parallel/set3/mta/smtp_delivery.bats b/test/tests/parallel/set3/mta/smtp_delivery.bats index d183694b..01c2fc8b 100644 --- a/test/tests/parallel/set3/mta/smtp_delivery.bats +++ b/test/tests/parallel/set3/mta/smtp_delivery.bats @@ -228,7 +228,7 @@ function _successful() { @test "redirects mail to external aliases" { _service_log_should_contain_string 'mail' 'Passed CLEAN {RelayedInbound}' - run bash -c "grep ' -> ' <<< '${output}'" + assert_output --partial ' -> ' _should_output_number_of_lines 2 # assert_output --partial 'external.tld=user@example.test> -> ' } diff --git a/test/tests/serial/mail_pop3.bats b/test/tests/serial/mail_pop3.bats index fd18a1b7..888aaa50 100644 --- a/test/tests/serial/mail_pop3.bats +++ b/test/tests/serial/mail_pop3.bats @@ -33,7 +33,8 @@ function teardown_file() { _default_teardown ; } assert_success } -@test 'Mail log is error-free' { +# TODO: Remove in favor of a common helper method, as described in vmail-id.bats equivalent test-case +@test 'Mail log is error free' { _service_log_should_not_contain_string 'mail' 'non-null host address bits in' _service_log_should_not_contain_string 'mail' ': error:' } diff --git a/test/tests/serial/vmail-id.bats b/test/tests/serial/vmail-id.bats index 47e15b5a..dcd08d45 100644 --- a/test/tests/serial/vmail-id.bats +++ b/test/tests/serial/vmail-id.bats @@ -58,6 +58,7 @@ function teardown_file() { _default_teardown ; } _service_log_should_not_contain_string 'mail' '\(!\)connect' # Postfix: https://github.com/docker-mailserver/docker-mailserver/pull/2597 + # Log line match example: https://github.com/docker-mailserver/docker-mailserver/pull/2598#issuecomment-1141176633 _service_log_should_not_contain_string 'mail' 'using backwards-compatible default setting' # Postgrey: https://github.com/docker-mailserver/docker-mailserver/pull/612#discussion_r117635774