forked from bokysan/docker-postfix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the option to log to rsyslog as plain or JSON and restructure tests
- It's now possible to choose the logging type - either 'plain' or 'json' - The code is ready to support multiple integration tests (with different configurations) - `OPENDKIM_` and `POSTFIX_` variables are handled properly and recorded in the corresponding files. (This had a downfall that `bash` now needs to be installed, so we can probably simplify some of the shell scripts.)
- Loading branch information
Showing
17 changed files
with
211 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
#!/bin/sh | ||
set -e | ||
cd integration-tests | ||
docker-compose up --build --abort-on-container-exit --exit-code-from tests | ||
for i in `find -maxdepth 1 -type d`; do | ||
i="$(basename "$i")" | ||
if [ "$i" == "tester" ] || [ "$i" == "." ] || [ "$i" == ".." ]; then | ||
continue | ||
fi | ||
( | ||
echo "$i" | ||
cd "$i" | ||
docker-compose up --build --abort-on-container-exit --exit-code-from tests | ||
) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
|
||
reset="" | ||
yellow="" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bats | ||
|
||
load /code/scripts/common.sh | ||
load /code/scripts/common-run.sh | ||
|
||
setup() { | ||
mkdir -p /etc/opendkim/ | ||
cat > /etc/opendkim/opendkim.conf <<-EOF | ||
AutoRestart Yes | ||
AutoRestartRate 10/1h | ||
UMask 002 | ||
Syslog Yes | ||
SyslogSuccess Yes | ||
LogWhy No | ||
Canonicalization relaxed/simple | ||
RequireSafeKeys no | ||
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts | ||
InternalHosts refile:/etc/opendkim/TrustedHosts | ||
KeyTable refile:/etc/opendkim/KeyTable | ||
SigningTable refile:/etc/opendkim/SigningTable | ||
Mode sv | ||
PidFile /var/run/opendkim/opendkim.pid | ||
SignatureAlgorithm rsa-sha256 | ||
UserID opendkim:opendkim | ||
Socket inet:8891@localhost | ||
SignHeaders From,Sender,To,CC,Subject,Message-Id,Date,MIME-Version,Content-Type,Reply-To | ||
OversignHeaders From,Sender,To,CC,Subject,Message-Id,Date,MIME-Version,Content-Type,Reply-To | ||
EOF | ||
} | ||
|
||
teardown() { | ||
rm -f /etc/opendkim/opendkim.conf | ||
} | ||
|
||
@test "Make sure that opendkim_custom_commands changes lines" { | ||
local OPENDKIM_RequireSafeKeys=yes | ||
opendkim_custom_commands | ||
cat /etc/opendkim/opendkim.conf | fgrep -qx "RequireSafeKeys yes" | ||
} | ||
|
||
@test "Make sure that opendkim_custom_commands adds lines" { | ||
local OPENDKIM_CaptureUnknownErrors=yes | ||
opendkim_custom_commands | ||
cat /etc/opendkim/opendkim.conf | fgrep -qx "CaptureUnknownErrors yes" | ||
} | ||
|
||
@test "Make sure that opendkim_custom_commands removes lines" { | ||
local OPENDKIM_SignHeaders= | ||
opendkim_custom_commands | ||
if cat /etc/opendkim/opendkim.conf | egrep -q "^SignHeaders"; then | ||
return 1 | ||
fi | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bats | ||
|
||
load /code/scripts/common.sh | ||
load /code/scripts/common-run.sh | ||
|
||
|
||
@test "Make sure that postfix_custom_commands adds lines" { | ||
local POSTFIX_alias_database=hash:/etc/mail/aliases | ||
postfix_custom_commands | ||
cat /etc/postfix/main.cf | fgrep -qx "alias_database = hash:/etc/mail/aliases" | ||
} | ||
|
||
@test "Make sure that postfix_custom_commands removes lines" { | ||
local POSTFIX_readme_directory= | ||
postfix_custom_commands | ||
cat /etc/postfix/main.cf | egrep -q "^#readme_directory" | ||
} |