docker-mailserver/test/tests/serial
Brennan Kinney 14829a8459
tests(refactor): mail_hostname.bats (#3027)
* chore: Use a common method to check domain and fqdn config

* chore: Shift other test cases into shared test methods

* chore: Add another shared method for checking mail headers

* chore: Add another shared method for checking hostname

* refactor: Improve quality of shared test methods

Based on changes from an earlier closed hostname PR from Oct 2021 with additional revision to use `assert_output` and more thorough checking of values expected in output.

* chore: Move clean shutdown test to `process-check-restart.bats`

This was originally a single test case in `tests.bats` intended for `supervisord` testing.

It seems at some point it got reassigned to a hostname override test container, and then migrated to separate test file for hostname override test by accident.

It now belongs in the correct place again, as hostname config should have nothing to do with a graceful shutdown?

* chore: Prepare for migrating to use `test/helper/setup.bash`

* chore: Rename containers and configured FQDN settings

* chore: Convert to using common container setup helpers

Wait for SMTP port is left at the end to avoid additional start-up delays.

* chore: Use `_run_in_container_bash` helper

* chore: Be more specific on matching mail headers

- I could do multiple container grep calls instead, but opted to match by lines in file. This better ensures values are being matched to the correct lines.
- Renamed the test case descriptions.
- Expanded test coverage of the 4th container as it represents another DNS config, while the 3rd is just the 4th container with the `SRS_DOMAINNAME` env added, no value in more coverage there.

* chore: Remove redundant test coverage in `tests.bats`

These checks are performed in `mail_hostname.bats` with better coverage.

* chore: Move each containers setup into it's own test-case instead

* chore: Re-arrange container name IDs

The original `fqdn-with-subdomain` is now `with-nis-domain` which is more accurate. A new test case will properly cover the default `--hostname` only config that is not a bare domain.

* chore: Re-arrange test cases to align with new ID ordering

This commit just shifts the test cases, no new changes to any content beyond that.

* chore: Add new test case for default config

* chore: Review feedback `_run_in_container_bash` to `_run_in_container`

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>

* chore: Additional review feedback

- Fix a suggested change bug with quote wrapping an interpolated variable.
- Convert two other `_bash` methods that were missed from review.
- Apply the last two suggested changes from review.

* chore: `_exec_in_container_bash` to `_exec_in_container`

The `| head -n 1` can be dropped if we know for sure it's only one line, which is what we expect. Quotes can then be dropped too.

---------

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2023-01-29 12:34:14 +00:00
..
mail_changedetector.bats tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01:00
mail_fetchmail.bats tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01:00
mail_hostname.bats tests(refactor): mail_hostname.bats (#3027) 2023-01-29 12:34:14 +00:00
mail_lmtp_ip.bats tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01: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(refactor): Migrate mail_privacy.bats to new format and helpers (#3014) 2023-01-22 02:15:55 +01:00
mail_quotas_disabled.bats tests: refactor 4 more tests (#3018) 2023-01-24 09:21:39 +01:00
mail_smtponly.bats tests: refactor 4 more tests (#3018) 2023-01-24 09:21:39 +01:00
mail_special_use_folders.bats tests: refactor 4 more tests (#3018) 2023-01-24 09:21:39 +01:00
mail_time.bats tests: refactor 4 more tests (#3018) 2023-01-24 09:21:39 +01:00
mail_tls_dhparams.bats tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01: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(refactor): mail_fetchmail.bats + co-locate test cases for processes (#3010) 2023-01-18 14:42:55 +13:00
mail_with_mdbox.bats chore: Remove legacy ENV SASL_PASSWD (#2946) 2022-12-23 15:30:40 +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 tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01:00
open_dkim.bats tests(chore): Use REPOSITORY_ROOT export var from Makefile 2022-11-26 14:52:42 +13:00
permit_docker.bats tests: refactor 4 more tests (#3018) 2023-01-24 09:21:39 +01:00
sedfile.bats tests(chore): Use REPOSITORY_ROOT export var from Makefile 2022-11-26 14:52:42 +13:00
setup-cli.bats tests(refactor): Improve consistency and documentation for test helpers (#3012) 2023-01-22 00:05:28 +01:00
test_helper.bats tests(refactor): Adjust mail_changedetector + change detection helpers (#2997) 2023-01-16 20:39:46 +13:00
tests.bats tests(refactor): mail_hostname.bats (#3027) 2023-01-29 12:34:14 +00:00