summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-09-08test/crypto: hard code fingerprintDavid Bremner
Originally the intent was to make the test more robust against changing test keys. It turns out that (unscientifically) gpg --with-colons output changes more often than our test key. Rather than making the script more complex, just hard code the fingerprint. This fixes Debian bug #847013; I expect similar test failures as other distros adopt gnupg 2.1.15
2016-08-14test: make gdb even quieterDavid Bremner
gdb sometimes writes warnings to stdout, which we don't need/want, and for some reason --batch-silent isn't enough to hide. So in this commit we write them to a log file, which is probably better for debugging anyway. To see an illustrative test failure before this change, run % make % touch notmuch-count.c % cd test && ./T060-count.sh (cherry picked from commit f45fa5bdd397d52473f7092f7ae3e2ffb9b7aee5)
2016-06-30test: don't use dump and restore in a pipelineDavid Bremner
This has been wrong since bbbdf0478ea, but the race condition was not previously been (often?) triggered in the tests. With the DB_RETRY_LOCK patches, it manifests itself as a deadlock.
2016-04-15complete ghost-on-removal-when-shared-thread-existsDaniel Kahn Gillmor
To fully complete the ghost-on-removal-when-shared-thread-exists proposal, we need to clear all ghost messages when the last active message is removed from a thread. Amended by db: Remove the last test of T530, as it no longer makes sense if we are garbage collecting ghost messages.
2016-04-15fix thread breakage via ghost-on-removalDaniel Kahn Gillmor
implement ghost-on-removal, the solution to T590-thread-breakage.sh that just adds a ghost message after removing each message. It leaks information about whether we've ever seen a given message id, but it's a fairly simple implementation. Note that _resolve_message_id_to_thread_id already introduces new message_ids to the database, so i think just searching for a given message ID may introduce the same metadata leakage.
2016-04-15test thread breakage when messages are removed and re-addedDaniel Kahn Gillmor
This test (T590-thread-breakage.sh) has known-broken subtests. If you have a two-message thread where message "B" is in-reply-to "A", notmuch rightly sees this as a single thread. But if you: * remove "A" from the message store * run "notmuch new" * add "A" back into the message store * re-run "notmuch new" Then notmuch sees the messages as distinct threads. This happens because if you insert "B" initially (before anything is known about "A"), then a "ghost message" gets added to the database in reference to "A" that is in the same thread, which "A" takes over when it appears. But if "A" is subsequently removed, no ghost message is retained, so when "A" appears, it is treated as a new thread. I see a few options to fix this: ghost-on-removal ---------------- We could unilaterally add a ghost upon message removal. This has a few disadvantages: the message index would leak information about what messages the user has ever been exposed to, and we also create a perpetually-growing dataset -- the ghosts can never be removed. ghost-on-removal-when-shared-thread-exists ------------------------------------------ We could add a ghost upon message removal iff there are other non-ghost messages with the same thread ID. We'd also need to remove all ghost messages that share a thread when the last non-ghost message in that thread is removed. This still has a bit of information leakage, though: the message index would reveal that i've seen a newer message in a thread, even if i had deleted it from my message store track-dependencies ------------------ rather than a simple "ghost-message" we could store all the (A,B) message-reference pairs internally, showing which messages A reference which other messages B. Then removal of message X would require deleting all message-reference pairs (X,B), and only deleting a ghost message if no (A,X) reference pair exists. This requires modifying the database by adding a new and fairly weird table that would need to be indexed by both columns. I don't know whether xapian has nice ways to do that. scan-dependencies ----------------- Without modifying the database, we could do something less efficient. Upon removal of message X, we could scan the headers of all non-ghost messages that share a thread with X. If any of those messages refers to X, we would add a ghost message. If none of them do, then we would just drop X entirely from the table. --------------------- One risk of attempted fixes to this problem is that we could fail to remove the search term indexes entirely. This test contains additional subtests to guard against that. This test also ensures that the right number of ghost messages exist in each situation; this will help us ensure we don't accumulate ghosts indefinitely or leak too much information about what messages we've seen or not seen, while still making it easy to reassemble threads when messages come in out-of-order.
2016-04-15test: add test-binary to print the number of ghost messagesDavid Bremner
This one-liner seems preferable to the complications of depending on delve, getting the binary name right and parsing the output.
2016-04-12lib: fix handling of one character long directory names at top levelJani Nikula
The code to skip multiple slashes in _notmuch_database_split_path() skips back one character too much. This is compensated by a +1 in the length parameter to the strndup() call. Mostly this works fine, but if the path is to a file under a top level directory with one character long name, the directory part is mistaken to be part of the file name (slash == path in code). The returned directory name will be the empty string and the basename will be the full path, breaking the indexing logic in notmuch new. Fix the multiple slash skipping to keep the slash variable pointing at the last slash, and adjust strndup() accordingly. The bug was introduced in commit e890b0cf4011fd9fd77ebd87343379e4a778888b Author: Carl Worth <cworth@cworth.org> Date: Sat Dec 19 13:20:26 2009 -0800 database: Store the parent ID for each directory document. just a little over two months after the initial commit in the Notmuch code history, making this the longest living bug in Notmuch to date.
2016-04-12test: test one character long directory names at top levelJani Nikula
Yes, it's broken. Reported by h01ger on IRC.
2016-04-12test: cope with glass backend file naming variationsDavid Bremner
In several places in the test suite we intentionally corrupt the Xapian database in order to test error handling. This corruption is specific to the on-disk organization of the database, and that changed with the glass backend. We use the previously computed default backend to make the tests adapt to changing names.
2016-04-12configure: add test for default xapian backendDavid Bremner
This is mainly for the test suite. We already expect the tests to be run in the same environment as configure was run, at least to get the name of the python interpreter. So we are not really imposing a new restriction.
2016-04-12test/atomicity: guard chert-only optimizationDavid Bremner
This should potentially be updated to have an equivalent optimization for the glass backend, but it in my unscientific tests, the glass backend without the optimization is faster then the chert backend with.
2016-04-12test: improve error handling in lib-error testsDavid Bremner
There is at least one bug fixed here (missing parameter to printf), even if exiting via segfault is considered OK.
2016-04-10emacs: Always insert crypto buttons.David Edmondson
When no decryption or signature examination is happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons that indicate this, rather than remaining silent.
2016-03-26test/test-lib.el: revert setting notmuch-mua-reply-insert-header-p-functionTomi Ollila
in d27d90875dfb1 (2016-02-20) notmuch-mua-reply-insert-header-p-function was set to notmuch-show-reply-insert-header-p-never as its default was changed to something else. Now that default is set back to *-never so this change done in d27d90875dfb1 is not needed anymore.
2016-03-14test: canonicalize quotes in xapian error messagesDavid Bremner
These differ between 1.2 and 1.3, so we transform the 1.2 backquote to a single quote for compatibility
2016-03-14test: replace single giant term with large phraseDavid Bremner
We only need a long string, not a single long term to trigger batch mode. The giant term triggers a bug/incompatibility in Xapian 1.3.4 that throws an exception because it is longer than the Xapian term size limit.
2016-03-14emacs: hello: promote '?' as the universal help keyJani Nikula
Move the brief help text at the bottom of the hello screen to the notmuch-hello-mode help, and promote '?' as the universal help key across Notmuch. This unclutters the hello screen, and allows for a more verbose description in the mode help. Hopefully, this change is useful for both experienced and new users alike. While at it, improve the links to Notmuch and hello screen customization.
2016-03-04test/README: have matching test script file namesTomi Ollila
A while ago test script names were changed to format Tddd-basename.sh. Update README to reflect that. While at it, included some small requirements updates.
2016-02-21emacs/mua: Let user specify which parts get a header in citations.David Edmondson
Add a customizable function specifying which parts get a header when replying, and give some sensible possiblities. These are, 1) all parts except multipart/*. (Subparts of a multipart part do receive a header button.) 2) only included text/* parts. 3) Exactly as in the show buffer. 4) None at all. This means the reply contains a mish-mash of all the original message's parts. In the test suite we set the choice to option 4 to match the previous behaviour.
2016-02-21emacs/mua: Generate improved cited text for repliesDavid Edmondson
Use the message display code to generate message text to cite in replies. For now we set insert-headers-p function to notmuch-show-reply-insert-header-p-never so that, as before, we don't insert part buttons. With that choice of insert-headers-p function there is only one failing test: this test has a text part (an email message) listed as application/octet-stream. Notmuch show displays this part, but the reply code omitted it as it had type application/octet-stream. The new code correctly includes it. Thus update the expected output to match.
2016-02-13test: fix typo in informational messageDavid Bremner
Thanks to Olly Betts for noticing
2016-01-29cli: crypto: S/MIME verification supportJani Nikula
notmuch-show --verify will now also process S/MIME multiparts if encountered. Requires gmime-2.6 and gpgsm. Based on work by Jameson Graef Rollins <jrollins@finestructure.net>.
2016-01-29test: add broken S/MIME signature verification test for notmuch CLIDavid Bremner
The test is pretty much cut and paste from the PGP/MIME version, with obvious updates taken from notmuch output. This also requires setting up gpgsm infrastucture.
2016-01-29test: initial tests for S/MIME and notmuch-emacsDavid Bremner
Test the ability of notmuch-mua-mail to send S/MIME signed (and encrypted) messages; this really relies on existing functionality in message-mode. The generated keys and messages will later be useful for testing the notmuch CLI.
2016-01-26test: refactor directory name sanitizationDavid Bremner
test_C and notmuch_search_files_sanitize were giving different output on the same path, which is not technically wrong, but slightly confusing.
2015-12-30cli: fix function name in notmuch new debug loggingJani Nikula
add_files_recursive has been renamed add_files long ago.
2015-12-30test: Unset ALTERNATE_EDITOR before running emacsclientMichal Sojka
ALTERNATE_EDITOR causes emacsclient to run an alternate editor if the emacs server is not ready. This can collide with intended functionality in test-lib.sh. If the ALTERNATE_EDITOR is set but empty, emacsclient runs emacs daemon and tries to connect to it. When this happens the emacs run by test-lib.sh fails to start the server and the subsequent attempts to use the server fail because the daemon started by emacsclient does not know about notmuch-test-progn. This leads to test suite failure due to time out on any emacs test.
2015-12-30test: Always use paths without symlinksMichal Sojka
When notmuch sources are at a symlinked path, some tests fail because one part of the test uses physical path and another uses logical path (with symlinks). For example the following test output is produced when the test is started from /home/src/symlink-to-notmuch, which is a symlink to /home/src/notmuch. FAIL notmuch-fcc-dirs set to a string --- T310-emacs.26.OUTPUT 2015-12-29 08:54:29.055878637 +0000 +++ T310-emacs.26.EXPECTED 2015-12-29 08:54:29.055878637 +0000 @@ -1,5 +1,5 @@ From: Notmuch Test Suite <test_suite@notmuchmail.org> To: Subject: -Fcc: /home/src/notmuch/test/tmp.T310-emacs/mail/sent-string +Fcc: /home/src/symlink-to-notmuch/test/tmp.T310-emacs/mail/sent-string --text follows this line-- nil This commit makes all paths in test scripts physical. With it, all tests pass even when run from a symlinked directory.
2015-11-23test: add sanity tests for threadingDavid Bremner
These tests are inspired by a problem report id:CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com Of course I can't duplicate the mentioned problem, it probably depends on specific message data.
2015-11-19test: Tests for combining --batch and --remove-allDaniel Schoepe
This patch adds some tests for combining --remove-all with --batch or --input when calling notmuch-tag.
2015-11-19lib: content disposition values are not case-sensitiveJani Nikula
Per RFC 2183, the values for Content-Disposition values are not case-sensitive. While at it, use the gmime function for getting at the disposition string instead of referencing the field directly. This fixes "attachment" tagging and filename term generation for attachments while indexing.
2015-11-19tests: add test for case insensitive Content-DispositionDavid Bremner
This is broken now, but will be fixed in the next commit
2015-10-14cli: delete directory documents on directory removal0.21_rc0Jani Nikula
There was a problem with the directory documents being left behind when the filesystem directory was removed. This was worked around in [1]. However, that ignored the fact that the directory documents are also still listed by notmuch_directory_get_child_directories() leading to confusing results when running notmuch new. The directory documents are found and queued for removal over and over again. Fix the problem for real by removing the directory documents. This fixes the tests flagged as broken in [2]. The (non-deterministic) hack test from [3] also still passes with this change. [1] commit acd66cdec075312944e527febd46382e54d99367 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3 [3] id:1441445731-4362-1-git-send-email-jani@nikula.org
2015-10-10test: flag one more notmuch new test as brokenJani Nikula
Drop the test update added in [1] and mark the test as broken, like the tests flagged as broken in [2]. These all reflect the same underlying breakage with (lack of) directory deletion. [1] commit e4e04bbc328f990e36b77f508aef904d156029b1 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3
2015-09-26test: add notmuch address --deduplicate=(no|mailbox|address) testsJani Nikula
First a simple smoke test first, next generate messages with multiple email address variants and check the behaviour of deduplication schemes with these.
2015-09-25lib: add support for date:<expr>..! to mean date:<expr>..<expr>Jani Nikula
It doesn't seem likely we can support simple date:<expr> expanding to date:<expr>..<expr> any time soon. (This can be done with a future version of Xapian, or with a custom query query parser.) In the mean time, provide shorthand date:<expr>..! to mean the same. This is useful, as the expansion takes place before interpetation, and we can use, for example, date:yesterday..! to match from beginning of yesterday to end of yesterday. Idea from Mark Walters <markwalters1009@gmail.com>.
2015-09-25test suite: don't consider skipped individual tests as failingDavid Bremner
It isn't completely clear what we want to do here, but 1) We currently don't fail if we skip a whole test file (mainly because we neglect to count those skipped tests properly). This change at least makes the two kinds of skipping consistent. 2) Automated build environments may have good reasons for building with a minimal set of prereqs, and we don't want to discourage running our test suite by breaking builds.
2015-09-25make test: NOTMUCH_TEST_QUIET=1 is now the defaultTomi Ollila
make test V=1 (or any other value than 0) and make test V=0 works similar way as build in general
2015-09-24test: notmuch address --deduplicate=no testsJani Nikula
Test not using address deduplication. Incorporate some trivial output sorting tests here, as they seem to lack tests.
2015-09-24test: check argc in symbol-testJani Nikula
Check argc mainly to fix unused parameter warning: test/symbol-test.cc:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter] int main(int argc, char** argv) { ^ This makes more sense than telling the compiler it's unused on purpose.
2015-09-20cli/count: update to use notmuch_query_search_messages_stDavid Bremner
This brings back status information that may have been hidden by the great library logging conversion. Note the change of the internal API / return-value for count_files. The other count calls to the lib will also get error handling when that API is updated in the lib.
2015-09-07test: fix whitespace/indentation in symbol-testJani Nikula
Not of much consequence, but makes it nicer to do further edits.
2015-09-04test: move backup_database and restore_database to libraryDavid Bremner
The plan is to re-use them in testing the same errors from the CLI
2015-08-14lib: Add "lastmod:" queries for filtering by last modificationAustin Clements
The implementation is essentially the same as the date range search prior to Jani's fancy date parser.
2015-08-14cli: add global option "--uuid"David Bremner
The function notmuch_exit_if_unmatched_db_uuid is split from notmuch_process_shared_options because it needs an open notmuch database. There are two exceptional cases in uuid handling. 1) notmuch config and notmuch setup don't currently open the database, so it doesn't make sense to check the UUID. 2) notmuch compact opens the database inside the library, so we either need to open the database just to check uuid, or change the API.
2015-08-14cli/count: add --lastmodDavid Bremner
In the short term we need a way to get lastmod information e.g. for the test suite. In the long term we probably want to add lastmod information to at least the structured output for several other clients (e.g. show, search).
2015-08-13lib: API to retrieve database revision and UUIDAustin Clements
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced).
2015-08-07test: make script exit (1) if it "fails" to source (.) a fileTomi Ollila
The files (test) scripts source (with builtin command `.`) provides information which the scripts depend, and without the `source` to succeed allowing script to continue may lead to dangerous situations (e.g. rm -rf "${undefined_variable}"/*). At the end of all source (.) lines construct ' || exit 1' was added; In our case the script script will exit if it cannot find (or read) the file to be sourced. Additionally script would also exits if the last command of the sourced file exited nonzero.
2015-08-07emacs: make modifications to message Fcc vars buffer-localDavid Bremner
Previously we globally modified these variables, which tended to cause problems for people using message-mode, but not notmuch-mua-mail, to send mail. User visible changes: - Calling notmuch-fcc-header-setup is no longer optional. OTOH, it seems to do the right thing if notmuch-fcc-dirs is set to nil. - The Fcc header is visible during message composition - The name in the mode line is changed, and no longer matches exactly the menu label. - Previously notmuch-mua-send-and-exit was never called. Either we misunderstood define-mail-user-agent, or it had a bug. So there was no difference if the user called message-send-and-exit directly. Now there will be. - User bindings to C-c C-c and C-c C-s in message-mode-map are overridden. The user can override them in notmuch-message-mode-map, but then they're on their own for Fcc handling.