docker-mailserver/test/config/rspamd_full/rspamd/custom-commands.conf
Georg Lauterbach cd1721334c
scripts: Rspamd stabilization pt. 2 (#3282)
* move modules adjustment file to new location

Because we link `/tmp/docker-mailserver/rspamd/override.d` to
`/etc/rspamd/override.d`, I think it makes sense to move the modules
adjustment file into `/tmp/docker-mailserver/rspamd/` as well.

I write the code in a way that it is backwards compatible for now, so
this is NOT a breaking change.

* minor improvement to `__rspamd__handle_user_modules_adjustments`

The expansion of `ARGUMENT3` is now done in a way that only adds the
whitespace in case the variable is set and not null.

* move test file structure to respect latest changes

Because we're now linking `rspamd/override.d/`, we can simplify the
setup a bit. But this requires a change in directory structure.

The current Rspamd test will be renamed to `rspamd_full.bats`, because I
plan on adding more tests in different files for different feature sets.
This is done to make this feature well-tested!

* improved and added tests to Rspamd-full

FYI: The line

```bats
_run_in_container grep 'sieve_global_extensions.*\+vnd\.dovecot\.pipe'
"${SIEVE_CONFIG_FILE}"
```

was testing a condition that should actually not be met, but when I
started working on this feature, I thought this was the correct
configuration. Adding the `assert_success` statements revealed this
wrong line.

I also added tests to check whether `override.d` is linked correctly.

* renamed: `rspamd.bats` => `rspamd_full.bats`

* added new tests for incomplete Rspamd feature set

We now test that warnings are emitted & features are disabled correctly.

* update documentation
2023-04-23 14:02:56 +02:00

43 lines
1.8 KiB
Plaintext

# This is suboptimal, but not strictly required either: we do not
# need the DKIM signing & RBL functionality (which is most likely
# not set up anyway or it fails (in case of querying DNSBLs with
# public resolvers)). Hence, we disable it. It is suboptimal
# since we are testing the functionality of whether disabling
# a module works at the same time..
#
# When testing on ARM64, this is required at the moment due to
# strange behavior in Rspamd v3.2 (segmentation faults) when DKIM
# keys are not provided (notes were added to the docs).
disable-module dkim_signing
disable-module rbl
# check whether disabling a module works and whether it
# really overwrites options that came before
set-option-for-module testmodule1 someoption somevalue
disable-module testmodule1
# enabling a module and setting some options for it
enable-module testmodule2
set-option-for-module testmodule2 someoption somevalue
set-option-for-module testmodule2 anotheroption whatAvaLue
# overwriting an option (probably unwanted, we emit a warning)
set-option-for-module testmodule3 someoption somevalue1
set-option-for-module testmodule3 someoption somevalue2
# check whether adding a line works even with special characters in it
add-line testmodule4.something some very long line with "weird $charact"ers
add-line testmodule4.something and! ano. ther &line
add-line testmodule4.something # some comment
# check whether spaces in front are handles fine, for nested options
set-option-for-module testmodule_complicated anOption anotherValue
# check whether controller and proxy options are set/overwritten correctly
set-option-for-controller someOption someValue42
set-option-for-proxy abcdefg71 RaNDom
set-option-for-proxy abcdefg71 RAAAANdooM
# check whether setting basic options works (and whether spaces in values work)
set-common-option OhMy "PraiseBeLinters !"