From 534b417800185ae2430e6907f61331bbe26f6683 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Sun, 18 Oct 2015 22:02:47 +0200 Subject: [PATCH] Added test for crontab and services --- .gitignore | 2 +- test/test.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 074b0b91..2fc3256c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .DS_Store docker-compose.yml postfix/ssl/* -assert.sh +assert.sh* diff --git a/test/test.sh b/test/test.sh index 37b308cf..6cca8dcd 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,6 +4,12 @@ wget -q https://raw.github.com/lehmannro/assert.sh/master/assert.sh source assert.sh +# Testing that services are running +assert_raises "docker exec mail ps aux --forest | grep '/usr/lib/postfix/master'" "true" +assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/saslauthd'" "true" +assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/clamd'" "true" +assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/amavisd-new'" "true" + # Testing user creation 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" @@ -12,5 +18,8 @@ assert "docker exec mail ls /var/mail/otherdomain.tld/user2" "cur\nnew\ntmp" assert_raises "docker exec mail grep 'status=sent (delivered to maildir)' /var/log/mail.log" "false" assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1/new | wc -l" "1" +# Testing presence of freshclam CRON +assert "docker exec mail crontab -l" "0 1 * * * /usr/bin/freshclam --quiet" + # Ending tests assert_end