aboutsummaryrefslogtreecommitdiffstats
path: root/tests/openpgp/defs.scm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* indent: Fix spellingDaniel Kahn Gillmor2024-05-311-1/+1
| | | | | | | | | | | | | -- These are non-substantive corrections for minor spelling mistakes within the GnuPG codebase. With something like this applied to the codebase, and a judiciously tuned spellchecker integrated as part of a standard test suite, it should be possible to keep a uniform orthography within the project. GnuPG-bug-id: 7116
* common,agent,gpg,dirmngr,g13,scd,tests,tools: New spawn function.NIIBE Yutaka2023-05-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (do_exec, gnupg_spawn_process): Remove. (check_syscall_func, pre_syscall, post_syscall) : New. (do_create_socketpair, posix_open_null, call_spawn_cb): New. (my_exec, spawn_detached, gnupg_spawn_helper): New. (gnupg_process_spawn, process_kill, gnupg_process_terminate): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_release): New. (gnupg_process_wait_list): New. * common/exechelp-w32.c: Add definition of _WIN32_WINNT as 0x600. (check_syscall_func, pre_syscall, post_syscall): New. (gnupg_spawn_process): Remove. (check_windows_version): New. (spawn_detached, gnupg_spawn_helper, gnupg_process_spawn): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_kill, process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_terminate): New. (gnupg_process_release, gnupg_process_wait_list): New. * common/exechelp.h: Re-write for new API. * common/exectool.c (gnupg_exec_tool_stream): Follow the change. * common/asshelp.c (start_new_service): Likewise. * agent/genkey.c (do_check_passphrase_pattern): Likewise. * dirmngr/ldap-wrapper.c (struct wrapper_context_s): Use PROC. (destroy_wrapper): Follow the change of API. (read_log_data): Follow the change of API, use printable_pid. (ldap_reaper_thread, ldap_wrapper_release_context): Likewise. (ldap_wrapper_connection_cleanup, ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Follow the change of API. (show_photo): Likewise. * g13/be-encfs.c (run_umount_helper): Likewise. (run_encfs_tool): Likewise. * g13/g13.c: Add including ./common/exechelp.h. * g13/mount.c: Likewise. * g13/runner.c: Follow the change of API. * g13/runner.h: Follow the change of API. * scd/app.c (setup_env): New. (report_change): Follow the change of API. * tests/gpgscm/ffi.c (proc_object_finalize): New. (proc_object_to_string): New. (proc_wrap, proc_unwrap): New. (do_spawn_process): Remove. (do_process_spawn): New. (setup_std_fds): New. (do_spawn_process_fd): Remove. (do_process_spawn_fd): New. (do_wait_process): Remove. (do_process_wait): New. (do_wait_processes): Remove. * tests/gpgscm/t-child.scm: Follow the change of API. * tests/gpgscm/tests.scm: Likewise. * tests/openpgp/defs.scm: Likewise. * tests/tpm2dtests/defs.scm: Likewise. * tools/gpg-card.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgconf.c: Likewise. * tools/gpgtar-create.c: Likewise. * tools/gpgtar-extract.c: Likewise. * tools/gpgtar-list.c: Likewise. -- GnuPG-bug-id: 6275 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Put a workaround for semihosted environment.NIIBE Yutaka2022-12-011-0/+3
| | | | | | | | | | | | * tests/openpgp/defs.scm [*win32*]: Use --build-prefix option. -- On the semihosted environment, output of simple gpgconf --list-components includes drive name (like Z:), which results failure of command invocation. This is a workaround. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Add tests to check that OCB is only used for capable keys.Werner Koch2022-11-041-0/+10
| | | | | | | | | * tests/openpgp/samplekeys/ed25519-cv25519-sample-2.asc: New. * tests/openpgp/samplekeys/ed25519-cv25519-sample-1.asc: Add AEAD preference. * tests/openpgp/defs.scm (tr:gpgstatus): New. (create-legacy-gpghome): Also import .key private keys. * tests/openpgp/encrypt.scm: Add OCB tests.
* tests: New way to make use of gpgconf.ctl in tests.Werner Koch2021-10-121-10/+9
| | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (all-local): New to setup symlinks. (distclean-local): New. * tests/Makefile.am: Remove the gpgconf related targets. Just keep gpgconf.ctl.in in EXTRA_DIST * tests/cms/Makefile.am (GNUPG_BUILD_ROOT): * tests/gpgme/Makefile.am (GPGSCM_PATH): * tests/openpgp/Makefile.am (GNUPG_BUILD_ROOT): * tests/pkits/Makefile.am (GNUPG_BUILD_ROOT): * tests/tpm2dtests/defs.scm (tools): Revert to the former values. * tests/openpgp/defs.scm (tools): Ditto. -- This Fixes-commit: 399ebf6d873d4178c1d527aa4df34bf16a76360e Fixes-commit: 84fcd8e6eb7e0786399e1f6461c3f60b0db2d070 because we ran into problems with the idea of first doing a test-install for the checks. "make distcheck" turned out to be too problematic. Symlinks are a better way of doing this. Also fixes GnuPG-bug-id: 5634
* tests: Use the new gpgconf.ctl based method.Werner Koch2021-10-011-19/+15
| | | | | | | | | | | | | * tests/openpgp/defs.scm: We expect that stuff is now installed. (tools): Fix the names. (intsalled?, bin-prefix): Remove. (tool-hardcoded): Simplify. (gpg-conf'): Simplify. (GNUPG_BUILDDIR): Do not anymore set this envvar. * tests/tpm2dtests/defs.scm: Ditto. -- This simplifies things a bit.
* tests: Make sure that the build keyboxd is used.Werner Koch2021-04-221-0/+1
| | | | | | | * tests/openpgp/defs.scm (create-gpghome): Add keyboxd-program. -- GnuPG-bug-id: 5406
* gpg,gpgsm: Move use-keyboxd to the new conf file common.confWerner Koch2021-04-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/comopt.c, common/comopt.h: New. * common/Makefile.am: Add them. * g10/gpg.c: Include comopt.h. (main): Also parse common.conf. * sm/gpgsm.c: Include comopt.h. (main): Set a flag for the --no-logfile option. Parse common.conf. * tools/gpgconf-comp.c (known_options_gpg): Remove "use-keyboxd", add pseudo option "use_keyboxd". (known_pseudo_options_gpg): Add pseudo option "use_keyboxd". (known_options_gpgsm): Remove "use-keyboxd". * tests/openpgp/defs.scm (create-gpghome): Create common.conf. * doc/examples/common.conf: New. -- Note that --use-keybox still works but prints a warning. We will eventually remove this option becuase it was marked as an experimental feature anyway. It would be too confusing if gpg and gpgsm use different key storages. Further, other components (e.g. dirmngr or gpg-wks-client) which call gpg or gpgsm need to be aware that the keyboxd is used and pass that option on the command line. Now that common.conf is always read (even if --no-options is used) those tools will work instantly.
* tests: Make sure the built keyboxd is used by the tests.Werner Koch2021-03-261-1/+1
| | | | | | | * tests/openpgp/defs.scm (tool): Add keyboxd. * tests/openpgp/setup.scm: Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not allow old cipher algorithms for encryption.Werner Koch2021-02-101-0/+1
| | | | | | | | | | | | | | | | | | | * g10/gpg.c: New option --allow-old-cipher-algos. (set_compliance_option): Set --rfc4880bis explictly to SHA256 and AES256. Allow old cipher algos for OpenPGP, rfc4880, and rfc2440. * g10/options.h (opt): Add flags.allow_old_cipher_algos. * g10/misc.c (print_sha1_keysig_rejected_note): Always print the note unless in --quiet mode. * g10/encrypt.c (setup_symkey): Disallow by default algos with a blocklengt < 128. (encrypt_crypt): Ditto. Fallback by default to AES instead of 3DES. * g10/pkclist.c (algo_available): Take care of old cipher also. (select_algo_from_prefs): Use AES as implicit algorithm by default. * tests/openpgp/defs.scm (create-gpghome): Set allow-old-cipher-algos. -- GnuPG-bug-id: 3415
* tests: Integrate --use-keyboxd into the OpenPGP test suite.Werner Koch2020-09-241-2/+12
| | | | | | | | | | | * tests/openpgp/all-tests.scm (all-tests): Replace extended-key-format mode with a new keyboxd mode. * tests/openpgp/defs.scm (create-gpghome): Ditto. * tests/openpgp/gpgv.scm: Adjust for keyboxd mode. * tests/openpgp/issue2419.scm: Fix to allow setting a log-file into gpg.conf for debugging. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix convenience function to run gpg.Werner Koch2020-09-241-1/+1
| | | | | | | | | | | | | | * tests/openpgp/defs.scm (pipe:gpg): Remove stray dash. -- The extra dash is problematic at export and import because this does not export a single key as intended by the tests but does two key lookups where the second fails because that userid is always "-". For the current keyring and keybox code this does not matter because it is ignored. The keyboxd code however is more picky and returns an error. Fixes-commit: 9609cb20e4caee739b9fc4fd36797029d2970041 Signed-off-by: Werner Koch <[email protected]>
* tests: New test run envvar to run gpg under valgrind.Werner Koch2020-09-041-1/+11
| | | | | | | | | -- Take care: Running under valgrind takes loooong and in some case you may run into an valgrind internal error. Signed-off-by: Werner Koch <[email protected]>
* tests: Add "disable-scdaemon" in gpg-agent.conf.NIIBE Yutaka2019-02-211-4/+1
| | | | | | | | | | | | | | | | | * tests/openpgp/defs.scm: Add "disable-scdaemon". Remove "scdaemon-program". * tests/gpgme/gpgme-defs.scm, tests/gpgsm/gpgsm-defs.scm: Likewise. * tests/inittests, tests/pkits/inittests: Add "disable-scdaemon" -- Before this change, running "make check" accesses USB device by scdaemon on host computer. If there is any smartcard/token available, it may affect test results. Because default key choice depends on smartcard/token availability now and existing tests have nothing about testing smartcard/token, disabling scdaemon is good. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Hard fail on a missing MDC even for legacy algorithms.Werner Koch2018-05-151-0/+1
| | | | | | | | * g10/mainproc.c (proc_encrypted): Require an MDC or AEAD * tests/openpgp/defs.scm (create-gpghome): Use --ignore-mdc-error to allow testing with the current files. Signed-off-by: Werner Koch <[email protected]>
* Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-04-101-5/+9
|\ | | | | | | | | | | | | | | | | -- Fixed conflicts: NEWS - keep master configure.ac - merge g10/card-util.c - mostly 2.2 g10/sig-check.c - 2.2
| * tests: Fix no gpg-agent upon removal of GNUPGHOME.NIIBE Yutaka2018-04-041-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/gnupg.scm (with-ephemeral-home-directory): Add teadown-fn. * tests/gpgsm/export.scm: Use -no-atexit version and stop-agent. * tests/openpgp/decrypt-session-key.scm: Likewise. * tests/openpgp/decrypt-unwrap-verify.scm: Likewise. * tests/openpgp/defs.scm (have-opt-always-trust): Likewise. (setup-environment-no-atexit): New. (start-agent): Support no use of atexit. * tests/gpgsm/gpgsm-defs.scm (setup-gpgsm-environment-no-atexit): New. * tests/migrations/common.scm (untar-armored): Follow the change of with-ephemeral-home-directory. -- When gpg-agent detects homedir removal, it will automatically exit. Then, call of 'gpgconf --kill all' will fail. So, stop-agent should be called before the removal of homedir. Signed-off-by: NIIBE Yutaka <[email protected]>
| * agent, tests: Support --disable-scdaemon build case.NIIBE Yutaka2017-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/command.c (cmd_scd): Support !BUILD_WITH_SCDAEMON. * tests/openpgp/defs.scm (create-gpghome): Likewise. * tests/gpgsm/gpgsm-defs.scm (create-gpgsmhome): Likewise. -- We could modify gpg-agent to remove all support of scdaemon, with no inclusion of call-scd.c, divert-scd.c, and learncard.c, but it would not be worth to do that. GnuPG-bug-id: 3316 Signed-off-by: NIIBE Yutaka <[email protected]>
* | tests: Minor imporvement in agent invocationWerner Koch2017-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/openpgp/defs.scm (create-gpghome): Add s2k-count. -- My tests show only 2.5% improvement, but as we have that option now let's use it. real 9m12.604s user 2m20.720s sys 0m11.452s real 8m3.815s user 2m16.700s sys 0m11.544s Signed-off-by: Werner Koch <[email protected]>
* | agent, tests: Support --disable-scdaemon build case.NIIBE Yutaka2017-10-261-1/+3
|/ | | | | | | | | | | | | | | * agent/command.c (cmd_scd): Support !BUILD_WITH_SCDAEMON. * tests/openpgp/defs.scm (create-gpghome): Likewise. * tests/gpgsm/gpgsm-defs.scm (create-gpgsmhome): Likewise. -- We could modify gpg-agent to remove all support of scdaemon, with no inclusion of call-scd.c, divert-scd.c, and learncard.c, but it would not be worth to do that. GnuPG-bug-id: 3316 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Move some functions into a common module.Damien Goutte-Gattat2017-08-211-0/+24
| | | | | | | | | | | | | | * tests/openpgp/tofu.scm (gettrust): Moved to the common defs.scm module. (checktrust): Likewise. * tests/openpgp/defs.scm (gettrust): New function. (checktrust): Likewise. -- These functions will be re-used by the tests for the PGP trust model. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* tests: Adjust tests for changed --auto-key-locate default.Werner Koch2017-08-041-0/+2
| | | | | | * tests/openpgp/defs.scm (create-gpghome): Disable new defaults. Signed-off-by: Werner Koch <[email protected]>
* tests: Improve 'shell.scm' script.Justus Winter2017-07-141-0/+1
| | | | | | | | | * tests/openpgp/defs.scm (create-file): Unlink file first. * tests/openpgp/shell.scm: Ask whether to import legacy test keys or not, and whether to drop 'batch' from the configuration. Add paths to all the programs to 'PATH'. Signed-off-by: Justus Winter <[email protected]>
* tests: Run the OpenPGP tests using the new extended key format.Justus Winter2017-06-191-0/+2
| | | | | | | | | * tests/openpgp/all-tests.scm: Generalize a bit, and also add a variant that uses the new extended key format. * tests/openpgp/defs.scm (create-gpghome): Conditionally enable the new extended key format. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix agent teardown in release builds.Justus Winter2017-05-171-3/+3
| | | | | | | | | | * tests/openpgp/defs.scm (start-agent,stop-agent): Use gpg-conf which will properly use the '--build-prefix' argument to make gpgconf use tools from the build directory. GnuPG-bug-id: 3165 Fixes-commit: 2c9d9ac55ea455a5ec26428989dced0311ed46cc Signed-off-by: Justus Winter <[email protected]>
* tests: Configure the environments to use scdaemon from build tree.Justus Winter2017-05-161-0/+1
| | | | | | | | | | | | | | | | | * tests/gpgme/gpgme-defs.scm: Use the scdaemon from the build tree when writing a 'gpg-agent.conf'. * tests/gpgsm/gpgsm-defs.scm: Likewise. * tests/openpgp/defs.scm: Likewise. -- As of 97a2394ecafaa6f58e4a1f70ecfd04408dc15606 gpg may query the scdaemon for a signing key to use. To make sure that the agent calls the right scdaemon, we provide the path explicitly in the 'gpg-agent.conf' that is used in the tests, similar to what we do for the agent itself and the pinentry. GnuPG-bug-id: 3165 Signed-off-by: Justus Winter <[email protected]>
* tests: Also run all OpenPGP tests using keyrings.Justus Winter2017-05-111-0/+4
| | | | | | | | | | | | | | | | | * tests/openpgp/all-tests.scm: Run each test twice, once with public keys stored in a keybox, once with a keyring. * tests/openpgp/defs.scm (create-gpghome): Create a public keyring to make GnuPG use that instead of creating a keybox if '--use-keyring' is given. * tests/openpgp/setup.scm: Fix flag handling and usage. -- This parametrizes the OpenPGP tests. With this change, the test suite is able to detect problems with the keyring store, e.g. like the one fixed in 22739433e98be80e46fe7d01d52a9627c1aebaae. GnuPG-bug-id: 3080 Signed-off-by: Justus Winter <[email protected]>
* tests: Add function to dump packets.Justus Winter2017-05-041-0/+6
| | | | | | * tests/openpgp/defs.scm (gpg-dump-packets): New function. Signed-off-by: Justus Winter <[email protected]>
* tests: Deduplicate and simplify code.Justus Winter2017-04-241-15/+24
| | | | | | | | | | | * tests/gpgme/gpgme-defs.scm (create-file): Move... * tests/gpgsm/gpgsm-defs.scm (create-file): ... likewise... * tests/openpgp/defs.scm (create-file): Here. (create-gpghome): Use 'create-file'. * tests/openpgp/gpg-agent.conf.tmpl: Delete file. * tests/openpgp/gpg.conf.tmpl: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Locate resources and scripts relative to top source dir.Justus Winter2017-04-241-5/+5
| | | | | | | | | | | | -- Locate every resource and every script used in the tests using a path relative to the top of the source tree. This is a purely mechanical change, mostly done using regular expressions, with a few manual fixups here and there. Signed-off-by: Justus Winter <[email protected]>
* tests: Make tests more robust.Justus Winter2017-04-111-1/+2
| | | | | | | | | * tests/openpgp/defs.scm (have-opt-always-trust): Execute in empty ephemeral home directory. This prevents gpg from picking up the configuration from the current gnupghome (if any). * tests/migrations/common.scm (untar-armored): Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Move common functionality.Justus Winter2017-04-111-26/+0
| | | | | | | | | * tests/openpgp/defs.scm (with-home-directory, with-ephemeral-home-directory): Move... * tests/gpgscm/gnupg.scm: ... to this new file. * tests/gpgscm/main.c (main): Load the new file. Signed-off-by: Justus Winter <[email protected]>
* tests: Make test more robust.Justus Winter2017-04-061-0/+2
| | | | | | | | * tests/openpgp/4gb-packet.scm: Skip if we do not have BZIP2. * tests/openpgp/defs.scm (have-compression-algo?): New function. GnuPG-bug-id: 3028 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix setup of ephemeral home directories.Justus Winter2017-04-051-2/+2
| | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Set GNUPGHOME and cwd to the ephemeral directory before calling the setup function. GnuPG-bug-id: 3047 Fixes-commit: 32b75fb7743f35936d7014fce33c90ba97dfa374 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix setup of ephemeral home directories.Justus Winter2017-04-041-4/+8
| | | | | | | | | | | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Create configuration files when we enter the context. * tests/openpgp/setup.scm: Do not use an ephemeral home directory. Tests should always use the cwd. * tests/gpgsm/setup.scm: Likewise. * tests/gpgsm/export.scm: Add explicit constructor function. * tests/openpgp/decrypt-session-key.scm: Likewise. * tests/openpgp/decrypt-unwrap-verify.scm: Likewise. -- Previously, ephemeral homedirectories lacked a configuration, hence GnuPG tried to start backend daemons using their installed locations. Fix this by explicitly creating a suitable configuration. GnuPG-bug-id: 3047 Signed-off-by: Justus Winter <[email protected]>
* tests: Use gpgconf to stop the agent.Werner Koch2017-03-231-4/+6
| | | | | | | | | | | | | * tests/openpgp/defs.scm (stop-agent): Swap order of actions. Kill all daemons using gpgconf. * tools/gpgconf.c (main) <aRemoveSocketDir>: Try to remove known socketfails on rmdir failure. Do no fail for ENONET. -- Killing all daemons is not really required but it does not harm to be prepared for the future. Signed-off-by: Werner Koch <[email protected]>
* tests: Create temporary directories in '/tmp'.Justus Winter2017-03-211-1/+1
| | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (mkdtemp): Create temporary directories in '/tmp' on UNIX, or in '%Temp' on Windows. * tests/migrations/common.scm (run-test): Turn error into a warning. * tests/openpgp/defs.scm (start-agent): Likewise. -- This fixes the problem of GnuPG components being unable to communicate because of too long GnuPG home directories in important build environments like the Debian build servers despite the use of socket directories. This reverts d75d20909d9f60d33ffd210def92278c0f383aad. Signed-off-by: Justus Winter <[email protected]>
* tests: Fail if we cannot create the socket directory.Justus Winter2017-03-201-1/+1
| | | | | | | | | | | | * tests/migrations/common.scm (run-test): Turn warning into an error. * tests/openpgp/defs.scm (start-agent): Likewise. -- We use separate directories to create the sockets in so that the absolute path to the every socket fits into sun_path. Fixes-commit: 7e19786a5ddef637d1d9d21593fecf5a36b6f372 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix using tools from the build directory.Justus Winter2017-03-151-8/+8
| | | | | | | | | | | | | | | | * tests/openpgp/defs.scm (gpg-conf'): Explicitly pass the build prefix to gpgconf here... (gpg-components): ... instead of only here. -- Previously, gpgconf was not invoked with '--build-prefix' when changing the configuration. This made tests using this facility fail (e.g. the TOFU test). This only affected release builds, because in development builds gpgconf picks up the build prefix from the environment. GnuPG-bug-id: 2979 Signed-off-by: Justus Winter <[email protected]>
* tests: Harmonize temporary and socket directory handling.Justus Winter2017-03-061-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (mkdtemp): Do not magically obey the environment variable 'TMP', make sure to always return an absolute path. * tests/gpgme/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/gpgme/gpgme-defs.scm (create-gpgmehome): Start the agent. Do not create private key store, the agent does that for us. * tests/gpgsm/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/gpgme/gpgme-defs.scm (create-gpgsmhome): Start the agent. Do not create private key store, the agent does that for us. * tests/migrations/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/migrations/common.scm (gpgconf): New variable. (run-test): Create and remove socket directory. * tests/migrations/extended-pkf.scm (src-tarball): Remove variable. (setup): Remove function. (trigger-migration): Likewise. Use 'run-test' to execute the test. * tests/migrations/from-classic.scm (src-tarball): Remove variable. (setup): Remove function. Use 'run-test' to execute the tests. * tests/openpgp/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/openpgp/README: Do not mention 'TMP'. * tests/openpgp/defs.scm (with-home-directory): New macro. (create-legacy-gpghome): Do not create private key store, the agent does that for us. (start-agent): Make sure to terminate the right agent with 'atexit'. -- Previously, the test suite relied upon creating home directories in '/tmp'. This has been problematic in some build environments, although POSIX mandates that '/tmp' must be available. We now rely on 'gpgconf --create-socketdir' to create a suitable socket directory for us. This allows us to get rid of some cruft. It also aligns the environment the tests are run in closer with the environment that we intend that GnuPG runs in. Signed-off-by: Justus Winter <[email protected]>
* tests: Improve support for gpgconf.Justus Winter2017-02-281-3/+22
| | | | | | | | * tests/openpgp/defs.scm: Improve high-level inteface to gpgconf. * tests/openpgp/gpgconf.scm: Adapt. * tests/openpgp/tofu.scm: Use it to select the trust model. Signed-off-by: Justus Winter <[email protected]>
* Clean up word replication.Yuri Chornoivan2017-02-211-1/+1
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tests: Improve GPGHOME handling.Justus Winter2017-01-161-0/+1
| | | | | | | | * 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-101-1/+10
| | | | | | | | * 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-101-2/+31
| | | | | | | | | | * 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: Fix macro.Justus Winter2017-01-051-8/+10
| | | | | | | | | | * 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: Add macro managing ephemeral home directories.Justus Winter2016-12-201-0/+11
| | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): New macro. * tests/openpgp/setup.scm: Use the new macro.
* tests: Add missing encrypted sample, cleanup samples handling.Justus Winter2016-12-201-4/+7
| | | | | | | | | | | * 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: New test for --delete-[secret-]keys.Justus Winter2016-12-191-0/+49
| | | | | | | | | | | | | * 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]>