From 8f11b2625b98831a591a73c8928d62c1df11aadb Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 5 Apr 2024 20:40:58 +0200 Subject: tests: Ensure that pullimap locks its statefile. --- tests/pullimap/t | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/pullimap/t') 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() { -- cgit v1.2.3