mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Catch errors on config duplication command
This commit is contained in:
parent
5884f866d3
commit
0453240098
|
@ -1,8 +1,10 @@
|
|||
load 'test_helper/common'
|
||||
|
||||
function setup() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container relay-hosts)"
|
||||
docker run -d --name mail_with_default_relay \
|
||||
-v "$(duplicate_config_for_container relay-hosts)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DEFAULT_RELAY_HOST=default.relay.host.invalid:25 \
|
||||
--cap-add=SYS_PTRACE \
|
||||
|
|
|
@ -21,16 +21,19 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_default_dhparams_both_one_dir)"
|
||||
docker run -d --name mail_default_dhparams_one_dir \
|
||||
-v "$(duplicate_config_for_container . mail_default_dhparams_both_one_dir)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DMS_DEBUG=0 \
|
||||
-e ONE_DIR=1 \
|
||||
-h mail.my-domain.com -t ${NAME}
|
||||
wait_for_finished_setup_in_container mail_default_dhparams_one_dir
|
||||
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_default_dhparams_both_not_one_dir)"
|
||||
docker run -d --name mail_default_dhparams_not_one_dir \
|
||||
-v "$(duplicate_config_for_container . mail_default_dhparams_both_not_one_dir)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DMS_DEBUG=0 \
|
||||
-e ONE_DIR=0 \
|
||||
|
|
|
@ -20,8 +20,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_manual_dhparams_one_dir \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-v "$(pwd)/test/test-files/ssl/custom-dhe-params.pem":/var/mail-state/lib-shared/dhparams.pem:ro \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run --rm -d --name mail_disabled_clamav_spamassassin \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_CLAMAV=0 \
|
||||
-e ENABLE_SPAMASSASSIN=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run --rm -d --name mail_fail2ban \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_FAIL2BAN=1 \
|
||||
-e POSTSCREEN_ACTION=ignore \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_fetchmail \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_FETCHMAIL=1 \
|
||||
--cap-add=NET_ADMIN \
|
||||
|
|
|
@ -9,9 +9,12 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG PRIVATE_ETC
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
PRIVATE_ETC="$(duplicate_config_for_container dovecot-lmtp/ mail_lmtp_ip_dovecot-lmtp)"
|
||||
docker run -d --name mail_lmtp_ip \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "$(duplicate_config_for_container dovecot-lmtp/ mail_lmtp_ip_dovecot-lmtp)":/etc/dovecot \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_ETC}":/etc/dovecot \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_POSTFIX_VIRTUAL_TRANSPORT=1 \
|
||||
-e POSTFIX_DAGENT=lmtp:127.0.0.1:24 \
|
||||
|
|
|
@ -5,8 +5,10 @@ function setup() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run --rm -d --name mail_override_hostname \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e PERMIT_DOCKER=network \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_pop3 \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_POP3=1 \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
|
|
@ -4,80 +4,73 @@ load 'test_helper/common'
|
|||
# ---------
|
||||
# POSTFIX_INET_PROTOCOLS value is set
|
||||
|
||||
|
||||
function setup() {
|
||||
run_setup_file_if_necessary
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
run_teardown_file_if_necessary
|
||||
}
|
||||
|
||||
function setup_file() {
|
||||
@test "checking postfix: inet default" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . )"
|
||||
docker run -d --name mail_postfix_inet_default \
|
||||
-v "$(duplicate_config_for_container . mail_postfix_inet_default)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
teardown() { docker rm -f mail_postfix_inet_default; }
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_default
|
||||
|
||||
docker run -d --name mail_postfix_inet_all \
|
||||
-v "$(duplicate_config_for_container . mail_postfix_inet_all)":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=all \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_all
|
||||
|
||||
docker run -d --name mail_postfix_inet_ipv4 \
|
||||
-v "$(duplicate_config_for_container . mail_postfix_inet_ipv4)":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=ipv4 \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_ipv4
|
||||
|
||||
docker run -d --name mail_postfix_inet_ipv6 \
|
||||
-v "$(duplicate_config_for_container . mail_postfix_inet_ipv6)":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=ipv6 \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_ipv6
|
||||
}
|
||||
|
||||
function teardown_file() {
|
||||
docker rm -f mail_postfix_inet_default
|
||||
docker rm -f mail_postfix_inet_all
|
||||
docker rm -f mail_postfix_inet_ipv4
|
||||
docker rm -f mail_postfix_inet_ipv6
|
||||
}
|
||||
|
||||
@test "first" {
|
||||
skip 'this test must come first to reliably identify when to run setup_file'
|
||||
}
|
||||
|
||||
@test "checking postfix: inet default" {
|
||||
run docker exec mail_postfix_inet_default postconf inet_protocols
|
||||
assert_output "inet_protocols = all"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "checking postfix: inet all" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . )"
|
||||
docker run -d --name mail_postfix_inet_all \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=all \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
teardown() { docker rm -f mail_postfix_inet_all; }
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_all
|
||||
|
||||
run docker exec mail_postfix_inet_all postconf inet_protocols
|
||||
assert_output "inet_protocols = all"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "checking postfix: inet ipv4" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . )"
|
||||
docker run -d --name mail_postfix_inet_ipv4 \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=ipv4 \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
teardown() { docker rm -f mail_postfix_inet_ipv4; }
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_ipv4
|
||||
|
||||
run docker exec mail_postfix_inet_ipv4 postconf inet_protocols
|
||||
assert_output "inet_protocols = ipv4"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "checking postfix: inet ipv6" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . )"
|
||||
docker run -d --name mail_postfix_inet_ipv6 \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTFIX_INET_PROTOCOLS=ipv6 \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
||||
teardown() { docker rm -f mail_postfix_inet_ipv6; }
|
||||
|
||||
wait_for_finished_setup_in_container mail_postfix_inet_ipv6
|
||||
|
||||
run docker exec mail_postfix_inet_ipv6 postconf inet_protocols
|
||||
assert_output "inet_protocols = ipv6"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "last" {
|
||||
skip 'this test is only there to reliably mark the end for the teardown_file'
|
||||
}
|
||||
|
|
|
@ -12,8 +12,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_postscreen \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e POSTSCREEN_ACTION=enforce \
|
||||
--cap-add=NET_ADMIN \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_privacy \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SASL_PASSWD="external-domain.com username:password" \
|
||||
-e ENABLE_MANAGESIEVE=1 \
|
||||
|
|
|
@ -14,8 +14,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_no_quotas \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DMS_DEBUG=0 \
|
||||
-e ENABLE_QUOTAS=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run --rm -d --name mail_smtponly \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SMTP_ONLY=1 \
|
||||
-e PERMIT_DOCKER=network \
|
||||
|
|
|
@ -14,8 +14,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_spam_bounced_defined)"
|
||||
docker run -d --name mail_spam_bounced_defined \
|
||||
-v "$(duplicate_config_for_container . mail_spam_bounced_defined)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SPAMASSASSIN=1 \
|
||||
-e SPAMASSASSIN_SPAM_TO_INBOX=0 \
|
||||
|
@ -23,8 +25,9 @@ function setup_file() {
|
|||
|
||||
wait_for_finished_setup_in_container mail_spam_bounced_defined
|
||||
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_spam_bounced_defined)"
|
||||
docker run -d --name mail_spam_bounced_undefined \
|
||||
-v "$(duplicate_config_for_container . mail_spam_bounced_defined)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SPAMASSASSIN=1 \
|
||||
-h mail.my-domain.com -t "${NAME}"
|
||||
|
|
|
@ -14,8 +14,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_spam_moved_junk)"
|
||||
docker run -d --name mail_spam_moved_junk \
|
||||
-v "$(duplicate_config_for_container . mail_spam_moved_junk)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SPAMASSASSIN=1 \
|
||||
-e SPAMASSASSIN_SPAM_TO_INBOX=1 \
|
||||
|
@ -25,8 +27,9 @@ function setup_file() {
|
|||
|
||||
wait_for_finished_setup_in_container mail_spam_moved_junk
|
||||
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_spam_moved_new)"
|
||||
docker run -d --name mail_spam_moved_new \
|
||||
-v "$(duplicate_config_for_container . mail_spam_moved_new)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SPAMASSASSIN=1 \
|
||||
-e SPAMASSASSIN_SPAM_TO_INBOX=1 \
|
||||
|
|
|
@ -9,8 +9,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_special_use_folders \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SASL_PASSWD="external-domain.com username:password" \
|
||||
-e ENABLE_CLAMAV=0 \
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
load 'test_helper/common'
|
||||
|
||||
@test "checking SRS: SRS_DOMAINNAME is used correctly" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_srs_domainname)"
|
||||
docker run --rm -d --name mail_srs_domainname \
|
||||
-v "$(duplicate_config_for_container . mail_srs_domainname)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e PERMIT_DOCKER=network \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
@ -18,8 +20,10 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "checking SRS: DOMAINNAME is handled correctly" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_domainname)"
|
||||
docker run --rm -d --name mail_domainname \
|
||||
-v "$(duplicate_config_for_container . mail_domainname)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e PERMIT_DOCKER=network \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_manual_ssl \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SSL_TYPE=manual \
|
||||
-e SSL_CERT_PATH=/tmp/docker-mailserver/letsencrypt/mail.my-domain.com/fullchain.pem \
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
load 'test_helper/common'
|
||||
|
||||
function setup() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_undef_spam_subject \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SPAMASSASSIN=1 \
|
||||
-e SA_SPAM_SUBJECT="undef" \
|
||||
-h mail.my-domain.com -t ${NAME}
|
||||
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_undef_spam_subject_2)"
|
||||
CONTAINER=$(docker run -d \
|
||||
-v "$(duplicate_config_for_container . mail_undef_spam_subject_2)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-v "$(pwd)/test/onedir":/var/mail-state \
|
||||
-e ENABLE_CLAMAV=1 \
|
||||
|
|
|
@ -10,8 +10,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_with_imap \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_SASLAUTHD=1 \
|
||||
-e SASLAUTHD_MECHANISMS=rimap \
|
||||
|
|
|
@ -17,8 +17,10 @@ function setup_file() {
|
|||
-e LDAP_DOMAIN="localhost.localdomain" \
|
||||
-h ldap.my-domain.com -t ldap
|
||||
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_with_ldap \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_LDAP=1 \
|
||||
-e LDAP_SERVER_HOST=ldap \
|
||||
|
|
|
@ -9,8 +9,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_with_mdbox_format \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SASL_PASSWD="external-domain.com username:password" \
|
||||
-e ENABLE_CLAMAV=0 \
|
||||
|
|
|
@ -9,8 +9,10 @@ function teardown() {
|
|||
}
|
||||
|
||||
function setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_with_postgrey \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_POSTGREY=1 \
|
||||
-e POSTGREY_DELAY=15 \
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
load 'test_helper/common'
|
||||
|
||||
function setup() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
CONTAINER=$(docker run -d \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DMS_DEBUG=0 \
|
||||
-h mail.my-domain.com -t ${NAME})
|
||||
|
|
|
@ -9,8 +9,10 @@ teardown() {
|
|||
}
|
||||
|
||||
setup_file() {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
docker run -d --name mail_with_sdbox_format \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SASL_PASSWD="external-domain.com username:password" \
|
||||
-e ENABLE_CLAMAV=0 \
|
||||
|
|
|
@ -7,26 +7,29 @@ setup() {
|
|||
# use two networks (default ("bridge") and our custom network) to recreate problematic test case where PERMIT_DOCKER=host would not help
|
||||
# currently we cannot use --network in `docker run` multiple times, it will just use the last one
|
||||
# instead we need to use create, network connect and start (see https://success.docker.com/article/multiple-docker-networks)
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_smtponly_second_network)"
|
||||
docker create --name mail_smtponly_second_network \
|
||||
-v "$(duplicate_config_for_container . mail_smtponly_second_network)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SMTP_ONLY=1 \
|
||||
-e PERMIT_DOCKER=connected-networks \
|
||||
-e DMS_DEBUG=0 \
|
||||
-e OVERRIDE_HOSTNAME=mail.my-domain.com \
|
||||
--network ${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME} \
|
||||
-t ${NAME}
|
||||
docker network connect ${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME}2 mail_smtponly_second_network
|
||||
--network "${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME}" \
|
||||
-t "${NAME}"
|
||||
docker network connect "${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME}2" mail_smtponly_second_network
|
||||
docker start mail_smtponly_second_network
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_smtponly_second_network_sender)"
|
||||
docker run -d --name mail_smtponly_second_network_sender \
|
||||
-v "$(duplicate_config_for_container . mail_smtponly_second_network_sender)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e SMTP_ONLY=1 \
|
||||
-e PERMIT_DOCKER=connected-networks \
|
||||
-e DMS_DEBUG=0 \
|
||||
-e OVERRIDE_HOSTNAME=mail.my-domain.com \
|
||||
--network ${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME}2 \
|
||||
-t ${NAME}
|
||||
--network "${NON_DEFAULT_DOCKER_MAIL_NETWORK_NAME}2" \
|
||||
-t "${NAME}"
|
||||
|
||||
# wait until postfix is up
|
||||
wait_for_smtp_port_in_container mail_smtponly_second_network
|
||||
|
|
|
@ -98,9 +98,12 @@ load 'test_helper/common'
|
|||
|
||||
@test "wait_for_finished_setup_in_container" {
|
||||
# variable not local to make visible to teardown
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
# the setup should not be finished immediately after starting
|
||||
|
@ -124,10 +127,13 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "container_has_service_running/wait_for_service" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
# variable not local to make visible to teardown
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
# pick a service that was not started
|
||||
|
@ -147,10 +153,13 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "wait_for_changes_to_be_detected_in_container fails when timeout is reached" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
# variable not local to make visible to teardown
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
# wait for the initial checksum detection to complete
|
||||
|
@ -167,10 +176,13 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "wait_for_changes_to_be_detected_in_container succeeds within timeout" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
# variable not local to make visible to teardown
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
# wait for the initial checksum detection to complete
|
||||
|
@ -186,13 +198,16 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "wait_for_empty_mail_queue_in_container fails when timeout reached" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
# variable not local to make visible to teardown
|
||||
# enable clamav to make message delivery slower, so we can detect it
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_CLAMAV=1 \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
|
@ -211,13 +226,16 @@ load 'test_helper/common'
|
|||
}
|
||||
|
||||
@test "wait_for_empty_mail_queue_in_container succeeds within timeout" {
|
||||
local PRIVATE_CONFIG
|
||||
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
|
||||
# variable not local to make visible to teardown
|
||||
# enable clamav to make message delivery slower, so we can detect it
|
||||
CONTAINER_NAME="$(docker run -d --rm \
|
||||
-v "$(duplicate_config_for_container .)":/tmp/docker-mailserver \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e ENABLE_CLAMAV=1 \
|
||||
-h mail.my-domain.com -t "${NAME}")"
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue