2023-02-06 22:59:01 +00:00
|
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/setup"
|
2019-10-08 20:24:05 +00:00
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
BATS_TEST_NAME_PREFIX='[POP3] '
|
|
|
|
CONTAINER_NAME='dms-test_pop3'
|
2022-05-30 00:53:30 +00:00
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
function setup_file() {
|
|
|
|
_init_with_defaults
|
2019-10-08 20:24:05 +00:00
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(
|
|
|
|
--env ENABLE_POP3=1
|
|
|
|
--env PERMIT_DOCKER=container
|
|
|
|
)
|
2019-10-08 20:24:05 +00:00
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
_common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
2019-10-08 20:24:05 +00:00
|
|
|
}
|
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
function teardown_file() { _default_teardown ; }
|
2019-10-08 20:24:05 +00:00
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
@test 'server is ready' {
|
|
|
|
_run_in_container nc -w 1 0.0.0.0 110
|
2019-10-08 20:24:05 +00:00
|
|
|
assert_success
|
2023-02-06 22:59:01 +00:00
|
|
|
assert_output --partial '+OK'
|
2019-10-08 20:24:05 +00:00
|
|
|
}
|
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
@test 'authentication works' {
|
2023-02-24 09:44:18 +00:00
|
|
|
_send_email 'auth/pop3-auth' '-w 1 0.0.0.0 110'
|
2019-10-08 20:24:05 +00:00
|
|
|
}
|
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
@test 'added user authentication works' {
|
2023-02-24 09:44:18 +00:00
|
|
|
_send_email 'auth/added-pop3-auth' '-w 1 0.0.0.0 110'
|
2019-10-08 20:24:05 +00:00
|
|
|
}
|
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
@test '/var/log/mail/mail.log is error-free' {
|
|
|
|
_run_in_container grep 'non-null host address bits in' /var/log/mail/mail.log
|
2019-10-08 20:24:05 +00:00
|
|
|
assert_failure
|
2023-02-06 22:59:01 +00:00
|
|
|
_run_in_container grep ': error:' /var/log/mail/mail.log
|
2019-10-08 20:24:05 +00:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2023-02-06 22:59:01 +00:00
|
|
|
@test '(Manage Sieve) disabled per default' {
|
|
|
|
_run_in_container nc -z 0.0.0.0 4190
|
2019-10-08 20:24:05 +00:00
|
|
|
assert_failure
|
|
|
|
}
|