mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 10:05:00 +02:00
first refactoring fr *.bats according to shellcheck
This commit is contained in:
parent
46998dd816
commit
9ce719213b
31 changed files with 141 additions and 134 deletions
|
@ -112,14 +112,14 @@ load 'test_helper/common'
|
|||
# but it will finish eventually
|
||||
SECONDS=1
|
||||
wait_for_finished_setup_in_container "${CONTAINER_NAME}"
|
||||
[[ $SECONDS -gt 0 ]]
|
||||
[[ ${SECONDS} -gt 0 ]]
|
||||
}
|
||||
|
||||
@test "duplicate_config_for_container" {
|
||||
local path
|
||||
path="$(duplicate_config_for_container duplicate_config_test)"
|
||||
|
||||
run cat "$path/marker"
|
||||
run cat "${path}/marker"
|
||||
assert_line "This marker file is there to identify the correct config being copied"
|
||||
|
||||
run duplicate_config_for_container non-existant-source-folder "${BATS_TEST_NAME}2"
|
||||
|
@ -138,7 +138,7 @@ load 'test_helper/common'
|
|||
|
||||
# pick a service that was not started
|
||||
! container_has_service_running "${CONTAINER_NAME}" clamav
|
||||
|
||||
|
||||
# wait for a service that should be started
|
||||
wait_for_service "${CONTAINER_NAME}" postfix
|
||||
|
||||
|
@ -148,7 +148,7 @@ load 'test_helper/common'
|
|||
# now it should be off
|
||||
SECONDS=0
|
||||
TEST_TIMEOUT_IN_SECONDS=5 run wait_for_service "${CONTAINER_NAME}" postfix
|
||||
[[ $SECONDS -ge 5 ]]
|
||||
[[ ${SECONDS} -ge 5 ]]
|
||||
assert_failure
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ load 'test_helper/common'
|
|||
# that should eventually be detected
|
||||
SECONDS=0
|
||||
wait_for_changes_to_be_detected_in_container "${CONTAINER_NAME}"
|
||||
[[ $SECONDS -gt 0 ]]
|
||||
[[ ${SECONDS} -gt 0 ]]
|
||||
}
|
||||
|
||||
@test "wait_for_empty_mail_queue_in_container fails when timeout reached" {
|
||||
|
@ -208,7 +208,7 @@ load 'test_helper/common'
|
|||
-e ENABLE_CLAMAV=1 \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
|
||||
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
wait_for_smtp_port_in_container "${CONTAINER_NAME}" || docker logs "${CONTAINER_NAME}"
|
||||
|
@ -216,11 +216,11 @@ load 'test_helper/common'
|
|||
SECONDS=0
|
||||
# no mails -> should return immediately
|
||||
TEST_TIMEOUT_IN_SECONDS=5 wait_for_empty_mail_queue_in_container "${CONTAINER_NAME}"
|
||||
[[ $SECONDS -lt 5 ]]
|
||||
[[ ${SECONDS} -lt 5 ]]
|
||||
|
||||
# fill the queue with a message
|
||||
docker exec "${CONTAINER_NAME}" /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/amavis-virus.txt"
|
||||
|
||||
|
||||
# that should still be stuck in the queue
|
||||
! TEST_TIMEOUT_IN_SECONDS=0 wait_for_empty_mail_queue_in_container "${CONTAINER_NAME}"
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ load 'test_helper/common'
|
|||
-e ENABLE_CLAMAV=1 \
|
||||
-h mail.my-domain.com \
|
||||
-t "${NAME}")"
|
||||
|
||||
|
||||
teardown() { docker rm -f "${CONTAINER_NAME}"; }
|
||||
|
||||
wait_for_smtp_port_in_container "${CONTAINER_NAME}" || docker logs "${CONTAINER_NAME}"
|
||||
|
@ -247,5 +247,5 @@ load 'test_helper/common'
|
|||
# give it some time to clear the queue
|
||||
SECONDS=0
|
||||
wait_for_empty_mail_queue_in_container "${CONTAINER_NAME}"
|
||||
[[ $SECONDS -gt 0 ]]
|
||||
[[ ${SECONDS} -gt 0 ]]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue