1
1
Fork 0
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-06-02 08:16:05 +02:00
docker-mailserver/test/tests/serial
Brennan Kinney 133eb9bc2e
tests(refactor): `mail_lmtp_ip.bats` (#3004)
* chore: Drop ENV `ENABLE_POSTFIX_VIRTUAL_TRANSPORT`

* tests(chore): Remove redundant `dovecot-lmtp` config

None of this is needed. Only relevant change is changing the LMTP service listener for Dovecot and that can be delegated to `user-patches.sh`.

* tests(refactor): Use `user-patches.sh` instead of replacing config file

The only relevant changes in `test/config/dovecot-lmtp` regarding LMTP was:
- `/etc/dovecot/dovecot.conf` (`protocols = imap lmtp`) and `/etc/dovecot/protocols.d/` (`protocols = $protocols lmtp`).
- `conf.d/10-master.conf` only changed the LMTP service listener from a unix socket to TCP on port 24 (_this was the only change required for the test to pass_).

None of those configs are required as:
- `protocols = imap pop3 lmtp` [is the upstream default](https://doc.dovecot.org/settings/core/#core_setting-protocols), no need to add `lmtp`.
- The LMTP service listener is now configured for the test with `user-patches.sh`.

* tests(refactor): `mail_lmtp_ip.bats`

- Converted to new testing conventions and common container helpers.
- `ENABLE_POSTFIX_VIRTUAL_TRANSPORT` was not relevant, dropped.
- Revised test cases, logic remains the same.
- Large custom config used was not documented and doesn't appear to serve any purpose. Simplified by replacing with a single modification with `user-patches.sh`.
- Added some additional comments for context of test and improvements that could be made.

* tests(chore): Adjust comments

The comment from `mail_hostname` provides no valid context, it was likely copied over from `tests.bats` in Oct 2020 by accident.

The email sent is just for testing, nothing relevant to LMTP.

---

Added additional comment for test to reference extra information from.

* tests(chore): Update similar log line matching

Extracts out the match pattern and formatting commands into separate vars (reduces horizontal scrolling), and includes extra docs about what the matched line should be expected to look like.
2023-01-15 18:33:31 +13:00
..
mail_changedetector.bats fix(changedetector): Use service `reload` commands instead of `supervisorctl restart <service>` (#2947) 2022-12-24 01:57:24 +13:00
mail_fetchmail.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_fetchmail_parallel.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_hostname.bats tests(refactor): `mail_lmtp_ip.bats` (#3004) 2023-01-15 18:33:31 +13:00
mail_lmtp_ip.bats tests(refactor): `mail_lmtp_ip.bats` (#3004) 2023-01-15 18:33:31 +13:00
mail_pop3.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_postfix_inet.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_privacy.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_quotas_disabled.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_smtponly.bats fix: Workaround `postconf` write settling logic (#2998) 2023-01-13 10:10:58 +13:00
mail_special_use_folders.bats chore: Remove legacy ENV `SASL_PASSWD` (#2946) 2022-12-23 15:30:40 +13:00
mail_time.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_tls_dhparams.bats tests(refactor): Adjust `mail_tls_dhparams.bats` (#2994) 2023-01-12 10:04:50 +13:00
mail_with_imap.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_with_ldap.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_with_mdbox.bats chore: Remove legacy ENV `SASL_PASSWD` (#2946) 2022-12-23 15:30:40 +13:00
mail_with_postgrey_disabled_by_default.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_with_relays.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
mail_with_sdbox.bats chore: Remove legacy ENV `SASL_PASSWD` (#2946) 2022-12-23 15:30:40 +13:00
no_container.bats chore: Remove the Makefile `backup` target (#3000) 2023-01-13 10:13:42 +13:00
open_dkim.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
permit_docker.bats fix: Workaround `postconf` write settling logic (#2998) 2023-01-13 10:10:58 +13:00
sedfile.bats tests(chore): Use `REPOSITORY_ROOT` export var from Makefile 2022-11-26 14:52:42 +13:00
setup-cli.bats fix(changedetector): Use service `reload` commands instead of `supervisorctl restart <service>` (#2947) 2022-12-24 01:57:24 +13:00
test_helper.bats Fix several typos (#2993) 2023-01-11 13:31:21 +13:00
tests.bats tests: Extract some test cases out from `tests.bats` (#2980) 2023-01-07 11:36:20 +13:00