2022-11-25 22:37:58 +00:00
|
|
|
load "${REPOSITORY_ROOT}/test/helper/setup"
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
2022-01-05 23:53:18 +00:00
|
|
|
|
2022-11-25 21:59:14 +00:00
|
|
|
TEST_NAME_PREFIX='Dovecot protocols:'
|
|
|
|
|
|
|
|
@test "${TEST_NAME_PREFIX} dual-stack IP configuration" {
|
|
|
|
local CONTAINER_NAME='dms-test-dovecot_protocols_all'
|
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(--env DOVECOT_INET_PROTOCOLS=)
|
|
|
|
|
|
|
|
init_with_defaults
|
|
|
|
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
2022-01-05 23:53:18 +00:00
|
|
|
|
2022-11-25 21:59:14 +00:00
|
|
|
_run_in_container grep '^#listen = \*, ::' /etc/dovecot/dovecot.conf
|
2022-01-05 23:53:18 +00:00
|
|
|
assert_success
|
|
|
|
assert_output '#listen = *, ::'
|
2022-11-25 21:59:14 +00:00
|
|
|
|
|
|
|
docker rm -f "${CONTAINER_NAME}"
|
2022-01-05 23:53:18 +00:00
|
|
|
}
|
|
|
|
|
2022-11-25 21:59:14 +00:00
|
|
|
@test "${TEST_NAME_PREFIX} IPv4 configuration" {
|
|
|
|
local CONTAINER_NAME='dms-test-dovecot_protocols_ipv4'
|
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(--env DOVECOT_INET_PROTOCOLS=ipv4)
|
|
|
|
|
|
|
|
init_with_defaults
|
|
|
|
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
|
|
|
|
|
|
|
_run_in_container grep '^listen = \*$' /etc/dovecot/dovecot.conf
|
2022-01-05 23:53:18 +00:00
|
|
|
assert_success
|
|
|
|
assert_output 'listen = *'
|
2022-11-25 21:59:14 +00:00
|
|
|
|
|
|
|
docker rm -f "${CONTAINER_NAME}"
|
2022-01-05 23:53:18 +00:00
|
|
|
}
|
|
|
|
|
2022-11-25 21:59:14 +00:00
|
|
|
@test "${TEST_NAME_PREFIX} IPv6 configuration" {
|
|
|
|
local CONTAINER_NAME='dms-test-dovecot_protocols_ipv6'
|
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(--env DOVECOT_INET_PROTOCOLS=ipv6)
|
|
|
|
|
|
|
|
init_with_defaults
|
|
|
|
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
|
|
|
|
|
|
|
_run_in_container grep '^listen = \[::\]$' /etc/dovecot/dovecot.conf
|
2022-01-05 23:53:18 +00:00
|
|
|
assert_success
|
|
|
|
assert_output 'listen = [::]'
|
|
|
|
|
2022-11-25 21:59:14 +00:00
|
|
|
docker rm -f "${CONTAINER_NAME}"
|
2022-01-05 23:53:18 +00:00
|
|
|
}
|