2022-11-25 22:37:58 +00:00
|
|
|
load "${REPOSITORY_ROOT}/test/test_helper/common"
|
2020-05-09 20:39:53 +00:00
|
|
|
|
|
|
|
# Test case
|
|
|
|
# ---------
|
|
|
|
# POSTFIX_INET_PROTOCOLS value is set
|
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
@test "checking postfix: inet default" {
|
|
|
|
local PRIVATE_CONFIG
|
2022-05-05 08:28:38 +00:00
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container . )
|
2022-05-30 00:53:30 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
docker run -d --name mail_postfix_inet_default \
|
2022-05-30 00:53:30 +00:00
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
|
|
|
-h mail.my-domain.com -t "${NAME}"
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
teardown() { docker rm -f mail_postfix_inet_default; }
|
|
|
|
|
|
|
|
wait_for_finished_setup_in_container mail_postfix_inet_default
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
run docker exec mail_postfix_inet_default postconf inet_protocols
|
|
|
|
assert_output "inet_protocols = all"
|
|
|
|
assert_success
|
2020-05-09 20:39:53 +00:00
|
|
|
}
|
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
@test "checking postfix: inet all" {
|
|
|
|
local PRIVATE_CONFIG
|
2022-05-05 08:28:38 +00:00
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container . )
|
2022-05-30 00:53:30 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
docker run -d --name mail_postfix_inet_all \
|
2022-05-30 00:53:30 +00:00
|
|
|
-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}"
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
teardown() { docker rm -f mail_postfix_inet_all; }
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
wait_for_finished_setup_in_container mail_postfix_inet_all
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
run docker exec mail_postfix_inet_all postconf inet_protocols
|
|
|
|
assert_output "inet_protocols = all"
|
|
|
|
assert_success
|
|
|
|
}
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
@test "checking postfix: inet ipv4" {
|
|
|
|
local PRIVATE_CONFIG
|
2022-05-05 08:28:38 +00:00
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container . )
|
2022-05-30 00:53:30 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
docker run -d --name mail_postfix_inet_ipv4 \
|
2022-05-30 00:53:30 +00:00
|
|
|
-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}"
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
teardown() { docker rm -f mail_postfix_inet_ipv4; }
|
2020-05-09 20:39:53 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
wait_for_finished_setup_in_container mail_postfix_inet_ipv4
|
2020-05-09 20:39:53 +00:00
|
|
|
|
|
|
|
run docker exec mail_postfix_inet_ipv4 postconf inet_protocols
|
|
|
|
assert_output "inet_protocols = ipv4"
|
|
|
|
assert_success
|
|
|
|
}
|
2020-10-20 07:33:47 +00:00
|
|
|
|
2020-05-09 20:39:53 +00:00
|
|
|
@test "checking postfix: inet ipv6" {
|
2020-10-20 07:33:47 +00:00
|
|
|
local PRIVATE_CONFIG
|
2022-05-05 08:28:38 +00:00
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container . )
|
2022-05-30 00:53:30 +00:00
|
|
|
|
2020-10-20 07:33:47 +00:00
|
|
|
docker run -d --name mail_postfix_inet_ipv6 \
|
2022-05-30 00:53:30 +00:00
|
|
|
-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}"
|
2020-10-20 07:33:47 +00:00
|
|
|
|
|
|
|
teardown() { docker rm -f mail_postfix_inet_ipv6; }
|
|
|
|
|
|
|
|
wait_for_finished_setup_in_container mail_postfix_inet_ipv6
|
|
|
|
|
2020-05-09 20:39:53 +00:00
|
|
|
run docker exec mail_postfix_inet_ipv6 postconf inet_protocols
|
|
|
|
assert_output "inet_protocols = ipv6"
|
|
|
|
assert_success
|
|
|
|
}
|