minor fixups & converions (_send_mail -> _nc_wrapper)
This commit is contained in:
parent
2a477bfdd4
commit
59d09ab3ad
|
@ -15,7 +15,6 @@
|
|||
# itself. What differs is the parameter `--data`: this functions
|
||||
# takes a file path without prefixes or the need to handle STDIN.
|
||||
#
|
||||
#
|
||||
# ## Attention
|
||||
#
|
||||
# This function assumes `CONTAINER_NAME` to be properly set (to the container
|
||||
|
@ -66,8 +65,7 @@ function _send_email() {
|
|||
# No. 2 is especially useful in case you send more than one email in a single
|
||||
# test file and need to assert certain log entries for each mail individually.
|
||||
#
|
||||
# @param ${1} = template file (path) name without .txt suffix
|
||||
# @param ${2} = config file path name without .cfg suffix [OPTIONAL] (default: ${1})
|
||||
# This function takes the same arguments as `_send_mail`.
|
||||
#
|
||||
# ## Attention
|
||||
#
|
||||
|
|
|
@ -12,7 +12,6 @@ function setup_file() {
|
|||
--env ENABLE_CLAMAV=0
|
||||
--env ENABLE_SPAMASSASSIN=0
|
||||
--env AMAVIS_LOGLEVEL=2
|
||||
--env PERMIT_DOCKER=container
|
||||
)
|
||||
|
||||
_common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
||||
|
|
|
@ -273,7 +273,7 @@ function _successful() {
|
|||
# Query supported extensions; SMTPUTF8 should not be available.
|
||||
# - This query requires a EHLO greeting to the destination server.
|
||||
# - HELO is treated as EHLO when protocol is ESMTP.
|
||||
swaks \
|
||||
_send_email \
|
||||
--ehlo mail.external.tld \
|
||||
--protocol ESMTP \
|
||||
--server mail.example.test \
|
||||
|
|
|
@ -24,12 +24,12 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test 'authentication works' {
|
||||
_send_email 'auth/pop3-auth' '-w 1 0.0.0.0 110'
|
||||
_nc_wrapper 'auth/pop3-auth' '-w 1 0.0.0.0 110'
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test 'added user authentication works' {
|
||||
_send_email 'auth/added-pop3-auth' '-w 1 0.0.0.0 110'
|
||||
_nc_wrapper 'auth/added-pop3-auth' '-w 1 0.0.0.0 110'
|
||||
assert_success
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ function setup_file() {
|
|||
function teardown_file() { _default_teardown ; }
|
||||
|
||||
@test '(Dovecot) LDAP RIMAP connection and authentication works' {
|
||||
_send_email 'auth/imap-auth' '-w 1 0.0.0.0 143'
|
||||
_nc_wrapper 'auth/imap-auth' '-w 1 0.0.0.0 143'
|
||||
assert_success
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,6 @@ function setup_file() {
|
|||
|
||||
# Extra ENV needed to support specific test-cases:
|
||||
local ENV_SUPPORT=(
|
||||
--env PERMIT_DOCKER=container # Required for attempting SMTP auth on port 25 via nc
|
||||
# Required for openssl commands to be successul:
|
||||
# NOTE: snakeoil cert is created (for `docker-mailserver.invalid`) via Debian post-install script for Postfix package.
|
||||
# TODO: Use proper TLS cert
|
||||
|
@ -249,7 +248,7 @@ function teardown() {
|
|||
|
||||
# dovecot
|
||||
@test "dovecot: ldap imap connection and authentication works" {
|
||||
_run_in_container_bash 'nc -w 1 0.0.0.0 143 < /tmp/docker-mailserver-test/auth/imap-ldap-auth.txt'
|
||||
_nc_wrapper 'auth/imap-ldap-auth' '-w 1 0.0.0.0 143'
|
||||
assert_success
|
||||
}
|
||||
|
||||
|
|
|
@ -80,12 +80,12 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test "imap: authentication works" {
|
||||
_send_email 'auth/imap-auth' '-w 1 0.0.0.0 143'
|
||||
_nc_wrapper 'auth/imap-auth' '-w 1 0.0.0.0 143'
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "imap: added user authentication works" {
|
||||
_send_email 'auth/added-imap-auth' '-w 1 0.0.0.0 143'
|
||||
_nc_wrapper 'auth/added-imap-auth' '-w 1 0.0.0.0 143'
|
||||
assert_success
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue