From 735613cdf79861232d2edb25b42b69eb9a4d0a26 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 3 Jul 2022 21:23:11 +0100 Subject: [PATCH] test: Set `state_dir` in Dovecot config Dovecot's `state_dir` usually defaults to be at `/var/lib/dovecot`, or a similar system-wide path. Under some conditions, our test Dovecot instance can fail, because it's wanting to write to state_dir, but it is not writeable by us in the test environment. This was reported by foxcpp in https://github.com/albertito/chasquid/issues/28. This patch fixes the problem by setting a custom state_dir to be within our testing directory. Thanks to foxcpp for reporting this problem and suggesting a fix. --- test/t-11-dovecot/config/dovecot.conf.in | 1 + test/t-11-dovecot/run.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/t-11-dovecot/config/dovecot.conf.in b/test/t-11-dovecot/config/dovecot.conf.in index e97913d..eb7a9be 100644 --- a/test/t-11-dovecot/config/dovecot.conf.in +++ b/test/t-11-dovecot/config/dovecot.conf.in @@ -1,4 +1,5 @@ base_dir = $ROOT/run/ +state_dir = $ROOT/lib/ log_path = $ROOT/dovecot.log ssl = no diff --git a/test/t-11-dovecot/run.sh b/test/t-11-dovecot/run.sh index c20f279..2a96b32 100755 --- a/test/t-11-dovecot/run.sh +++ b/test/t-11-dovecot/run.sh @@ -23,7 +23,7 @@ fi # limitation, so we use a directory in /tmp, which is not ideal, as a # workaround. export ROOT="/tmp/chasquid-dovecot-test" -mkdir -p $ROOT $ROOT/run +mkdir -p $ROOT $ROOT/run $ROOT/lib rm -f $ROOT/dovecot.log export GROUP=$(id -g -n)