Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
check-for-changes: performance improvements + wait for settle (docker-mailserver#2104)

lint fix

reverted a mistake

whoops, forgot one

testing flakey tests

reverted stopwaitsecs for postfix (docker-mailserver#2137)

more tests

more testing

Bats developer explains that run_*_file_if_necessary isn't needed since 1.2.1

more test testing

more testing

more testing

docs: Adds a new blog post (docker-mailserver#2138)

Adds a new blog post that covers setting up docker-mailserver on a VPS, including but not limited to

 * Considerations when selecting a VPS
 * Initial configuration of docker-mailserver
 * DNS setup and verification of settings
 * Multiple domains

Co-authored-by: Frederic Werner <20406381+wernerfred@users.noreply.github.com>

docs: add matrixes as a contributor for blog (docker-mailserver#2139)

* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

* fix: remove projectmanagement

* chore: remove projectmanagement

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Frederic Werner <20406381+wernerfred@users.noreply.github.com>

added wait for smtp port

quick fix

quick fix
  • Loading branch information
NorseGaud committed Aug 28, 2021
1 parent 35afa09 commit 1fd29df
Show file tree
Hide file tree
Showing 32 changed files with 303 additions and 10 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/test_merge_requests.yml
Expand Up @@ -62,3 +62,57 @@ jobs:
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
- name: Run test suite
run: >
NAME=mailserver-testing:ci
bash -c 'make generate-accounts tests'
env:
CI: true
3 changes: 1 addition & 2 deletions Makefile
Expand Up @@ -38,8 +38,7 @@ generate-accounts:
@ echo " # this is also a test comment, :O" >> test/config/postfix-accounts.cf

tests:
@ NAME=$(NAME) ./test/bats/bin/bats --trace --verbose-run --show-output-of-succeeding-tests --filter "checking setup.sh" test/tests.bats
#@ NAME=$(NAME) ./test/bats/bin/bats test/*.bats
@ NAME=$(NAME) ./test/bats/bin/bats test/*.bats

.PHONY: ALWAYS_RUN
test/%.bats: ALWAYS_RUN
Expand Down
3 changes: 1 addition & 2 deletions target/scripts/postfix-wrapper.sh
Expand Up @@ -20,8 +20,7 @@ trap "service postfix stop" SIGINT
trap "service postfix stop" SIGTERM
trap "service postfix reload" SIGHUP

service postfix start &
wait
service postfix start

# wait until postfix is dead (triggered by trap)
while kill -0 "$(< /var/spool/postfix/pid/master.pid)"
Expand Down
2 changes: 1 addition & 1 deletion test/bats
Submodule bats updated 64 files
+39 −0 .github/workflows/release.yml
+0 −38 .github/workflows/release_dockerhub.yml
+6 −5 .github/workflows/tests.yml
+2 −5 Dockerfile
+2 −2 README.md
+1 −2 contrib/release.sh
+1 −1 contrib/rpm/bats.spec
+0 −30 docker/install_tini.sh
+0 −107 docker/tini.pubkey.gpg
+0 −10 docs/CHANGELOG.md
+4 −8 docs/examples/package-tarball.bats
+1 −1 docs/source/tutorial.rst
+57 −25 docs/source/writing-tests.md
+2 −3 install.sh
+7 −142 lib/bats-core/test_functions.bash
+12 −89 lib/bats-core/tracing.bash
+3 −23 libexec/bats-core/bats
+4 −18 libexec/bats-core/bats-exec-file
+0 −16 libexec/bats-core/bats-exec-suite
+8 −43 libexec/bats-core/bats-exec-test
+17 −16 libexec/bats-core/bats-format-pretty
+0 −3 libexec/bats-core/bats-preprocess
+12 −20 man/bats.7.ronn
+1 −1 package.json
+4 −3 shellcheck.sh
+53 −170 test/bats.bats
+2 −4 test/concurrent-coordination.bash
+3 −11 test/file_setup_teardown.bats
+0 −0 test/fixtures/bats/dos_line.bats
+0 −0 test/fixtures/bats/duplicate-tests.bats
+0 −2 test/fixtures/bats/environment.bats
+1 −1 test/fixtures/bats/loop_keep_IFS.bats
+0 −11 test/fixtures/bats/print_output_on_failure.bats
+0 −0 test/fixtures/bats/quoted_and_unquoted_test_names.bats
+0 −1 test/fixtures/bats/reference_unset_parameter.bats
+1 −2 test/fixtures/bats/reference_unset_parameter_in_setup.bats
+0 −1 test/fixtures/bats/reference_unset_parameter_in_teardown.bats
+0 −3 test/fixtures/bats/show-output-of-succeeding-tests.bats
+0 −0 test/fixtures/bats/single_line.bats
+0 −1 test/fixtures/bats/source_nonexistent_file.bats
+1 −2 test/fixtures/bats/source_nonexistent_file_in_setup.bats
+0 −1 test/fixtures/bats/source_nonexistent_file_in_teardown.bats
+1 −3 test/fixtures/bats/unbound_variable.bats
+0 −3 test/fixtures/bats/verbose-run.bats
+0 −0 test/fixtures/bats/whitespace.bats
+1 −2 test/fixtures/parallel/must_not_parallelize_within_file.bats
+3 −3 test/fixtures/parallel/parallel.bats
+1 −1 test/fixtures/parallel/setup_file/setup_file.bats
+3 −3 test/fixtures/parallel/suite/parallel1.bats
+0 −22 test/fixtures/run/failing.bats
+0 −7 test/fixtures/run/invalid.bats
+3 −3 test/fixtures/suite/filter/a.bats
+3 −3 test/fixtures/suite/filter/b.bats
+3 −3 test/fixtures/suite/filter/c.bats
+0 −5 test/fixtures/trace/failing_complex.bats
+0 −13 test/fixtures/trace/failing_recursive.bats
+0 −62 test/install.bats
+15 −25 test/parallel.bats
+0 −7 test/root.bats
+0 −140 test/run.bats
+2 −2 test/suite.bats
+2 −4 test/test_helper.bash
+0 −84 test/trace.bats
+1 −2 uninstall.sh
9 changes: 9 additions & 0 deletions test/mail_dhparams_default.bats
Expand Up @@ -11,6 +11,15 @@ load 'test_helper/common'
# ~ The file `ffdhe4096.pem` has not been modified (checksum verification).
# ~ `ffdhe4096.pem` is copied to the configuration directories for postfix and dovecot.


function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_default_dhparams_both_one_dir)"
Expand Down
9 changes: 9 additions & 0 deletions test/mail_dhparams_manual_not_one_dir.bats
Expand Up @@ -11,6 +11,15 @@ load 'test_helper/common'
# ~ User supplied DHE parameters are copied to the configuration directories for postfix and dovecot.
# ~ A warning is raised about usage of insecure parameters.


function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG=$(duplicate_config_for_container .)
Expand Down
8 changes: 8 additions & 0 deletions test/mail_dhparams_manual_one_dir.bats
Expand Up @@ -11,6 +11,14 @@ load 'test_helper/common'
# ~ User supplied DHE parameters are copied to the configuration directories for postfix and dovecot.
# ~ A warning is raised about usage of insecure parameters.

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_disabled_clamav_spamassassin.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

setup() {
run_setup_file_if_necessary
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_fail2ban.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_fetchmail.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_fetchmail_parallel.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_lmtp_ip.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

setup() {
run_setup_file_if_necessary
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG PRIVATE_ETC
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
6 changes: 3 additions & 3 deletions test/mail_override_hostname.bats
@@ -1,8 +1,8 @@
load 'test_helper/common'

#function setup() {
# run_setup_file_if_necessary
#}
function setup() {
run_setup_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
Expand Down
8 changes: 8 additions & 0 deletions test/mail_pop3.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
6 changes: 6 additions & 0 deletions test/mail_postscreen.bats
@@ -1,10 +1,16 @@
load 'test_helper/common'

setup() {
run_setup_file_if_necessary

# Getting mail container IP
MAIL_POSTSCREEN_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' mail_postscreen)
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_privacy.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
9 changes: 9 additions & 0 deletions test/mail_quotas_disabled.bats
Expand Up @@ -4,6 +4,15 @@ load 'test_helper/common'
# ---------
# When ENABLE_QUOTAS is explicitly disabled (ENABLE_QUOTAS=0), dovecot quota must not be enabled.


function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_smtponly.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
9 changes: 9 additions & 0 deletions test/mail_spam_bounced.bats
Expand Up @@ -4,6 +4,15 @@ load 'test_helper/common'
# ---------
# When SPAMASSASSIN_SPAM_TO_INBOX=0, spam messages must be bounced.


function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container . mail_spam_bounced_defined)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_special_use_folders.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

setup() {
run_setup_file_if_necessary
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_ssl_letsencrypt.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
local PRIVATE_CONFIG

Expand Down
8 changes: 8 additions & 0 deletions test/mail_ssl_manual.bats
@@ -1,6 +1,14 @@
#!/usr/bin/env bats
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
# Internal copies made by `start-mailserver.sh`:
export PRIMARY_KEY='/etc/postfix/ssl/key'
Expand Down
8 changes: 8 additions & 0 deletions test/mail_with_imap.bats
@@ -1,6 +1,14 @@

load 'test_helper/common'

setup() {
run_setup_file_if_necessary
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down
8 changes: 8 additions & 0 deletions test/mail_with_ldap.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

function setup() {
run_setup_file_if_necessary
}

function teardown() {
run_teardown_file_if_necessary
}

function setup_file() {
pushd test/docker-openldap/ || return 1
docker build -f Dockerfile -t ldap --no-cache .
Expand Down
8 changes: 8 additions & 0 deletions test/mail_with_mdbox.bats
@@ -1,5 +1,13 @@
load 'test_helper/common'

setup() {
run_setup_file_if_necessary
}

teardown() {
run_teardown_file_if_necessary
}

setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
Expand Down

0 comments on commit 1fd29df

Please sign in to comment.