From f342151b80529b876a223f5647fb521101694754 Mon Sep 17 00:00:00 2001 From: Erik Wramner Date: Sun, 26 Jan 2020 16:39:58 +0100 Subject: [PATCH] Fixed several amavis tests and removed commented code --- target/amavis/conf.d/49-docker-mailserver | 3 ++ test/tests.bats | 34 ++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/target/amavis/conf.d/49-docker-mailserver b/target/amavis/conf.d/49-docker-mailserver index 6217d623..3d67ae00 100644 --- a/target/amavis/conf.d/49-docker-mailserver +++ b/target/amavis/conf.d/49-docker-mailserver @@ -5,5 +5,8 @@ use strict; # Bounce spam, the default option for buster is D_PASS to deliver $final_spam_destiny = D_BOUNCE; +# Higher log level to get expected messages at startup +$log_level = 2; + #------------ Do not modify anything below this line ------------- 1; # ensure a defined return diff --git a/test/tests.bats b/test/tests.bats index 3b1ebd9e..8aadb473 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -217,10 +217,8 @@ function count_processed_changes() { } @test "checking smtp: delivers mail to existing account" { - #run docker exec mail /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)' | sed 's/.* to=; 6 ; 1 , orig_to=; 1 , orig_to=; 1 ; 2 ;" cat <<'EOF' | assert_output 1 6 @@ -785,9 +783,37 @@ EOF } @test "checking system: amavis decoders installed and available" { - run docker exec mail /bin/sh -c "grep -E '.*(Internal decoder|Found decoder) for\s+\..*' /var/log/mail/mail.log|grep -Eo '(mail|Z|gz|bz2|xz|lzma|lrz|lzo|lz4|rpm|cpio|tar|deb|rar|arj|arc|zoo|doc|cab|tnef|zip|kmz|7z|jar|swf|lha|iso|exe)' | sort | uniq | tr '\n' ';'" + run docker exec mail /bin/sh -c "grep -E '.*(Internal decoder|Found decoder) for\s+\..*' /var/log/mail/mail.log*|grep -Eo '(mail|Z|gz|bz2|xz|lzma|lrz|lzo|lz4|rpm|cpio|tar|deb|rar|arj|arc|zoo|doc|cab|tnef|zip|kmz|7z|jar|swf|lha|iso|exe)' | sort | uniq" assert_success - assert_output "7z;Z;arc;arj;bz2;cab;cpio;deb;doc;exe;gz;iso;jar;kmz;lha;lrz;lz4;lzma;lzo;mail;rar;rpm;swf;tar;tnef;xz;zip;zoo;" + # Support for doc and zoo removed in buster + cat <<'EOF' | assert_output +7z +Z +arc +arj +bz2 +cab +cpio +deb +exe +gz +iso +jar +kmz +lha +lrz +lz4 +lzma +lzo +mail +rar +rpm +swf +tar +tnef +xz +zip +EOF }