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