mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
2ec6c4abc0
- 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.
24 lines
828 B
Bash
24 lines
828 B
Bash
load "${REPOSITORY_ROOT}/test/helper/setup"
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
|
|
|
TEST_NAME_PREFIX='helper functions inside container:'
|
|
CONTAINER_NAME='dms-test_helper_functions'
|
|
|
|
function setup_file() {
|
|
init_with_defaults
|
|
common_container_setup
|
|
}
|
|
|
|
function teardown_file() { _default_teardown ; }
|
|
|
|
@test "${TEST_NAME_PREFIX} _sanitize_ipv4_to_subnet_cidr" {
|
|
_run_in_container bash -c "source /usr/local/bin/helpers/index.sh; _sanitize_ipv4_to_subnet_cidr 255.255.255.255/0"
|
|
assert_output "0.0.0.0/0"
|
|
|
|
_run_in_container bash -c "source /usr/local/bin/helpers/index.sh; _sanitize_ipv4_to_subnet_cidr 192.168.255.14/20"
|
|
assert_output "192.168.240.0/20"
|
|
|
|
_run_in_container bash -c "source /usr/local/bin/helpers/index.sh; _sanitize_ipv4_to_subnet_cidr 192.168.255.14/32"
|
|
assert_output "192.168.255.14/32"
|
|
}
|