mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-28 22:08:42 +02:00
Updated ShellCheck to 0.8.0
and Hadolint to 2.8.0
(#2329)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
parent
6d06149581
commit
99cc9fec2a
12 changed files with 35 additions and 28 deletions
|
@ -15,11 +15,12 @@ fi
|
|||
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||
REPO_ROOT="$(realpath "${SCRIPT_DIR}"/../../)"
|
||||
|
||||
HADOLINT_VERSION=2.4.1
|
||||
HADOLINT_VERSION=2.8.0
|
||||
ECLINT_VERSION=2.3.5
|
||||
SHELLCHECK_VERSION=0.7.2
|
||||
SHELLCHECK_VERSION=0.8.0
|
||||
|
||||
set -eEuo pipefail
|
||||
shopt -s inherit_errexit
|
||||
trap '__log_err "${FUNCNAME[0]:-?}" "${BASH_COMMAND:-?}" ${LINENO:-?} ${?:-?}' ERR
|
||||
|
||||
function __log_err
|
||||
|
@ -121,6 +122,9 @@ function _shellcheck
|
|||
--wiki-link-count=50
|
||||
--enable=all
|
||||
--exclude=SC2154
|
||||
--exclude=SC2310
|
||||
--exclude=SC2311
|
||||
--exclude=SC2312
|
||||
--source-path=SCRIPTDIR
|
||||
"${F_SH} ${F_BIN} ${F_BATS}"
|
||||
)
|
||||
|
|
|
@ -68,7 +68,7 @@ function teardown_file() {
|
|||
run docker exec mail_smtponly /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/smtp-only.txt"
|
||||
assert_success
|
||||
run docker exec mail_smtponly /bin/sh -c 'grep -cE "to=<user2\@external.tld>.*status\=sent" /var/log/mail/mail.log'
|
||||
[ "${status}" -ge 0 ]
|
||||
[[ ${status} -ge 0 ]]
|
||||
}
|
||||
|
||||
#
|
||||
|
|
|
@ -58,5 +58,5 @@ teardown() {
|
|||
assert_output --partial "250 2.0.0 Ok: queued as "
|
||||
|
||||
repeat_until_success_or_timeout 60 run docker exec mail_smtponly_second_network /bin/sh -c 'grep -cE "to=<user2\@external.tld>.*status\=sent" /var/log/mail/mail.log'
|
||||
[ "${status}" -ge 0 ]
|
||||
[[ ${status} -ge 0 ]]
|
||||
}
|
||||
|
|
|
@ -614,7 +614,7 @@ EOF
|
|||
|
||||
run docker exec mail /bin/sh -c "grep '^user3@domain\.tld|' -i /tmp/docker-mailserver/postfix-accounts.cf"
|
||||
assert_success
|
||||
[ -n "${output}" ]
|
||||
[[ -n ${output} ]]
|
||||
}
|
||||
|
||||
@test "checking accounts: auser3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf" {
|
||||
|
@ -622,7 +622,7 @@ EOF
|
|||
|
||||
run docker exec mail /bin/sh -c "grep '^auser3@domain\.tld|' -i /tmp/docker-mailserver/postfix-accounts.cf"
|
||||
assert_success
|
||||
[ -n "${output}" ]
|
||||
[[ -n ${output} ]]
|
||||
}
|
||||
|
||||
@test "checking accounts: a.ser3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf" {
|
||||
|
@ -630,7 +630,7 @@ EOF
|
|||
|
||||
run docker exec mail /bin/sh -c "grep '^a\.ser3@domain\.tld|' -i /tmp/docker-mailserver/postfix-accounts.cf"
|
||||
assert_success
|
||||
[ -n "${output}" ]
|
||||
[[ -n ${output} ]]
|
||||
}
|
||||
|
||||
@test "checking accounts: user3 should have been removed from /tmp/docker-mailserver/postfix-accounts.cf but not auser3" {
|
||||
|
@ -638,11 +638,11 @@ EOF
|
|||
|
||||
run docker exec mail /bin/sh -c "grep '^user3@domain\.tld' -i /tmp/docker-mailserver/postfix-accounts.cf"
|
||||
assert_failure
|
||||
[ -z "${output}" ]
|
||||
[[ -z ${output} ]]
|
||||
|
||||
run docker exec mail /bin/sh -c "grep '^auser3@domain\.tld' -i /tmp/docker-mailserver/postfix-accounts.cf"
|
||||
assert_success
|
||||
[ -n "${output}" ]
|
||||
[[ -n ${output} ]]
|
||||
}
|
||||
|
||||
@test "checking user updating password for user in /tmp/docker-mailserver/postfix-accounts.cf" {
|
||||
|
@ -654,7 +654,7 @@ EOF
|
|||
sleep 2
|
||||
changepass=$(docker exec mail /bin/sh -c "grep '^user4@domain\.tld' -i /tmp/docker-mailserver/postfix-accounts.cf")
|
||||
|
||||
[ "${initialpass}" != "${changepass}" ]
|
||||
[[ ${initialpass} != "${changepass}" ]]
|
||||
|
||||
docker exec mail /bin/sh -c "delmailuser -y auser3@domain.tld"
|
||||
|
||||
|
@ -678,7 +678,7 @@ EOF
|
|||
-v "$(duplicate_config_for_container without-accounts/ without-accounts-deleting-user)":/tmp/docker-mailserver/ \
|
||||
"${IMAGE_NAME:?}" /bin/sh -c 'delmailuser -y user3@domain.tld'
|
||||
assert_success
|
||||
[ -z "${output}" ]
|
||||
[[ -z ${output} ]]
|
||||
}
|
||||
|
||||
@test "checking accounts: user3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf even when that file does not exist" {
|
||||
|
@ -692,7 +692,7 @@ EOF
|
|||
-v "${PRIVATE_CONFIG}/without-accounts/":/tmp/docker-mailserver/ \
|
||||
"${IMAGE_NAME:?}" /bin/sh -c 'grep user3@domain.tld -i /tmp/docker-mailserver/postfix-accounts.cf'
|
||||
assert_success
|
||||
[ -n "${output}" ]
|
||||
[[ -n ${output} ]]
|
||||
}
|
||||
|
||||
|
||||
|
@ -956,7 +956,7 @@ EOF
|
|||
assert_success
|
||||
|
||||
value=$(grep setup_email_add@example.com "$(private_config_path mail)/postfix-accounts.cf" | awk -F '|' '{print $1}')
|
||||
[ "${value}" = "setup_email_add@example.com" ]
|
||||
[[ ${value} == "setup_email_add@example.com" ]]
|
||||
assert_success
|
||||
|
||||
wait_for_changes_to_be_detected_in_container mail
|
||||
|
@ -979,15 +979,15 @@ EOF
|
|||
assert_success
|
||||
|
||||
initialpass=$(grep lorem@impsum.org "$(private_config_path mail)/postfix-accounts.cf" | awk -F '|' '{print $2}')
|
||||
[ "${initialpass}" != "" ]
|
||||
[[ ${initialpass} != "" ]]
|
||||
assert_success
|
||||
|
||||
run ./setup.sh -c mail email update lorem@impsum.org my password
|
||||
assert_success
|
||||
|
||||
updatepass=$(grep lorem@impsum.org "$(private_config_path mail)/postfix-accounts.cf" | awk -F '|' '{print $2}')
|
||||
[ "${updatepass}" != "" ]
|
||||
[ "${initialpass}" != "${updatepass}" ]
|
||||
[[ ${updatepass} != "" ]]
|
||||
[[ ${initialpass} != "${updatepass}" ]]
|
||||
|
||||
docker exec mail doveadm pw -t "${updatepass}" -p 'my password' | grep 'verified'
|
||||
assert_success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue