2 test_description="locking"
3 . $(dirname "$0")/test-lib.sh || exit 1
7 test_begin_subtest "blocking open"
8 if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then
9 test_subtest_known_broken
11 test_C ${MAIL_DIR} <<'EOF'
12 #include <notmuch-test.h>
15 taggit (notmuch_database_t *db, const char *tag)
17 notmuch_message_t *message;
19 EXPECT0 (notmuch_database_find_message (db, "4EFC743A.3060609@april.org", &message));
20 if (message == NULL) {
21 fprintf (stderr, "unable to find message");
25 EXPECT0 (notmuch_message_add_tag (message, tag));
26 notmuch_message_destroy (message);
30 main (int argc, char **argv)
33 const char *path = argv[1];
37 fprintf (stderr, "fork failed\n");
42 notmuch_database_t *db2;
45 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2));
46 taggit (db2, "child");
47 EXPECT0 (notmuch_database_close (db2));
49 notmuch_database_t *db;
51 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db));
52 taggit (db, "parent");
54 EXPECT0 (notmuch_database_close (db));
60 notmuch search --output=tags id:4EFC743A.3060609@april.org >> OUTPUT
69 if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then
70 test_subtest_known_broken
72 test_expect_equal_file EXPECTED OUTPUT