1
0
mirror of https://github.com/docker-mailserver/docker-mailserver.git synced 2025-08-07 23:03:10 +02:00

tests: Extract setup.sh cases to their own test file (#2629)

* chore: Create bare new test file `setup-cli.bats`

Bare minimum to setup a new test.

* chore: Transfer over relevant tests

* chore: `mail` container name to dynamic `${TEST_NAME}`

Only applied where it's relevant. Next commit will handle the config path correction.

* chore: Use `TEST_TMP_CONFIG` for referencing local config directory

Could technically use the existing function call. Some paths were using a hard-coded config location.

Both have been converted to `TEST_TMP_CONFIG` and related `grep` calls normalizing the quote mark usage, escaping doesn't seem necessary.

* tests(fix): Create container without providing extra args reference var

If a variable name (of an array) was not provided to reference, this would fail trying to reference `'`.
This commit is contained in:
Brennan Kinney
2022-06-08 10:07:09 +12:00
committed by GitHub
parent 8e0fd306b7
commit 4b37cb5383
3 changed files with 254 additions and 240 deletions

View File

@ -231,7 +231,7 @@ function common_container_setup() {
# NOTE: Using array reference for a single input parameter, as this method is still
# under development while adapting tests to it and requirements it must serve (eg: support base config matrix in CI)
function common_container_create() {
local -n X_EXTRA_ARGS=${1}
[[ -n ${1} ]] && local -n X_EXTRA_ARGS=${1}
run docker create --name "${TEST_NAME}" \
--hostname "${TEST_FQDN}" \