1
0
mirror of https://github.com/tomav/docker-mailserver.git synced 2024-07-16 12:48:00 +02:00
docker-mailserver/test/tests/serial/mail_pop3.bats
Georg Lauterbach 2caec2cdf6
tests: refactor POP3, IMAP (actually SASLauthd + RIMAP) & relay (#3062)
* refactor `mail_pop3.bats`
* refactor `mail_with_imap.bats`
* refactor `mail_with_relays.bats`
* moved test that that did not belong into POP3 test
* slightly clean up `no_container.bats`

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2023-02-06 23:59:01 +01:00

47 lines
1.1 KiB
Bash

load "${REPOSITORY_ROOT}/test/helper/common"
load "${REPOSITORY_ROOT}/test/helper/setup"
BATS_TEST_NAME_PREFIX='[POP3] '
CONTAINER_NAME='dms-test_pop3'
function setup_file() {
_init_with_defaults
local CUSTOM_SETUP_ARGUMENTS=(
--env ENABLE_POP3=1
--env PERMIT_DOCKER=container
)
_common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
}
function teardown_file() { _default_teardown ; }
@test 'server is ready' {
_run_in_container nc -w 1 0.0.0.0 110
assert_success
assert_output --partial '+OK'
}
@test 'authentication works' {
_run_in_container_bash 'nc -w 1 0.0.0.0 110 < /tmp/docker-mailserver-test/auth/pop3-auth.txt'
assert_success
}
@test 'added user authentication works' {
_run_in_container_bash 'nc -w 1 0.0.0.0 110 < /tmp/docker-mailserver-test/auth/added-pop3-auth.txt'
assert_success
}
@test '/var/log/mail/mail.log is error-free' {
_run_in_container grep 'non-null host address bits in' /var/log/mail/mail.log
assert_failure
_run_in_container grep ': error:' /var/log/mail/mail.log
assert_failure
}
@test '(Manage Sieve) disabled per default' {
_run_in_container nc -z 0.0.0.0 4190
assert_failure
}