summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-04-23lib: choose oldest message when breaking reference loopsDavid Bremner
This preserves a sensible thread order
2018-04-23test: add known broken test for thread ordering from a loopDavid Bremner
The previous loop handling code chooses the last message in the message list, which turns out to be the last in date order. See the comment in _notmuch_thread_create.
2018-04-20lib: break reference loop by choosing arbitrary top level msgDavid Bremner
Other parts of notmuch (e.g. notmuch show) expect each thread to contain at least one top level message, and crash if this expectation is not met.
2018-04-20test: add known broken test for indexing an In-Reply-To loop.David Bremner
This documents the bug discussed in id:87d10042pu.fsf@curie.anarc.at
2018-04-20test: two new messages for the 'broken' corpusDavid Bremner
These have an 'In-Reply-To' loop, which currently confuses "notmuch new".
2017-12-29cli/reply: make --decrypt take a keywordDaniel Kahn Gillmor
This brings the --decrypt argument to "notmuch reply" into line with the other --decrypt arguments (in "show", "new", "insert", and "reindex"). This patch is really just about bringing consistency to the user interface. We also use the recommended form in the emacs MUA when replying, and update test T350 to match.
2017-12-29cli/show: make --decrypt take a keyword.Daniel Kahn Gillmor
We also expand tab completion for it, update the emacs bindings, and update T350, T357, and T450 to match. Make use of the bool-to-keyword backward-compatibility feature.
2017-12-29cli: some keyword options can be supplied with no argumentDaniel Kahn Gillmor
We might change some notmuch command line tools that used to be booleans into keyword arguments. In that case, there are some legacy tools that will expect to be able to do "notmuch foo --bar" instead of "notmuch foo --bar=baz". This patch makes it possible to support that older API, while providing a warning and an encouragement to upgrade.
2017-12-24python: add decrypt_policy argument to Database.index_file()Daniel Kahn Gillmor
We adopt a pythonic idiom here with an optional argument, rather than exposing the user to the C indexopts object directly. This now includes a simple test to ensure that the decrypt_policy argument works as expected.
2017-12-21test: final named query test works regardless of Xapian FieldProcessorDaniel Kahn Gillmor
This test passes with older versions of Xapian as well, because neither query returns any results. This should resolve the travis build failure at https://travis-ci.org/notmuch/notmuch/builds/318571658 Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2017-12-21lib: return "" rather than NULL from notmuch_thread_get_authorsDavid Bremner
The current behaviour is at best under-documented. The modified test in T470-missing-headers.sh previously relied on printf doing the right thing with NULL, which seems icky. The use of talloc_strdup here is probably overkill, but it avoids having to enforce that thread->authors is never mutated outside _resolve_thread_authors_string.
2017-12-19test: retrying lock tests are broken when built against older XapianDaniel Kahn Gillmor
If we're building against a version of Xapian that doesn't offer retrying the lock, we should be honest and describe the tests as broken, rather than marking them as missing a test prerequisite. missing test prerequisites should be for specific components of the test harness that are missing, not for the backend library notmuch uses.
2017-12-19test: named query tests are broken when missing Xapian FieldProcessorDaniel Kahn Gillmor
Named queries don't work without Xapian FieldProcessor. Rather than silently skipping them, we should explictly mark them as broken when building against an older version of Xapian.
2017-12-19test: searching by absolute date is broken without Xapian FieldProcessorDaniel Kahn Gillmor
Previously, the test suite had simply silently skipped the absolute date test if we're using an archaic version of Xapian. For correctness, we should instead mark the test as broken. This also changes from string to numeric comparison when checking NOMTUCH_HAVE_XAPIAN_FIELD_PROCESSOR for consistency with other tests.
2017-12-19test: Add test to unset config items with the python bindingsl-m-h@web.de
2017-12-19python: Rename get_config_list to get_configsl-m-h@web.de
The old name has a bit of a feeling of hungarian notation. Also many generators in the core are named with the suffix "s" to indicate iterables: dict.items, dict.keys for example.
2017-12-19test: Add tests for new python bindingsl-m-h@web.de
The tests where adopted from the tests for the corresponding C functions in test/T590-libconfig.sh.
2017-12-15test: test regexp based new.ignoreJani Nikula
Just some basics.
2017-12-14cli: add support for only printing the addresses in notmuch addressJani Nikula
The notmuch address output is much more useful for scripts with just the addresses printed. Support this using the --output=address option.
2017-12-13test: expand argument parsing sanity checksJani Nikula
Test the various boolean formats and --no- prefixed boolean and keyword flag arguments.
2017-12-08Merge branch 'release'David Bremner
Conflicts: NEWS Add in NEWS from point release
2017-12-08test/emacs: add exploit mitigation testDavid Bremner
This test will pass if either the notmuch show mitigation code is working correctly, or upstream emacs mime handling code has it's own fix for https://bugs.gnu.org/28350.
2017-12-08crypto: signature verification reports valid User IDsDaniel Kahn Gillmor
When i'm trying to understand a message signature, i care that i know who it came from (the "validity" of the identity associated with the key), *not* whether i'm willing to accept the keyholder's other identity assertions (the "trust" associated with the certificate). We've been reporting User ID information based on the "trust" associated with the certificate, because GMime didn't clearly expose the validity of the User IDs. This change relies on fixes made in GMime 3.0.3 and later which include https://github.com/jstedfast/gmime/pull/18.
2017-12-08crypto: add --decrypt=nostash to avoid stashing session keysDaniel Kahn Gillmor
Here's the configuration choice for people who want a cleartext index, but don't want stashed session keys. Interestingly, this "nostash" decryption policy is actually the same policy that should be used by "notmuch show" and "notmuch reply", since they never modify the index or database when they are invoked with --decrypt. We take advantage of this parallel to tune the behavior of those programs so that we're not requesting session keys from GnuPG during "show" and "reply" that we would then otherwise just throw away.
2017-12-08crypto: actually stash session keys when decrypt=trueDaniel Kahn Gillmor
If you're going to store the cleartext index of an encrypted message, in most situations you might just as well store the session key. Doing this storage has efficiency and recoverability advantages. Combined with a schedule of regular OpenPGP subkey rotation and destruction, this can also offer security benefits, like "deletable e-mail", which is the store-and-forward analog to "forward secrecy". But wait, i hear you saying, i have a special need to store cleartext indexes but it's really bad for me to store session keys! Maybe (let's imagine) i get lots of e-mails with incriminating photos attached, and i want to be able to search for them by the text in the e-mail, but i don't want someone with access to the index to be actually able to see the photos themselves. Fret not, the next patch in this series will support your wacky uncommon use case.
2017-12-08cli/reindex: destroy stashed session keys when --decrypt=falseDaniel Kahn Gillmor
There are some situations where the user wants to get rid of the cleartext index of a message. For example, if they're indexing encrypted messages normally, but suddenly they run across a message that they really don't want any trace of in their index. In that case, the natural thing to do is: notmuch reindex --decrypt=false id:whatever@example.biz But of course, clearing the cleartext index without clearing the stashed session key is just silly. So we do the expected thing and also destroy any stashed session keys while we're destroying the index of the cleartext. Note that stashed session keys are stored in the xapian database, but xapian does not currently allow safe deletion (see https://trac.xapian.org/ticket/742). As a workaround, after removing session keys and cleartext material from the database, the user probably should do something like "notmuch compact" to try to purge whatever recoverable data is left in the xapian freelist. This problem really needs to be addressed within xapian, though, if we want it fixed right.
2017-12-08cli/new, insert, reindex: change index.decrypt to "auto" by defaultDaniel Kahn Gillmor
The new "auto" decryption policy is not only good for "notmuch show" and "notmuch reindex". It's also useful for indexing messages -- there's no good reason to not try to go ahead and index the cleartext of a message that we have a stashed session key for. This change updates the defaults and tunes the test suite to make sure that they have taken effect.
2017-12-08cli/show: use decryption policy "auto" by default.Daniel Kahn Gillmor
When showing a message, if the user doesn't specify --decrypt= at all, but a stashed session key is known to notmuch, notmuch should just go ahead and try to decrypt the message with the session key (without bothering the user for access to their asymmetric secret key). The user can disable this at the command line with --decrypt=false if they really don't want to look at the e-mail that they've asked notmuch to show them. and of course, "notmuch show --decrypt" still works for accessing the user's secret keys if necessary.
2017-12-08cli/reply: use decryption policy "auto" by default.Daniel Kahn Gillmor
If the user doesn't specify --decrypt= at all, but a stashed session key is known to notmuch, when replying to an encrypted message, notmuch should just go ahead and decrypt. The user can disable this at the command line with --decrypt=false, though it's not clear why they would ever want to do that.
2017-12-08crypto: new decryption policy "auto"Daniel Kahn Gillmor
This new automatic decryption policy should make it possible to decrypt messages that we have stashed session keys for, without incurring a call to the user's asymmetric keys.
2017-12-08lib: convert notmuch decryption policy to an enumDaniel Kahn Gillmor
Future patches in this series will introduce new policies; this merely readies the way for them. We also convert --try-decrypt to a keyword argument instead of a boolean.
2017-12-08indexing: Change from try_decrypt to decryptDaniel Kahn Gillmor
the command-line interface for indexing (reindex, new, insert) used --try-decrypt; and the configuration records used index.try_decrypt. But by comparison with "show" and "reply", there doesn't seem to be any reason for the "try" prefix. This changeset adjusts the command-line interface and the configuration interface. For the moment, i've left indexopts_{set,get}_try_decrypt alone. The subsequent changeset will address those.
2017-12-05test: session keys are known broken without session key supportDaniel Kahn Gillmor
If the version of GMime we're building against doesn't support session key extraction or re-use, mark the tests that rely on session key capabilities as known-broken. This should resolve test suite failures on ubuntu trusty and debian jessie and earlier, which have GMime 2.6.20 -- session key support was introduced in GMime 2.6.21.
2017-12-04crypto: Test restore of cleartext index from stashed session keysDaniel Kahn Gillmor
If you've got a notmuch dump that includes stashed session keys for every decrypted message, and you've got your message archive, you should be able to get back to the same index that you had before. Here we add a simple test that give some flavor of how that works.
2017-12-04test/corpora: add an encrypted message for index decryption testsDaniel Kahn Gillmor
2017-12-04test: unbreak performance testsDavid Bremner
In 8e7fb88237aedea22 Jani replaced the use of $(pwd -P) to find the TEST_DIRECTORY in order to better support out of tree builds. Unfortunately the performance-tests need a different value for the variable and were thus broken. This commit splits out the setting of this variable for the two sets of tests. Performance tests still don't work out of tree, because the handling of the downloaded corpus needs to be updated.
2017-11-08test: test notmuch insert --folder=""Jani Nikula
Test insert into top level folder.
2017-10-29test: fix test database backup/restore locationJani Nikula
backup_database() and restore_database() used to store the backups in the test specific temporary directory, through the current working directory being there. Commit 8e7fb88237ae ("test: use source and build paths in test-lib-common.sh") started using a test specific backup directories under the build tree test directory. This was in error. Switch back to the old location, but using paths to the location instead of relying on current working directory. Reported by Daniel Kahn Gillmor <dkg@fifthhorseman.net>.
2017-10-21cli/reindex: add --try-decrypt=(true|false)Daniel Kahn Gillmor
Enable override of the index.try_decrypt setting on a per-run basis when invoking "notmuch reindex". This allows the possibility of (for example) an emacs keybinding that adds the cleartext of the currently shown decrypted message to the index, making it searchable in the future. It also enables one-time indexing of all messages matching some query, like so: notmuch reindex tag:encrypted and\ not property:index.decryption=success and\ from:alice@example.org We also update the documentation and tab completion, and add a few more tests.
2017-10-21cli/insert: add --try-decrypt=(true|false)Daniel Kahn Gillmor
Enable override of the index.try_decrypt setting on a per-message basis when invoking "notmuch insert". We also update the documentation and tab completion, and add more tests.
2017-10-21cli/new: add --try-decrypt=(true|false)Daniel Kahn Gillmor
Enable override of the index.try_decrypt setting during "notmuch new" on a per-invocation basis. We update the documentation and tab completion, and also add a test.
2017-10-21tests: emacs_fcc_message: allow passing --arguments to notmuch newDaniel Kahn Gillmor
Subsequent patches may want to send GNU-style --long-arguments to notmuch new in the test suite, in particular when invoking emacs_fcc_message. This changeset makes that possible.
2017-10-21test: use source path in add_gnupg_homeJani Nikula
Make a distinction between source and build directories.
2017-10-21test: remove --root option and fix TMP_DIRECTORY cleanupJani Nikula
The primary motivation here is to fix TMP_DIRECTORY cleanup prior to running each test when the current working directory is not the test subdirectory. Tests with failures would leave their TMP_DIRECTORY directory behind for debugging, and repeated out-of-tree test runs would have old temp directories. (This lead to e.g. T310-emacs.sh hanging because emacs would prompt for overwriting files.) We remove the likely anyway defunct --root test option while at it, just to be on the safe side when doing 'rm -rf' on the TMP_DIRECTORY.
2017-10-20test: use source and build paths in T590-thread-breakage.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use source and build paths in T480-hex-escaping.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use source and build paths in T4?0-emacs-*.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use source and build paths in T380-atomicity.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use source and build paths in T360-symbol-hiding.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use source and build paths in T355-smime.shJani Nikula
Make a distinction between source and build directories.