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:'
|
2023-01-03 05:58:09 +00:00
|
|
|
CONTAINER1_NAME='dms-test_dovecot_protocols_all'
|
|
|
|
CONTAINER2_NAME='dms-test_dovecot_protocols_ipv4'
|
|
|
|
CONTAINER3_NAME='dms-test_dovecot_protocols_ipv6'
|
|
|
|
|
|
|
|
function teardown() { _default_teardown ; }
|
2022-11-25 21:59:14 +00:00
|
|
|
|
|
|
|
@test "${TEST_NAME_PREFIX} dual-stack IP configuration" {
|
2023-01-03 05:58:09 +00:00
|
|
|
export CONTAINER_NAME=${CONTAINER1_NAME}
|
2022-11-25 21:59:14 +00:00
|
|
|
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
|
|
|
@test "${TEST_NAME_PREFIX} IPv4 configuration" {
|
2023-01-03 05:58:09 +00:00
|
|
|
export CONTAINER_NAME=${CONTAINER2_NAME}
|
2022-11-25 21:59:14 +00:00
|
|
|
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
|
|
|
@test "${TEST_NAME_PREFIX} IPv6 configuration" {
|
2023-01-03 05:58:09 +00:00
|
|
|
export CONTAINER_NAME=${CONTAINER3_NAME}
|
2022-11-25 21:59:14 +00:00
|
|
|
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 = [::]'
|
|
|
|
}
|