mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 10:05:00 +02:00
Change 'for' style (#3368)
This commit is contained in:
parent
8512dba8ad
commit
8bfe8424fc
26 changed files with 43 additions and 86 deletions
|
@ -49,8 +49,7 @@ function teardown_file() {
|
|||
}
|
||||
|
||||
@test "fail2ban-jail.cf overrides" {
|
||||
for FILTER in 'dovecot' 'postfix' 'postfix-sasl'
|
||||
do
|
||||
for FILTER in 'dovecot' 'postfix' 'postfix-sasl'; do
|
||||
_run_in_container fail2ban-client get "${FILTER}" bantime
|
||||
assert_output 1234
|
||||
|
||||
|
|
|
@ -89,8 +89,7 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test "argument 'domain' is applied correctly" {
|
||||
for DOMAIN in 'blabla.org' 'someother.com' 'random.de'
|
||||
do
|
||||
for DOMAIN in 'blabla.org' 'someother.com' 'random.de'; do
|
||||
_run_in_container setup config dkim domain "${DOMAIN}"
|
||||
assert_success
|
||||
assert_line --partial "Domain set to '${DOMAIN}'"
|
||||
|
@ -107,8 +106,7 @@ function teardown_file() { _default_teardown ; }
|
|||
assert_failure
|
||||
assert_line --partial "Unknown keytype 'foobar'"
|
||||
|
||||
for KEYTYPE in 'rsa' 'ed25519'
|
||||
do
|
||||
for KEYTYPE in 'rsa' 'ed25519'; do
|
||||
_run_in_container setup config dkim keytype "${KEYTYPE}"
|
||||
assert_success
|
||||
assert_line --partial "Keytype set to '${KEYTYPE}'"
|
||||
|
@ -127,8 +125,7 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test "argument 'selector' is applied correctly" {
|
||||
for SELECTOR in 'foo' 'bar' 'baz'
|
||||
do
|
||||
for SELECTOR in 'foo' 'bar' 'baz'; do
|
||||
__create_key 'rsa' "${SELECTOR}"
|
||||
assert_success
|
||||
assert_line --partial "Selector set to '${SELECTOR}'"
|
||||
|
@ -146,8 +143,7 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test "argument 'keysize' is applied correctly for RSA keys" {
|
||||
for KEYSIZE in 512 1024 2048 4096
|
||||
do
|
||||
for KEYSIZE in 512 1024 2048 4096; do
|
||||
__create_key 'rsa' 'mail' "${DOMAIN_NAME}" "${KEYSIZE}"
|
||||
assert_success
|
||||
__log_is_free_of_warnings_and_errors
|
||||
|
@ -234,8 +230,7 @@ function __check_rsa_keys() {
|
|||
# @param ${1} = base file name that all DKIM key files have
|
||||
function __check_key_files_are_present() {
|
||||
local BASE_FILE_NAME="${1:?Base file name must be supplied to __check_key_files_are_present}"
|
||||
for FILE in ${BASE_FILE_NAME}.{public.txt,public.dns.txt,private.txt}
|
||||
do
|
||||
for FILE in ${BASE_FILE_NAME}.{public.txt,public.dns.txt,private.txt}; do
|
||||
_run_in_container_bash "[[ -f ${FILE} ]]"
|
||||
assert_success
|
||||
done
|
||||
|
|
|
@ -49,8 +49,7 @@ function setup_file() {
|
|||
export MAIL_ID3=$(_send_email_and_get_id 'email-templates/rspamd-virus')
|
||||
export MAIL_ID4=$(_send_email_and_get_id 'email-templates/rspamd-spam-header')
|
||||
|
||||
for ID in MAIL_ID{1,2,3,4}
|
||||
do
|
||||
for ID in MAIL_ID{1,2,3,4}; do
|
||||
[[ -n ${!ID} ]] || { echo "${ID} is empty - aborting!" ; return 1 ; }
|
||||
done
|
||||
}
|
||||
|
@ -225,8 +224,7 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test 'RSPAMD_LEARN works' {
|
||||
for FILE in learn-{ham,spam}.{sieve,svbin}
|
||||
do
|
||||
for FILE in learn-{ham,spam}.{sieve,svbin}; do
|
||||
_run_in_container_bash "[[ -f /usr/lib/dovecot/sieve-pipe/${FILE} ]]"
|
||||
assert_success
|
||||
done
|
||||
|
@ -267,8 +265,7 @@ function teardown_file() { _default_teardown ; }
|
|||
assert_success
|
||||
assert_output --partial 'imapsieve: Matched static mailbox rule [1]'
|
||||
refute_output --partial 'imapsieve: Matched static mailbox rule [2]'
|
||||
for LINE in "${LEARN_SPAM_LINES[@]}"
|
||||
do
|
||||
for LINE in "${LEARN_SPAM_LINES[@]}"; do
|
||||
assert_output --partial "${LINE}"
|
||||
done
|
||||
|
||||
|
@ -281,8 +278,7 @@ function teardown_file() { _default_teardown ; }
|
|||
_run_in_container cat /var/log/mail/mail.log
|
||||
assert_success
|
||||
assert_output --partial 'imapsieve: Matched static mailbox rule [2]'
|
||||
for LINE in "${LEARN_HAM_LINES[@]}"
|
||||
do
|
||||
for LINE in "${LEARN_HAM_LINES[@]}"; do
|
||||
assert_output --partial "${LINE}"
|
||||
done
|
||||
}
|
||||
|
|
|
@ -42,8 +42,7 @@ function teardown_file() { _default_teardown ; }
|
|||
@test "log warns about interfering features" {
|
||||
run docker logs "${CONTAINER_NAME}"
|
||||
assert_success
|
||||
for SERVICE in 'Amavis/SA' 'OpenDKIM' 'OpenDMARC' 'policyd-spf'
|
||||
do
|
||||
for SERVICE in 'Amavis/SA' 'OpenDKIM' 'OpenDMARC' 'policyd-spf'; do
|
||||
assert_output --regexp ".*WARNING.*Running ${SERVICE} & Rspamd at the same time is discouraged"
|
||||
done
|
||||
}
|
||||
|
@ -63,8 +62,7 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test 'learning is properly disabled' {
|
||||
for FILE in learn-{ham,spam}.{sieve,svbin}
|
||||
do
|
||||
for FILE in learn-{ham,spam}.{sieve,svbin}; do
|
||||
_run_in_container_bash "[[ -f /usr/lib/dovecot/sieve-pipe/${FILE} ]]"
|
||||
assert_failure
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue