docker-mailserver/test/tests/parallel/set2/template.bats
Brennan Kinney 2ec6c4abc0 tests: Adjust parallel tests
- The usual serial to parallel test conversion to utilize the `setup.bash` common setup structure, and adding a `TEST_PREFIX` var for each test case to leverage.
- Standardize on parallel test naming conventions for variables / values.
- More consistent use of `bash -c` instead of `/bin/bash -c` or `/bin/sh -c`.
- Using the `_run_in_container` helper instead of `run docker exec ${CONTAINER_NAME}`.
- Updates tests to use the `check_if_process_is_running` helper.

---

chore: Revise inline docs for the `ssl_letsencrypt` test

- Moves the override to be in closer proximity to the `initial_setup` call, and better communicates the intent to override.
- Removes top comment block that is no longer providing value or correct information to maintainers.
- Revised `acme.json` test case inline doc comments.
2023-01-06 16:50:09 +13:00

40 lines
889 B
Bash

# ? load the BATS helper
load "${REPOSITORY_ROOT}/test/helper/setup"
load "${REPOSITORY_ROOT}/test/helper/common"
# ? global variable initialization
# ? to identify the test easily
TEST_NAME_PREFIX='template:'
# ? must be unique
CONTAINER_NAME='dms-test_template'
# ? test setup
function setup_file() {
# ? optional setup before container is started
# ? initialize the test helpers
init_with_defaults
# ? add custom arguments supplied to `docker run` here
local CUSTOM_SETUP_ARGUMENTS=(
--env LOG_LEVEL=trace
)
# ? use a helper to correctly setup the container
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
# ? optional setup after the container is started
}
# ? test finalization
function teardown_file() { _default_teardown ; }
# ? actual unit tests
@test "${TEST_NAME_PREFIX} default check" {
_run_in_container bash -c "true"
assert_success
}