Added tests on error logs

This commit is contained in:
Thomas VIAL 2015-10-19 12:06:11 +02:00
parent c6ed9f16a4
commit 74452917fb

6
test/test.sh Executable file → Normal file
View file

@ -12,7 +12,7 @@ assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/amavisd-new'"
# Testing user creation # Testing user creation
assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp" assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp"
assert "docker exec mail ls /var/mail/otherdomain.tld/user2" "cur\nnew\ntmp" assert "docker exec mail ls -A /var/mail/otherdomain.tld/user2" "cur\nnew\ntmp"
# Testing that mail is received for existing user # Testing that mail is received for existing user
assert_raises "docker exec mail grep 'status=sent (delivered to maildir)' /var/log/mail.log" "false" assert_raises "docker exec mail grep 'status=sent (delivered to maildir)' /var/log/mail.log" "false"
@ -21,5 +21,9 @@ assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1/new | wc -l
# Testing presence of freshclam CRON # Testing presence of freshclam CRON
assert "docker exec mail crontab -l" "0 1 * * * /usr/bin/freshclam --quiet" assert "docker exec mail crontab -l" "0 1 * * * /usr/bin/freshclam --quiet"
# Testing that log don't display errors
assert_raises "docker exec mail grep 'non-null host address bits in' /var/log/mail.log" "false"
assert_raises "docker exec mail grep ': error:' /var/log/mail.log" "false"
# Ending tests # Ending tests
assert_end assert_end