aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-04-05 20:40:58 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-04-05 20:45:35 +0200
commit8f11b2625b98831a591a73c8928d62c1df11aadb (patch)
tree207c27cf98bad84a81b3a8ba0775a75a42e32b51 /tests
parenta4accc44ac1fddffba31d9bf52b76738a3562057 (diff)
tests: Ensure that pullimap locks its statefile.HEADmaster
Diffstat (limited to 'tests')
-rw-r--r--tests/pullimap/t11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pullimap/t b/tests/pullimap/t
index 879c5d1..e508784 100644
--- a/tests/pullimap/t
+++ b/tests/pullimap/t
@@ -13,6 +13,17 @@ if ! st="$(stat -c"%#a" -- "$XDG_DATA_HOME/pullimap/remote")" || [ "$st" != "060
fi
step_done
+step_start "\`pullimap\` locks its statefile"
+pullimap --idle "remote" & PID=$!
+trap "ptree_abort $PID" EXIT INT TERM
+# wait a short while so we have time to lock the database (ugly and racy...)
+sleep .5
+! pullimap "remote" || error
+grep -F "Can't lock $XDG_DATA_HOME/pullimap/remote: Resource temporarily unavailable at " <"$STDERR" || error
+ptree_abort $PID
+trap - EXIT INT TERM
+step_done
+
# compare mailboxes (can't compare the RFC 3501 TEXT as the LMTPd inconditionally
# adds a Return-Path: header -- and also Delivered-To: and Received: to by default)
list_mails_sha256() {