chiark / gitweb /
NOT FOR UPSTREAM - CHANGELOG VERSION
[gnupg2.git] / tests / fake-pinentries / README.txt
1 Fake Pinentries for Test Suites
2 ===============================
3
4 If you're writing a test suite, it should use one of these pinentries
5 by setting the following line in $GNUPGHOME/gpg-agent.conf:
6
7     pinentry-program /path/to/fake-pinentry.ext
8
9 Note that different fake-pinentry programs have been supplied here in
10 different languages, with the intent of making them available to
11 developers who have different languages available.
12
13 They are all licensed Creative Commons Zero (CC0-1.0-Universal, see
14 the COPYING.CC0 file in GnuPG's top directory), so they should be
15 reusable by any project.  Feel free to copy them into your own
16 project's test suite.
17
18 Rationale
19 ---------
20
21 If you're implementing software that uses GnuPG, you probably want a
22 test suite that exercises your code, and you may have some that
23 involve secret key material locked with a passphrase.  However, you
24 don't want to require your developers to manually enter a passphrase
25 while tests are run, and you probably also don't want to deal with
26 alternate codepaths/workflows like using gpg's loopback pinentry.
27
28 The solution for this is to use a fake pinentry in your test suite,
29 one that simply returns a pre-selected passphrase.  In this case, all
30 the other code follows the same path as normal, but the user
31 interaction is bypassed because the fake-pinentry is used instead.
32
33 Troubleshooting
34 ---------------
35
36 If you have any trouble with this technique, please drop a line to the
37 GnuPG development mailing list <gnupg-devel@gnupg.org> or open a
38 report on the GnuPG bug tracker at https://bugs.gnupg.org/gnupg