From 3cabf10520c792d24fa646db7f6de5c93aef5276 Mon Sep 17 00:00:00 2001 From: Chris54721 Date: Fri, 18 Mar 2016 20:07:58 +0100 Subject: [PATCH] Add tests for main.cf overrides --- Makefile | 3 ++- test/main.cf | 2 ++ test/tests.bats | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/main.cf diff --git a/Makefile b/Makefile index 05029946..a64deb56 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ build: run: # Copy test files cp test/accounts.cf postfix/ + cp test/main.cf postfix/ cp test/virtual postfix/ # Run containers docker run -d --name mail \ @@ -51,6 +52,6 @@ tests: clean: # Get default files back - git checkout postfix/accounts.cf postfix/virtual + git checkout postfix/accounts.cf postfix/main.cf postfix/virtual # Remove running test containers docker rm -f mail mail_pop3 mail_smtponly diff --git a/test/main.cf b/test/main.cf new file mode 100644 index 00000000..37155392 --- /dev/null +++ b/test/main.cf @@ -0,0 +1,2 @@ +max_idle = 600s +readme_directory = /tmp diff --git a/test/tests.bats b/test/tests.bats index be681fb1..89de473e 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -217,6 +217,13 @@ [ "${lines[1]}" = "otherdomain.tld" ] } +@test "checking postfix: main.cf overrides" { + run docker exec mail grep -q 'max_idle = 600s' /tmp/postfix/main.cf + [ "$status" -eq 0 ] + run docker exec mail grep -q 'readme_directory = /tmp' /tmp/postfix/main.cf + [ "$status" -eq 0 ] +} + # # spamassassin #