2020-09-17 21:46:31 +00:00
|
|
|
load 'test_helper/common'
|
|
|
|
|
|
|
|
@test "checking SRS: SRS_DOMAINNAME is used correctly" {
|
2020-10-20 07:33:47 +00:00
|
|
|
local PRIVATE_CONFIG
|
|
|
|
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_srs_domainname)"
|
2020-09-17 21:46:31 +00:00
|
|
|
docker run --rm -d --name mail_srs_domainname \
|
2020-10-20 07:33:47 +00:00
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
|
|
|
-e PERMIT_DOCKER=network \
|
|
|
|
-e DMS_DEBUG=0 \
|
|
|
|
-e ENABLE_SRS=1 \
|
|
|
|
-e SRS_DOMAINNAME=srs.my-domain.com \
|
|
|
|
-e DOMAINNAME=my-domain.com \
|
|
|
|
-h unknown.domain.tld \
|
2020-11-05 12:32:42 +00:00
|
|
|
-t "${NAME}"
|
2020-09-17 21:46:31 +00:00
|
|
|
|
|
|
|
teardown() { docker rm -f mail_srs_domainname; }
|
|
|
|
|
|
|
|
repeat_until_success_or_timeout 15 docker exec mail_srs_domainname grep "SRS_DOMAIN=srs.my-domain.com" /etc/default/postsrsd
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "checking SRS: DOMAINNAME is handled correctly" {
|
2020-10-20 07:33:47 +00:00
|
|
|
local PRIVATE_CONFIG
|
|
|
|
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_domainname)"
|
2020-09-17 21:46:31 +00:00
|
|
|
docker run --rm -d --name mail_domainname \
|
2020-10-20 07:33:47 +00:00
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
|
|
|
-e PERMIT_DOCKER=network \
|
|
|
|
-e DMS_DEBUG=0 \
|
|
|
|
-e ENABLE_SRS=1 \
|
|
|
|
-e DOMAINNAME=my-domain.com \
|
|
|
|
-h unknown.domain.tld \
|
2020-11-05 12:32:42 +00:00
|
|
|
-t "${NAME}"
|
2020-09-17 21:46:31 +00:00
|
|
|
|
|
|
|
teardown() { docker rm -f mail_domainname; }
|
|
|
|
|
|
|
|
repeat_until_success_or_timeout 15 docker exec mail_domainname grep "SRS_DOMAIN=my-domain.com" /etc/default/postsrsd
|
2020-10-19 11:13:42 +00:00
|
|
|
}
|