aboutsummaryrefslogtreecommitdiffstats
path: root/tests (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-09-23g10: Hyphenate --clearsign.justus/issue2700Justus Winter1-2/+2
* g10/gpg.c (opts): Hyphenate option. * doc/gpg.texi: Update accordingly. * po: Update translations. * tests/openpgp: Update tests. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
2016-09-22g10: When adding a user id, make sure the keyblock has been prepared.Neal H. Walfield1-1/+22
* g10/keyedit.c (keyedit_quick_adduid): Call merge_keys_and_selfsig on KEYBLOCK before adding the user id. * tests/openpgp/quick-key-manipulation.scm: Make sure that the key capabilities don't change when adding a user id. (key-data): New function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2697
2016-09-20tests: Add documentation, make interactive debugging possible.Justus Winter2-1/+45
* tests/openpgp/README: Add documentation about debugging and interfacing with GnuPG. * tests/openpgp/run-tests.scm (test::run-sync): Hand stdin to the child so that we can use a repl in the tests. Signed-off-by: Justus Winter <[email protected]>
2016-09-20tests: Drop the old shell-based tests.Justus Winter40-3337/+1
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-20tests: Port the quick key manipulation test to Scheme.Justus Winter2-0/+67
* tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/quick-key-manipulation.scm: New file. Signed-off-by: Justus Winter <[email protected]>
2016-09-20tests: Remove list of tests from the test runner.Justus Winter1-43/+1
* tests/openpgp/run-tests.scm: Drop hardcoded list. Signed-off-by: Justus Winter <[email protected]>
2016-09-20tests: Reduce runtime of excessive test.Justus Winter1-17/+1
* tests/openpgp/conventional-mdc.scm: Use only two plaintexts when iterating over all cipher algorithms. Signed-off-by: Justus Winter <[email protected]>
2016-09-19tests: Refine the repl function.Justus Winter1-21/+21
* tests/gpgscm/repl.scm (repl): Add an argument 'environment'. (interactive-repl): Add an optional argument 'environment'. -- With this change, we can drop (interactive-repl (current-environment)) anywhere into the code and do some interactive debugging. Signed-off-by: Justus Winter <[email protected]>
2016-09-19tests: Implement interpreter shutdown using exceptions.Justus Winter2-1/+23
* tests/gpgscm/ffi.c (ffi_init): Rename 'exit' to '_exit'. * tests/gpgscm/ffi.scm (*interpreter-exit*): New variable. (throw): New function. (exit): New function. -- This allows a proper cleanup of resources. Signed-off-by: Justus Winter <[email protected]>
2016-09-19tests: Correctly handle exceptions in resource handling macros.Justus Winter1-4/+13
* tests/gpgscm/tests.scm (letfd): Correctly release resources when an exception is thrown. (with-working-directory): Likewise. (with-temporary-working-directory): Likewise. (lettmp): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-19tests: Refine exception handling.Justus Winter3-7/+7
* tests/gpgscm/init.scm (catch): Bind all arguments to '*error*' in the error handler, update and fix comment. (*error-hook*): Revert to original definition. * tests/gpgscm/tests.scm (tr:do): Adapt accordingly. * tests/openpgp/issue2419.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-19tests: Use descriptive temporary file names.Justus Winter4-4/+21
* tests/gpgscm/ffi.c (do_get_isotime): New function. (ffi_init): Add parameter 'scriptname', bind new function and scriptname. * tests/gpgscm/ffi.h (ffi_init): Update prototype. * tests/gpgscm/main.c (main): Hand in the script name. * tests/gpgscm/tests.scm (mkdtemp): Use current time and script name for the names of temporary directories. Signed-off-by: Justus Winter <[email protected]>
2016-09-19build: Distribute fake pinentries.Werner Koch1-0/+5
-- Signed-off-by: Werner Koch <[email protected]>
2016-09-19doc: Update license information.Werner Koch2-123/+3
* tests/fake-pinentries/COPYING: Rename to ... * COPYING.CC0: this. Add a note on the scope of this license. * COPYING.LIB: Add a note on the scope of this license. * AUTHORS (License): Mention CC) license. Signed-off-by: Werner Koch <[email protected]>
2016-09-19gpgscm: Fix gcrypt version check.Werner Koch1-1/+1
* tests/gpgscm/main.c (main): Check against required and not installed version. Signed-off-by: Werner Koch <[email protected]>
2016-09-17Fix comment and format.NIIBE Yutaka1-1/+1
* agent/protect-tool.c (main): Fix comment. * doc/DETAILS (colon listings): Fix list. * tests/openpgp/multisig.test: Fix comment. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-09-17Fix more spellingDaniel Kahn Gillmor7-9/+9
* NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-09-15tests/fake-pinentries: fake pinentries for downstream developers.Daniel Kahn Gillmor6-0/+275
* tests/fake-pinentries/README.txt and tests/fake-pinentries/fake-pinentry.{sh,py,pl,php}}: New public domain (CC0) files to encourage better test suite practices from downstream developers. * tests/fake-pinentries/COPYING (new): a copy of https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-09-15tests/gpgscm: Fix use of pointer.NIIBE Yutaka2-4/+4
* tests/gpgscm/scheme-private.h (struct scheme): Use (void *) for alloc_seg. * tests/gpgscm/scheme.c (alloc_cellseg): Use (void *) for cp. Use (void *) for coercion of address calculation. -- In old C language, (char *) means an address. In modern C, it's specifically an address with alignment=1. It's good to use (void *) for an address, because newer compiler emits warnings. Note: in this particular case, it is just a warning and the code is safe against invalid alignment, though. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-09-12tests: Simplify tofu test.Justus Winter1-66/+64
* tests/openpgp/tofu.scm: Simplify now that we only have one db format. Signed-off-by: Justus Winter <[email protected]>
2016-09-07tests: Don't use --tofu-db-format.Neal H. Walfield1-33/+30
* tests/openpgp/tofu.scm: Remove use of --tofu-db-format, which is deprecated. -- Signed-off-by: Neal H. Walfield <[email protected]>
2016-09-06gpgscm: Fix detection of unbalanced parenthesis.Justus Winter2-0/+9
* tests/gpgscm/main.c (load): Print error message. * tests/gpgscm/scheme.c (opexe_0): Correctly report nesting level when loading files. Signed-off-by: Justus Winter <[email protected]>
2016-09-06tests: Fix test.Justus Winter1-1/+1
* tests/openpgp/multisig.scm: Add missing parenthesis. Signed-off-by: Justus Winter <[email protected]>
2016-09-05tests: Speed up the test suite.Justus Winter2-126/+150
* tests/openpgp/run-tests.scm (test::run-sync): Pass additional arguments to the test. (test::run-sync-quiet): Likewise. (test::run-async): Likewise. (run-tests-{parallel,sequential}-isolated): Create a tarball of the gnupghome, then extract it for each test. * tests/openpgp/setup.scm: Refactor into functions, add an interface to tar-up the created environment, and untar it multiple times. Signed-off-by: Justus Winter <[email protected]>
2016-09-05tests: Update README.Justus Winter1-8/+22
* tests/openpgp/README: Update. Signed-off-by: Justus Winter <[email protected]>
2016-09-05tests: Pass flags to test driver.Justus Winter1-1/+1
* tests/openpgp/Makefile.am (xcheck): Pass flags to 'run-tests.scm'. Signed-off-by: Justus Winter <[email protected]>
2016-08-25gpg: Fix false negatives in Ed25519 signature verification.Werner Koch1-0/+73
* g10/pkglue.c (pk_verify): Fix Ed25519 signatrue values. * tests/openpgp/verify.scm (msg_ed25519_rshort): New (msg_ed25519_sshort): New. ("Checking that a valid Ed25519 signature is verified as such"): New. -- About one out of 256 signature won't verify due to stripped zero bytes. See the source comment for details. Reported-by: Andre Heinecke Signed-off-by: Werner Koch <[email protected]>
2016-08-25gpg: New option --with-tofu-info.Werner Koch1-3/+3
* g10/gpg.c (oWithTofuInfo): New. (opts): Add --with-tofu-info. (main): Set opt.with_tofu_info. * g10/options.h (struct opt): Add field WITH_TOFU_INFO. * g10/tofu.c (show_statistics): Add optional arg OUTFP and enter special mode if not NULL. Change all callers. (tofu_write_tfs_record): New. * g10/keylist.c (list_keyblock_colon): Do not print the tofu policy as part of the "uid" record. Print a new "tfs" record if the new option is set. * tests/openpgp/tofu.scm (getpolicy): Change from UID to TFS record. -- A separate option is required to avoid slowing down key listings. Foer example the current code takes for a keylisting in tofu+pgp mode 17 seconds while it takes more than 5 minutes if the option is used. Signed-off-by: Werner Koch <[email protected]>
2016-08-12Call log_set_prefix() with human-readable labels.Daniel Kahn Gillmor1-1/+1
* agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c * tests/gpgscm/main.c, tools/gpg-check-pattern.c * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c * tools/symcryptrun.c: Invoke log_set_prefix() with human-readable labels. -- Some invocations of log_set_prefix() were done with raw numeric values instead of values that humans can understand. Use symbolic representations instead of numeric for better readability. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-08-10tests: Fix distcheck.Justus Winter1-0/+4
* tests/openpgp/issue2417.scm: Copy configuration. Signed-off-by: Justus Winter <[email protected]>
2016-08-10gpg: Remove tofu database format "split".Werner Koch1-1/+1
* g10/options.h (struct opt): Remove field tofu_db_format. * g10/gpg.h (server_control_s): Add fields tofu.batch_update_ref and tofu.batch_update_started. * g10/gpg.c (parse_tofu_db_format): Remove. (main): Make option --tofu-db-format obsolete. * g10/tofu.c: Major rework. Remove the pretty complicated and slower split format and with that all the caching. Use the dbs struct directly. Move global vars for batch update into CTRL. Change calling conventions of some function to take CTRL or DBS pointers instead of the former low-level database pointer. -- The split database format might have been nice for use with Unison but it bypasses the concept of a relational database by doing parts of this itself and also risking deadlocks. Working with the Tofu database for debugging or experiments is also not possible with parts of the database logic implemented in gpg. The Tofu support is quite new and we can assume that it is not in real use now. Thus we better remove that now so that we do not need to maintain it for all future. Signed-off-by: Werner Koch <[email protected]>
2016-08-10g10: Fix opening of trust database.Justus Winter2-0/+40
* g10/tdbio.c (tdbio_set_dbname): This function explicitly checks for the file size, but handled the case of a zero-sized file incorrectly by returning success. Fix this by initializing the database in that case. * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/issue2417.scm: New file. GnuPG-bug-id: 2417 Signed-off-by: Justus Winter <[email protected]>
2016-08-10tests: Fix distcheck.Justus Winter1-1/+2
* tests/openpgp/Makefile.am (EXTRA_DIST): Explicitly add setup and teardown scripts now that they no longer are included in the list of tests. Signed-off-by: Justus Winter <[email protected]>
2016-08-10tests: Improve temporary directory handling.Justus Winter3-5/+14
* tests/gpgscm/ffi.c (ffi_init): Rename 'mkdtemp'. * tests/gpgscm/tests.scm (mkdtemp): New function that uses a sensible location and template if no arguments are given. (with-temporary-working-directory): Simplify accordingly. (make-temporary-file): Likewise. * tests/openpgp/run-tests.scm (run-tests-parallel-isolated): Likewise. (run-tests-sequential-isolated): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-08-10gpgscm: Make the name of foreign functions more unique.Justus Winter1-1/+1
* tests/gpgscm/ffi-private.h (ffi_define_function_name): Add another underscore. Signed-off-by: Justus Winter <[email protected]>
2016-08-10tests: Run each test in a clean environment.Justus Winter2-9/+19
* tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Drop obsolete variables, add 'srcdir', use absolute paths. (TESTS): Rename to 'XTESTS' to avoid emitting the automake test runner. Drop 'setup.scm' and 'finish.scm'. (xcheck): New target that runs 'run-tests.scm', our Scheme test suite runner. It will run each test in a clean environment, isolated from the other tests. (EXTRA_DIST): Adapt accordingly. * tests/openpgp/README: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-08-10tests: Make ssh test more robust.Justus Winter1-5/+5
* tests/openpgp/ssh.scm: Drop the 'MD5:' which was not printed by previous ssh versions. Signed-off-by: Justus Winter <[email protected]>
2016-08-08tests: Add openpgp/gpgv-forged-keyring.scm.NIIBE Yutaka4-0/+70
* tests/openpgp/gpgv-forged-keyring.scm: New. * tests/openpgp/forged-keyring.gpg: New. * tests/openpgp/Makefile.am (TESTS): Add gpgv-forged-keyring.scm. * tests/openpgp/defs.scm (tools): Add GPGV. (GPGV): New. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-08-04tests: Use gpgconf to set the ssh socket envvar.Werner Koch1-1/+3
* tests/openpgp/ssh.scm ("SSH_AUTH_SOCK"): Use gpgconf. Signed-off-by: Werner Koch <[email protected]>
2016-08-04tests: Update list of tests in Scheme test runner.Justus Winter1-1/+7
* tests/openpgp/run-tests.scm: Add missing tests. Signed-off-by: Justus Winter <[email protected]>
2016-08-04tests: Fix path to fake-pinentry.Justus Winter1-2/+3
* tests/openpgp/defs.scm: Correctly compute the path to fake-pinentry. Signed-off-by: Justus Winter <[email protected]>
2016-08-03Fix spelling and grammar.Daniel Kahn Gillmor2-2/+2
* agent/learncard.c: s/coccured/occurred/ * doc/dirmngr.texi: s/ommitted/omitted/, s/orginally/originally/, s/reponses/responses/i * doc/gpg-agent.texi, doc/dirmngr.texi, doc/gpg.texi: Fix "allows to" to more conventional english usage. * doc/tools.texi, g10/gpgcommpose.c, tests/openpgp/armor.scm, tests/openpgp/armor.test: s/occured/occurred/ * tools/gpgsplit.c: s/calcualting/calculating/ * sm/server.c: s/formated/formatted/ Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-08-01tests: Distribute standalone test runner.Justus Winter1-1/+1
* tests/openpgp/Makefile.am (EXTRA_DIST): Add missing file 'run-tests.scm'. GnuPG-bug-id: 2431 Signed-off-by: Justus Winter <[email protected]>
2016-07-28tests: Fix distcheck.Justus Winter1-1/+3
* tests/openpgp/Makefile.am (sample_msgs): New variable. (EXTRA_DIST): Also ship the sample msgs. Signed-off-by: Justus Winter <[email protected]>
2016-07-26common: Fix iobuf_peek corner case.Justus Winter5-8/+43
Previously, iobuf_peek on a file smaller than 'buflen' would hang. * common/iobuf.c (underflow): Generalize by adding a target parameter. (iobuf_peek): Use this to prevent looping here. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/setup.scm (dearmor): Move function... * tests/openpgp/defs.scm (dearmor): ... here. * tests/openpgp/issue2419.scm: New file. * tests/openpgp/samplemsgs/issue2419.asc: Likewise. GnuPG-bug-id: 2419 Signed-off-by: Justus Winter <[email protected]>
2016-07-26gpgscm: Do not shadow common function name in catch macro.Justus Winter1-2/+2
* tests/gpgscm/init.scm (catch): Do not shadow 'exit'. Signed-off-by: Justus Winter <[email protected]>
2016-07-26tests: Fix distcheck.Justus Winter1-1/+2
* tests/openpgp/Makefile.am (samplekeys): Add missing key. Fixes-commit: 4ba11251 Signed-off-by: Justus Winter <[email protected]>
2016-07-26gpgscm: Make the verbose setting more useful.Justus Winter4-5/+39
* tests/gpgscm/ffi.c (do_get_verbose): New function. (do_set_verbose): Likewise. (ffi_init): Turn *verbose* into a function, add *set-verbose!*. * tests/gpgscm/tests.scm (call): Adapt accordingly. (call-with-io): Dump output if *verbose* is high. (pipe-do): Adapt accordingly. * tests/openpgp/defs.scm: Set verbosity according to environment. * tests/openpgp/run-tests.scm (test): Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
2016-07-25g10: Fix key import statistics.Justus Winter3-0/+91
'transfer_secret_keys' collects statistics on a subkey-basis, while the other code does not. This leads to inflated numbers when importing secret keys. E.g. 'count' is incremented by the main parsing loop in 'import', and again in 'transfer_secret_keys', leading to a total of 3 if one key with two secret subkeys is imported. * g10/import.c (import_secret_one): Adjust to the fact that 'transfer_secret_keys' collects subkey statistics. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/issue2346.scm: New file. * tests/openpgp/samplekeys/issue2346.gpg: Likewise. GnuPG-bug-id: 2346 Signed-off-by: Justus Winter <[email protected]>
2016-07-22gpgscm: Make function more general.Justus Winter1-2/+2
* tests/gpgscm/tests.scm (in-srcdir): Accept more path fragments. Signed-off-by: Justus Winter <[email protected]>