first refactoring fr *.bats according to shellcheck

This commit is contained in:
Georg Lauterbach 2020-11-05 13:32:42 +01:00
parent 46998dd816
commit 9ce719213b
No known key found for this signature in database
GPG key ID: 386D76E7AD496709
31 changed files with 141 additions and 134 deletions

View file

@ -12,10 +12,10 @@ function setup_file() {
# We use a temporary config directory since we'll be dynamically editing
# it with setup.sh.
tmp_confdir=$(mktemp -d /tmp/docker-mailserver-config-relay-hosts-XXXXX)
cp -aT test/config/relay-hosts "$tmp_confdir"
cp -aT test/config/relay-hosts "${tmp_confdir}"
docker run -d --name mail_with_relays \
-v "$tmp_confdir":/tmp/docker-mailserver \
-v "${tmp_confdir}":/tmp/docker-mailserver \
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
-e RELAY_HOST=default.relay.com \
-e RELAY_PORT=2525 \
@ -24,17 +24,17 @@ function setup_file() {
--cap-add=SYS_PTRACE \
-e PERMIT_DOCKER=host \
-e DMS_DEBUG=0 \
-h mail.my-domain.com -t ${NAME}
-h mail.my-domain.com -t "${NAME}"
wait_for_finished_setup_in_container mail_with_relays
}
function teardown_file() {
docker rm -f mail_with_relays
rm -rf "$tmp_confdir"
rm -rf "${tmp_confdir}"
}
@test "first" {
# this test must come first to reliably identify when to run setup_file
skip 'this test must come first to reliably identify when to run setup_file'
}
@test "checking relay hosts: default mapping is added from env vars" {
@ -87,5 +87,5 @@ function teardown_file() {
}
@test "last" {
# this test is only there to reliably mark the end for the teardown_file
skip 'this test is only there to reliably mark the end for the teardown_file'
}