X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT620-lock.sh;h=99cc70103d07105f8cee6acbe19df2f50612f461;hb=78632345868b5e4753ad402c806c29569946ce89;hp=f46475e8ddccf6dc1926b7cf198da3d088592194;hpb=6450813e8f211c87e9a2b48c76fb0c99c57410d2;p=notmuch diff --git a/test/T620-lock.sh b/test/T620-lock.sh index f46475e8..99cc7010 100755 --- a/test/T620-lock.sh +++ b/test/T620-lock.sh @@ -1,18 +1,14 @@ #!/usr/bin/env bash test_description="locking" -. ./test-lib.sh || exit 1 - -if [ "${NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK}" = "0" ]; then - test_subtest_missing_external_prereq_["lock retry support"]=t -fi +. $(dirname "$0")/test-lib.sh || exit 1 add_email_corpus test_begin_subtest "blocking open" +if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then + test_subtest_known_broken +fi test_C ${MAIL_DIR} <<'EOF' -#include -#include -#include #include void @@ -44,15 +40,25 @@ main (int argc, char **argv) if (child == 0) { notmuch_database_t *db2; + char* msg = NULL; sleep (1); - EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2)); + + EXPECT0(notmuch_database_open_with_config (argv[1], + NOTMUCH_DATABASE_MODE_READ_WRITE, + "", NULL, &db2, &msg)); + if (msg) fputs (msg, stderr); + taggit (db2, "child"); EXPECT0 (notmuch_database_close (db2)); } else { notmuch_database_t *db; + char* msg = NULL; - EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db)); + EXPECT0(notmuch_database_open_with_config (argv[1], + NOTMUCH_DATABASE_MODE_READ_WRITE, + "", NULL, &db, &msg)); + if (msg) fputs (msg, stderr); taggit (db, "parent"); sleep (2); EXPECT0 (notmuch_database_close (db)); @@ -70,6 +76,9 @@ inbox parent unread EOF +if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then + test_subtest_known_broken +fi test_expect_equal_file EXPECTED OUTPUT test_done