2022-11-25 23:37:58 +01:00
|
|
|
load "${REPOSITORY_ROOT}/test/helper/setup"
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
2019-08-08 21:33:55 +02:00
|
|
|
|
2023-01-09 08:54:04 +01:00
|
|
|
BATS_TEST_NAME_PREFIX='[Relay] (ENV) '
|
2023-01-03 06:58:09 +01:00
|
|
|
CONTAINER_NAME='dms-test_default-relay-host'
|
2022-05-30 02:53:30 +02:00
|
|
|
|
2022-11-25 22:59:14 +01:00
|
|
|
function setup_file() {
|
|
|
|
init_with_defaults
|
2022-05-30 02:53:30 +02:00
|
|
|
|
2022-11-25 22:59:14 +01:00
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(
|
2023-01-03 06:58:09 +01:00
|
|
|
--env DEFAULT_RELAY_HOST=default.relay.host.invalid:25
|
|
|
|
--env PERMIT_DOCKER=host
|
2022-11-25 22:59:14 +01:00
|
|
|
)
|
2019-08-08 21:33:55 +02:00
|
|
|
|
2022-11-25 22:59:14 +01:00
|
|
|
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
2019-08-08 21:33:55 +02:00
|
|
|
}
|
|
|
|
|
2022-11-25 22:59:14 +01:00
|
|
|
function teardown_file() { _default_teardown ; }
|
2019-08-08 21:33:55 +02:00
|
|
|
|
2023-01-09 08:54:04 +01:00
|
|
|
@test "'DEFAULT_RELAY_HOST' should configure 'main.cf:relayhost'" {
|
2022-11-25 22:59:14 +01:00
|
|
|
_run_in_container bash -c 'grep -e "^relayhost =" /etc/postfix/main.cf'
|
2019-08-21 21:16:39 +02:00
|
|
|
assert_output 'relayhost = default.relay.host.invalid:25'
|
2020-10-19 13:13:42 +02:00
|
|
|
}
|