diff --git a/test/helper/sending.bash b/test/helper/sending.bash index aa250365..ffdd7515 100644 --- a/test/helper/sending.bash +++ b/test/helper/sending.bash @@ -45,6 +45,8 @@ function _send_email() { local TEMPLATE_FILE="/tmp/docker-mailserver-test/emails/${1:?Must provide name of template file}.txt" + echo "CONTAINER: ${CONTAINER_NAME} | COMMAND: swaks --server ${SERVER} --port ${PORT} --helo ${HELO} --from ${FROM} --to ${TO} ${MORE_SWAKS_OPTIONS[*]} --data - < ${TEMPLATE_FILE}" >/tmp/log + _run_in_container_bash "swaks --server ${SERVER} --port ${PORT} --helo ${HELO} --from ${FROM} --to ${TO} ${MORE_SWAKS_OPTIONS[*]} --data - < ${TEMPLATE_FILE}" } diff --git a/test/tests/parallel/set1/spam_virus/clamav.bats b/test/tests/parallel/set1/spam_virus/clamav.bats index 70b875cb..c8f86b2a 100644 --- a/test/tests/parallel/set1/spam_virus/clamav.bats +++ b/test/tests/parallel/set1/spam_virus/clamav.bats @@ -54,6 +54,6 @@ function teardown_file() { _default_teardown ; } } @test 'rejects virus' { - _run_in_container_bash "grep 'Blocked INFECTED' /var/log/mail/mail.log | grep ' -> '" + _run_in_container_bash "grep 'Blocked INFECTED' /var/log/mail/mail.log | grep ' -> '" assert_success } diff --git a/test/tests/parallel/set1/spam_virus/postscreen.bats b/test/tests/parallel/set1/spam_virus/postscreen.bats index ab6deffd..d5453c2e 100644 --- a/test/tests/parallel/set1/spam_virus/postscreen.bats +++ b/test/tests/parallel/set1/spam_virus/postscreen.bats @@ -30,7 +30,7 @@ function setup_file() { assert_success # Set default implicit container fallback for helpers: - CONTAINER_NAME=${CONTAINER_NAME} + CONTAINER_NAME=${CONTAINER1_NAME} } function teardown_file() { @@ -45,8 +45,9 @@ function teardown_file() { # Expected postscreen log entry: assert_output --partial 'Protocol error' - _service_log_should_contain_string 'mail' 'COMMAND PIPELINING' - _service_log_should_contain_string 'mail' 'DATA without valid RCPT' + _run_in_container cat /var/log/mail.log + assert_output --partial 'COMMAND PIPELINING' + assert_output --partial 'DATA without valid RCPT' } @test "should successfully pass postscreen and get postfix greeting message (respecting postscreen_greet_wait time)" { @@ -59,5 +60,6 @@ function teardown_file() { # _print_mail_log_for_id "${MAIL_ID}" # assert_output --partial "stored mail into mailbox 'INBOX'" - _service_log_should_contain_string 'mail' 'PASS NEW' + _run_in_container cat /var/log/mail.log + assert_output --partial 'PASS NEW' } diff --git a/test/tests/parallel/set3/mta/smtp_delivery.bats b/test/tests/parallel/set3/mta/smtp_delivery.bats index 2a680a98..c9621148 100644 --- a/test/tests/parallel/set3/mta/smtp_delivery.bats +++ b/test/tests/parallel/set3/mta/smtp_delivery.bats @@ -236,12 +236,12 @@ function setup_file() { @test "rejects spam" { _run_in_container grep 'Blocked SPAM {NoBounceInbound,Quarantined}' /var/log/mail/mail.log assert_success - assert_output --partial ' -> ' + assert_output --partial ' -> ' _should_output_number_of_lines 1 # Amavis log line with SPAMASSASSIN_SPAM_TO_INBOX=0 + grep 'Passed SPAM {RelayedTaggedInbound,Quarantined}' /var/log/mail/mail.log: # Amavis log line with SPAMASSASSIN_SPAM_TO_INBOX=1 + grep 'Blocked SPAM {NoBounceInbound,Quarantined}' /var/log/mail/mail.log: - # -> + # -> # Amavis log line with ENABLE_SRS=1 changes the domain-part to match in a log: # -> # assert_output --partial 'external.tld=spam@example.test> -> '