MacOS linting & testing support + docs (#2001)

This commit is contained in:
Nathan Pierce 2021-06-07 08:58:34 -04:00 committed by GitHub
parent abdf681d02
commit 543bd8b16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 109 additions and 153 deletions

View file

@ -12,7 +12,7 @@ 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 -a test/config/relay-hosts/* "${tmp_confdir}/"
docker run -d --name mail_with_relays \
-v "${tmp_confdir}":/tmp/docker-mailserver \
@ -39,12 +39,12 @@ function teardown_file() {
@test "checking relay hosts: default mapping is added from env vars" {
run docker exec mail_with_relays grep -e domainone.tld /etc/postfix/relayhost_map
assert_output -e '^@domainone.tld\s+\[default.relay.com\]:2525$'
assert_output -e '^@domainone.tld[[:space:]]+\[default.relay.com\]:2525$'
}
@test "checking relay hosts: default mapping is added from env vars for virtual user entry" {
run docker exec mail_with_relays grep -e domain1.tld /etc/postfix/relayhost_map
assert_output -e '^@domain1.tld\s+\[default.relay.com\]:2525$'
assert_output -e '^@domain1.tld[[:space:]]+\[default.relay.com\]:2525$'
}
@test "checking relay hosts: default mapping is added from env vars for new user entry" {
@ -52,7 +52,7 @@ function teardown_file() {
assert_output ''
run ./setup.sh -c mail_with_relays email add user0@domainzero.tld password123
run_until_success_or_timeout 10 docker exec mail_with_relays grep -e domainzero.tld /etc/postfix/relayhost_map
assert_output -e '^@domainzero.tld\s+\[default.relay.com\]:2525$'
assert_output -e '^@domainzero.tld[[:space:]]+\[default.relay.com\]:2525$'
}
@test "checking relay hosts: default mapping is added from env vars for new virtual user entry" {
@ -60,12 +60,12 @@ function teardown_file() {
assert_output ''
run ./setup.sh -c mail_with_relays alias add user2@domain2.tld user2@domaintwo.tld
run_until_success_or_timeout 10 docker exec mail_with_relays grep -e domain2.tld /etc/postfix/relayhost_map
assert_output -e '^@domain2.tld\s+\[default.relay.com\]:2525$'
assert_output -e '^@domain2.tld[[:space:]]+\[default.relay.com\]:2525$'
}
@test "checking relay hosts: custom mapping is added from file" {
run docker exec mail_with_relays grep -e domaintwo.tld /etc/postfix/relayhost_map
assert_output -e '^@domaintwo.tld\s+\[other.relay.com\]:587$'
assert_output -e '^@domaintwo.tld[[:space:]]+\[other.relay.com\]:587$'
}
@test "checking relay hosts: ignored domain is not added" {