mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
parent
d9502ab6e7
commit
253c8faef6
4
Makefile
4
Makefile
|
@ -263,9 +263,11 @@ clean:
|
|||
fi
|
||||
-sudo rm -rf test/onedir \
|
||||
test/config/empty \
|
||||
test/config/keyDefault \
|
||||
test/config/key2048 \
|
||||
test/config/key1024 \
|
||||
test/config/without-accounts \
|
||||
test/config/without-virtual \
|
||||
test/config/with-domain \
|
||||
test/config/dovecot-lmtp/userdb \
|
||||
test/config/postfix-*-access.cf*
|
||||
|
||||
|
|
4
setup.sh
4
setup.sh
|
@ -58,7 +58,7 @@ SUBCOMMANDS:
|
|||
|
||||
config:
|
||||
|
||||
$0 config dkim
|
||||
$0 config dkim <keysize> (default: 2048)
|
||||
$0 config ssl
|
||||
|
||||
debug:
|
||||
|
@ -186,7 +186,7 @@ case $1 in
|
|||
shift
|
||||
case $1 in
|
||||
dkim)
|
||||
_docker_image generate-dkim-config
|
||||
_docker_image generate-dkim-config $2
|
||||
;;
|
||||
ssl)
|
||||
_docker_image generate-ssl-certificate
|
||||
|
|
|
@ -527,6 +527,76 @@ load 'test_helper/bats-assert/load'
|
|||
assert_output 2
|
||||
}
|
||||
|
||||
|
||||
# this set of tests is of low quality. It does not test the RSA-Key size properly via openssl or similar
|
||||
# Instead it tests the file-size (here 511) - which may differ with a different domain names
|
||||
# This test may be re-used as a global test to provide better test coverage.
|
||||
@test "checking opendkim: generator creates default keys size" {
|
||||
# Prepare default key size 2048
|
||||
rm -rf "$(pwd)/test/config/keyDefault" && mkdir -p "$(pwd)/test/config/keyDefault"
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/keyDefault/":/tmp/docker-mailserver/ \
|
||||
-v "$(pwd)/test/config/postfix-accounts.cf":/tmp/docker-mailserver/postfix-accounts.cf \
|
||||
-v "$(pwd)/test/config/postfix-virtual.cf":/tmp/docker-mailserver/postfix-virtual.cf \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` /bin/sh -c 'generate-dkim-config | wc -l'
|
||||
assert_success
|
||||
assert_output 6
|
||||
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/keyDefault/opendkim":/etc/opendkim \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` \
|
||||
/bin/sh -c 'stat -c%s /etc/opendkim/keys/localhost.localdomain/mail.txt'
|
||||
|
||||
assert_success
|
||||
assert_output 511
|
||||
}
|
||||
|
||||
# this set of tests is of low quality. It does not test the RSA-Key size properly via openssl or similar
|
||||
# Instead it tests the file-size (here 511) - which may differ with a different domain names
|
||||
# This test may be re-used as a global test to provide better test coverage.
|
||||
@test "checking opendkim: generator creates key size 2048" {
|
||||
# Prepare set key size 2048
|
||||
rm -rf "$(pwd)/test/config/key2048" && mkdir -p "$(pwd)/test/config/key2048"
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/key2048/":/tmp/docker-mailserver/ \
|
||||
-v "$(pwd)/test/config/postfix-accounts.cf":/tmp/docker-mailserver/postfix-accounts.cf \
|
||||
-v "$(pwd)/test/config/postfix-virtual.cf":/tmp/docker-mailserver/postfix-virtual.cf \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` /bin/sh -c 'generate-dkim-config 2048 | wc -l'
|
||||
assert_success
|
||||
assert_output 6
|
||||
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/key2048/opendkim":/etc/opendkim \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` \
|
||||
/bin/sh -c 'stat -c%s /etc/opendkim/keys/localhost.localdomain/mail.txt'
|
||||
|
||||
assert_success
|
||||
assert_output 511
|
||||
}
|
||||
|
||||
# this set of tests is of low quality. It does not test the RSA-Key size properly via openssl or similar
|
||||
# Instead it tests the file-size (here 329) - which may differ with a different domain names
|
||||
# This test may be re-used as a global test to provide better test coverage.
|
||||
@test "checking opendkim: generator creates key size 1024" {
|
||||
# Prepare set key size 1024
|
||||
rm -rf "$(pwd)/test/config/key1024" && mkdir -p "$(pwd)/test/config/key1024"
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/key1024/":/tmp/docker-mailserver/ \
|
||||
-v "$(pwd)/test/config/postfix-accounts.cf":/tmp/docker-mailserver/postfix-accounts.cf \
|
||||
-v "$(pwd)/test/config/postfix-virtual.cf":/tmp/docker-mailserver/postfix-virtual.cf \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` /bin/sh -c 'generate-dkim-config 1024 | wc -l'
|
||||
assert_success
|
||||
assert_output 6
|
||||
|
||||
run docker run --rm \
|
||||
-v "$(pwd)/test/config/key1024/opendkim":/etc/opendkim \
|
||||
`docker inspect --format '{{ .Config.Image }}' mail` \
|
||||
/bin/sh -c 'stat -c%s /etc/opendkim/keys/localhost.localdomain/mail.txt'
|
||||
|
||||
assert_success
|
||||
assert_output 329
|
||||
}
|
||||
|
||||
@test "checking opendkim: generator creates keys, tables and TrustedHosts" {
|
||||
rm -rf "$(pwd)/test/config/empty" && mkdir -p "$(pwd)/test/config/empty"
|
||||
run docker run --rm \
|
||||
|
|
Loading…
Reference in a new issue