docker-postfix/unit-tests/postfix_custom_commands.bats
Bojan Čekrlić ff2d080279 Add the option to log to rsyslog as plain or JSON and restructure tests
- It's now possible to choose the logging type - either 'plain' or
  'json'
- The code is ready to support multiple integration tests (with
  different configurations)
- `OPENDKIM_` and `POSTFIX_` variables are handled properly and recorded
  in the corresponding files. (This had a downfall that `bash` now needs
  to be installed, so we can probably simplify some of the shell
  scripts.)
2020-07-01 13:50:08 +02:00

17 lines
505 B
Bash

#!/usr/bin/env bats
load /code/scripts/common.sh
load /code/scripts/common-run.sh
@test "Make sure that postfix_custom_commands adds lines" {
local POSTFIX_alias_database=hash:/etc/mail/aliases
postfix_custom_commands
cat /etc/postfix/main.cf | fgrep -qx "alias_database = hash:/etc/mail/aliases"
}
@test "Make sure that postfix_custom_commands removes lines" {
local POSTFIX_readme_directory=
postfix_custom_commands
cat /etc/postfix/main.cf | egrep -q "^#readme_directory"
}