aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "tests: Add test demonstrating issue2929."Justus Winter2017-01-302-34/+1
| | | | This reverts commit 5aafa56dffefe3fac55b9d0555c7c86e8a07f072.
* tests,w32: Fix GPGME tests requiring a pinentry.Justus Winter2017-01-251-2/+4
| | | | | | | | | | | * tests/gpgme/gpgme-defs.scm: Use our fake pinentry, and configure it to supply the correct passphrase. -- Previously, the GPGME tests used the fake pinentry distributed with GPGME which is a Bourne shell script. Use the fake pinentry from GnuPG instead. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix gpgsm signature verification test.Justus Winter2017-01-251-4/+4
| | | | | | | | | | | * tests/gpgsm/verify.scm: Use 'call-with-binary-output-file' to avoid automatic line-ending conversion. -- Previously, Windows' automatic line-ending conversion turned '\n' into '\r\n' when writing the sample to a file, making the signature invalid. Signed-off-by: Justus Winter <[email protected]>
* tests: Skip GPGME tests that are not built.Justus Winter2017-01-251-2/+5
| | | | | | | | | | * tests/gpgme/wrap.scm: Skip tests that are not built. -- Previously, all tests from GPGME's test suite that were not built (e.g. because GPGME was not configured with QT) were marked as failures. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix locating GPGME's tests on Windows.Justus Winter2017-01-251-1/+1
| | | | | | | | | | * tests/gpgme/run-tests.scm: Qualify the test with the executable extension. -- Previously, the test suite could not locate the test executables on Windows because the Windows-specific file extension was missing. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test demonstrating issue2929.Justus Winter2017-01-242-1/+34
| | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/issue2929.scm: New file. -- This test demonstrates a problem with the TOFU trust model when a new key is created. Signed-off-by: Justus Winter <[email protected]>
* tests: Enable gpgconf test.Justus Winter2017-01-241-4/+1
| | | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Re-add gpgconf.scm. -- This partially reverts 25e029823813e190a18b601af60efcb1fb3b84af. That change was not sufficiently motivated, and our continuous integration server shows no recent distcheck failures. Signed-off-by: Justus Winter <[email protected]>
* build: Change make distcheck configure and temp. remove gpgconf.scm.Werner Koch2017-01-231-1/+4
| | | | | | | | * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Also test gpgtar and wks-tools. Disable ntbtls. * tests/openpgp/Makefile.am (XTESTS): Temporary remove gpgconf.scm. Signed-off-by: Werner Koch <[email protected]>
* tests: Improve GPGHOME handling.Justus Winter2017-01-163-12/+6
| | | | | | | | * tests/openpgp/defs.scm (GPGHOME): New variable. * tests/openpgp/ssh-import.scm: Remove redundant code, use 'path-join'. * tests/openpgp/tofu.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Improve gpgconf test.Justus Winter2017-01-102-6/+25
| | | | | | | | * tests/openpgp/defs.scm (valgrind): New variable. (gpg-config): Fix clearing an option. * tests/openpgp/gpgconf.scm: Also toggle 'quiet'. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for gpgconf.Justus Winter2017-01-103-2/+73
| | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/defs.scm (percent-encode): New function. (gpg-conf): Generalize so that we can feed stdin. (gpg-config): New function. * tests/openpgp/gpgconf.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: New test for --{show,override}-session-key.Justus Winter2017-01-052-0/+46
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/decrypt-session-key.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix macro.Justus Winter2017-01-053-8/+12
| | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Make hygienic, use define-macro, do not change to the ephemeral home directory. * tests/gpgsm/setup.scm: Change to the ephemeral home directory. * tests/openpgp/setup.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix locating the components.Justus Winter2017-01-041-9/+29
| | | | | | | | | | | * tests/openpgp/defs.scm (percent-decode): New function. (bin-prefix): New variable. (installed?): Likewise. (tool-hardcoded): Use the new variables. (gpg-conf): Use the new function to decode the values. (gpg-components): Do not use '--build-prefix' when 'installed?'. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix faked time in the TOFU test.Justus Winter2017-01-021-1/+1
| | | | | | * tests/openpgp/tofu.scm (GPG): Fix time delta. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fail if too many arguments are given.Justus Winter2017-01-022-6/+4
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Enable check. * tests/gpgscm/tests.scm (test::report): Remove superfluous argument. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add 'finally', rework all macros.Justus Winter2017-01-022-44/+52
| | | | | | | | | | | | | | | * tests/gpgscm/init.scm (finally): New macro. * tests/gpgscm/tests.scm (letfd): Rewrite. (with-working-directory): Likewise. (with-temporary-working-directory): Likewise. (lettmp): Likewise. -- Rewrite all our macros using 'define-macro'. Use the new control flow mechanism 'finally', or 'dynamic-wind' where appropriate. Make sure the macros are hygienic. Reduce code duplication. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use boxed values for source locations.Justus Winter2017-01-022-46/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct port): Use boxed values for filename and current line. This allows us to use the same Scheme object for labeling all expressions in a file. * tests/gpgscm/scheme.c (file_push): Use boxed type for filename. (mark): Mark location objects of port objects. (gc): Mark location objects in the load stack. (port_clear_location): New function. (port_reset_current_line): Likewise. (port_increment_current_line): Likewise. (file_pop): Adapt accordingly. (port_rep_from_filename): Likewise. (port_rep_from_file): Likewise. (port_close): Likewise. (skipspace): Likewise. (token): Likewise. (_Error_1): Likewise. (opexe_0): Likewise. (opexe_5): Likewise. (scheme_deinit): Likewise. (scheme_load_file): Likewise. (scheme_load_named_file): Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Guard use of union member.Justus Winter2016-12-211-1/+1
| | | | | | | | * tests/gpgscm/scheme.c (opexe_5): Check that we have a file port before accessing filename. Fixes a crash on 32-bit architectures. Fixes-commit: e7429b1ced0c69fa7901f888f8dc25f00fc346a4 Signed-off-by: Justus Winter <[email protected]>
* tests: Add test suite for gpgsm.Justus Winter2016-12-2020-1/+4837
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (AC_CONFIG_FILES): Add new file. * tests/Makefile.am (SUBDIRS): Add new directory. * tests/gpgsm/32100C27173EF6E9C4E9A25D3D69F86D37A4F939: New file. * tests/gpgsm/Makefile.am: Likewise. * tests/gpgsm/cert_dfn_pca01.der: Likewise. * tests/gpgsm/cert_dfn_pca15.der: Likewise. * tests/gpgsm/cert_g10code_test1.der: Likewise. * tests/gpgsm/decrypt.scm: Likewise. * tests/gpgsm/encrypt.scm: Likewise. * tests/gpgsm/export.scm: Likewise. * tests/gpgsm/gpgsm-defs.scm: Likewise. * tests/gpgsm/import.scm: Likewise. * tests/gpgsm/plain-1.cms.asc: Likewise. * tests/gpgsm/plain-2.cms.asc: Likewise. * tests/gpgsm/plain-3.cms.asc: Likewise. * tests/gpgsm/plain-large.cms.asc: Likewise. * tests/gpgsm/run-tests.scm: Likewise. * tests/gpgsm/setup.scm: Likewise. * tests/gpgsm/shell.scm: Likewise. * tests/gpgsm/sign.scm: Likewise. * tests/gpgsm/verify.scm: Likewise. -- The certificates and keys are taken from GPGME's test suite. Signed-off-by: Justus Winter <[email protected]>
* tests: Add macro managing ephemeral home directories.Justus Winter2016-12-202-2/+12
| | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): New macro. * tests/openpgp/setup.scm: Use the new macro.
* tests: Move argument parser.Justus Winter2016-12-202-25/+25
| | | | | | | * tests/gpgme/gpgme-defs.scm (flag): Move... * tests/gpgscm/tests.scm: ... over here. Signed-off-by: Justus Winter <[email protected]>
* tests: Add missing encrypted sample, cleanup samples handling.Justus Winter2016-12-203-5/+1340
| | | | | | | | | | | * tests/openpgp/Makefile.am (TEST_FILES): Add new file. * tests/openpgp/defs.scm (plain-files): Add 'plain-large'. (all-files): New variable. (create-sample-files): New function. (create-legacy-gpghome): Use new function. * tests/openpgp/plain-large.asc: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: Use the common test framework for the migration tests.Justus Winter2016-12-194-16/+73
| | | | | | | | | | | | | | * tests/migrations/Makefile.am (reqired_pgms): Add 'gpgscm'. (TESTS_ENVIRONMENT): Populate. (TESTS): Rename to 'XTESTS'. (xcheck): New target. (EXTRA_DIST): Add new files. (CLEANFILES): Remove log files. * tests/migrations/common.scm: Honor 'verbose', fix paths. * tests/migrations/run-tests.scm: New file. * tests/migrations/setup.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Use sequential test runner if only one test is given.Justus Winter2016-12-191-3/+4
| | | | | | | | | | | | * tests/openpgp/run-tests.scm: Use sequential test runner if only one test is given. -- This allows one to set the environment variable TESTFLAGS to '--parallel' and enjoy faster test execution times without interfering with stdio when one works on a single test. Signed-off-by: Justus Winter <[email protected]>
* test: Extend TOFU tests to also check the days with signatures.Neal H. Walfield2016-12-191-15/+71
| | | | | | | | | | | * tests/openpgp/tofu.scm (GPGTIME): Define the "standard" base time. (faketime): New function. (days->seconds): Likewise. (GPG): Use faketime. (check-counts): Also check the number of expected days with signatures and encryptions. Update callers. Extend tests. Signed-off-by: Neal H. Walfield <[email protected]>
* tests: New test for --delete-[secret-]keys.Justus Winter2016-12-194-7/+153
| | | | | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/defs.scm (keys): New variable. (have-public-key?): New function. (have-secret-key?): Likewise. (have-secret-key-file?): Likewise. * tests/openpgp/delete-keys.scm: New file. * tests/openpgp/quick-key-manipulation.scm: Move the accessors to 'defs.scm'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Change associativity of ::.Justus Winter2016-12-191-3/+12
| | | | | | | | * tests/gpgscm/scheme.c (mk_atom): Change associativity of the :: infix-operator. This makes it possible to naturally express accessing nested structures (e.g. a::b::c). Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Display location when assertions fail.Justus Winter2016-12-191-6/+9
| | | | | | | * tests/gpgscm/lib.scm (assert): Use location information if available. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make exception handling more robust.Justus Winter2016-12-191-1/+2
| | | | | | * tests/gpgscm/init.scm (throw'): Check that args is a list. Signed-off-by: Justus Winter <[email protected]>
* g10: Rework the --quick-* interface.Justus Winter2016-12-151-4/+4
| | | | | | | | | | | | * g10/gpg.c (opts): Rename options. (main): Update errors. * doc/gpg.texi: Update accordingly. -- I decided not to keep the old versions as aliases in the documentation because the interface is a fairly recent addition. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* build: Fix distcheck.Justus Winter2016-12-151-0/+2
| | | | | | * tests/gpgme/Makefile.am (CLEANFILES): New variable, clean test logs. Signed-off-by: Justus Winter <[email protected]>
* tests: Reuse GPGME's tests.Justus Winter2016-12-146-1/+390
| | | | | | | | | | | | * configure.ac (AC_CONFIG_FILES): Add new Makefile. * tests/Makefile.am (SUBDIRS): Add new directory. * tests/gpgme/Makefile.am: New file. * tests/gpgme/gpgme-defs.scm: Likewise. * tests/gpgme/run-tests.scm: Likewise. * tests/gpgme/setup.scm: Likewise. * tests/gpgme/wrap.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: Support locating components in the build tree.Justus Winter2016-12-141-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | * common/homedir.c (gnupg_build_directory): New variable. (gnupg_module_name_called): Likewise. (gnupg_set_builddir): New function. (gnupg_set_builddir_from_env): Likewise. (gnupg_module_name): Support locating components in the build tree. * common/util.h (gnupg_set_builddir): New prototype. * tests/openpgp/defs.scm (tools): Drop 'gpg and 'gpg-agent. (tool): Rename to 'tool-hardcoded. (gpg-conf): New function, with accessors for the results. (gpg-components): New variable. (tool): New function. * tools/gpgconf.c (enum cmd_and_opt_values): New key. (opts): New option '--build-prefix'. (main): Handle new option. -- This change makes sure that the components from the build tree are used, and not some older installed version in PATH. It also lets us make GPGME use components from the build tree, making it possible to execute GPGME's test suite with them. Signed-off-by: Justus Winter <[email protected]>
* tests: Rework check for trust models.Justus Winter2016-12-141-2/+7
| | | | | | | | * tests/openpgp/defs.scm (gpg-has-option?): New function. (have-opt-always-trust): Use a simpler test for that option. This way that is less distracting when we run the tests with verbose=3. Signed-off-by: Justus Winter <[email protected]>
* g10,sm: Spell out --gen-key.Justus Winter2016-12-131-1/+1
| | | | | | | | | * g10/gpg.c (opts): Spell out option. * sm/gpgsm.c (opts): Likewise. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Hyphenate --clearsign.Justus Winter2016-12-131-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]>
* g10: Create expiring keys in quick key generation mode.Justus Winter2016-12-131-17/+14
| | | | | | | | | * doc/gpg.texi: Document that fact. * g10/keygen.c (quick_generate_keypair): Use a default value. * tests/openpgp/quick-key-manipulation.scm: Test that fact. GnuPG-bug-id: 2701 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Print failed and skipped tests.Justus Winter2016-12-131-5/+13
| | | | | | | * tests/gpgscm/tests.scm (test-pool::report): Print failed and skipped tests at the end. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Generalize the test runner.Justus Winter2016-12-132-9/+11
| | | | | | | | * tests/gpgscm/tests.scm (test::scm) Add explicit name argument. (test::binary): Likewise. Also, add missing unquote. * tests/openpgp/run-tests.scm: Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Move the test runner to the Scheme library.Justus Winter2016-12-132-141/+151
| | | | | | | * tests/openpgp/run-tests.scm: Move most of the code... * tests/gpgscm/tests.scm: ... here. Signed-off-by: Justus Winter <[email protected]>
* tests: Refactor test runner.Justus Winter2016-12-131-17/+28
| | | | | | | | * tests/openpgp/run-tests.scm (locate-test): New function. (test): Factor-out the code starting the child process. (test::binary): New function. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve library functions.Justus Winter2016-12-132-34/+88
| | | | | | | | | | | | | * tests/gpgscm/tests.scm (absolute-path?): New function. (canonical-path): Use the new function. * tests/gpgscm/lib.scm (string-split-pln): New function. (string-indexp, string-splitp): Likewise. (string-splitn): Express using the above function. (string-ltrim, string-rtrim): Fix corner case. (list->string-reversed): New function. (read-line): Fix performance. Signed-off-by: Justus Winter <[email protected]>
* tests: Add a test for '--quick-addkey'.Justus Winter2016-12-091-0/+65
| | | | | | * tests/openpgp/quick-key-manipulation.scm: Test '--quick-addkey'. Signed-off-by: Justus Winter <[email protected]>
* tests: New test using all available compression algorithms.Justus Winter2016-12-093-0/+38
| | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/compression.scm: New file. * tests/openpgp/defs.scm (all-compression-algos): New variable. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Better error reporting.Justus Winter2016-12-086-62/+122
| | | | | | | | | | | | | | | | | | | | * tests/gpgscm/ffi.scm: Move the customized exception handling and atexit logic... * tests/gpgscm/init.scm: ... here. (throw): Record the current history. (throw'): New function that is history-aware. (rethrow): New function. (*error-hook*): Use the new throw'. * tests/gpgscm/main.c (load): Fix error handling. (main): Save and use the 'sc->retcode' as exit code. * tests/gpgscm/repl.scm (repl): Print call history. * tests/gpgscm/scheme.c (_Error_1): Make a snapshot of the history, use it to provide a accurate location of the expression causing the error at runtime, and hand the history trace to the '*error-hook*'. (opexe_5): Tag all lists at parse time with the current location. * tests/gpgscm/tests.scm: Update calls to 'throw', use 'rethrow'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Keep a history of calls for error messages.Justus Winter2016-12-085-4/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/init.scm (vm-history-print): New function. * tests/gpgscm/opdefines.h: New opcodes 'CALLSTACK_POP', 'APPLY_CODE', and 'VM_HISTORY'. * tests/gpgscm/scheme-private.h (struct history): New definition. (struct scheme): New field 'history'. * tests/gpgscm/scheme.c (gc): Mark objects in the history. (history_free): New function. (history_init): Likewise. (history_mark): Likewise. (add_mod): New macro. (sub_mod): Likewise. (tailstack_clear): New function. (callstack_pop): Likewise. (callstack_push): Likewise. (tailstack_push): Likewise. (tailstack_flatten): Likewise. (callstack_flatten): Likewise. (history_flatten): Likewise. (opexe_0): New variable 'callsite', keep track of the expression if it is a call, implement the new opcodes, record function applications in the history. (opexe_6): Implement new opcode. (scheme_init_custom_alloc): Initialize history. (scheme_deinit): Free history. * tests/gpgscm/scheme.h (USE_HISTORY): New macro. -- This patch makes TinySCHEME keep a history of function calls. This history can be used to produce helpful error messages. The history data structure is inspired by MIT/GNU Scheme. Signed-off-by: Justus Winter <[email protected]> fu history
* gpgscm: Add flag TAIL_CONTEXT.Justus Winter2016-12-081-8/+44
| | | | | | | | | | | * tests/gpgscm/scheme.c (S_FLAG_TAIL_CONTEXT): New macro. This flag indicates that the interpreter is evaluating an expression in a tail context (see R5RS, section 3.5). (opexe_0): Clear and set the flag according to the rules layed out in R5RS, section 3.5. (opexe_1): Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add flags to the interpreter.Justus Winter2016-12-082-5/+44
| | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): Add field 'flags'. * tests/gpgscm/scheme.c (S_OP_MASK): New macro. (S_FLAG_MASK, s_set_flag, s_clear_flag, s_get_flag): Likewise. (_s_return): Unpack the encoded opcode and flags. (s_save): Encode the flags along with the opcode. Use normal integers to encode the result. (scheme_init_custom_alloc): Initialize 'op' and 'flags'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Implement tags.Justus Winter2016-12-083-0/+91
| | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/opdefines.h: Add opcodes to create and retrieve tags. * tests/gpgscm/scheme.c (T_TAGGED): New macro. (mk_tagged_value): New function. (has_tag): Likewise. (get_tag): Likewise. (mark): Mark tag. (opexe_4): Implement new opcodes. * tests/gpgscm/scheme.h (USE_TAGS): New macro. -- Tags are similar to property lists, but property lists can only be attached to symbols. Tags can not be attached to an existing object, but a tagged copy can be created. Once done, the tag can be manipulated in constant time. Using this during parsing will enable us to produce meaningful error messages. Signed-off-by: Justus Winter <[email protected]>