aboutsummaryrefslogtreecommitdiffstats
path: root/tests/migrations (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix to support --enable-all-tests and variants.NIIBE Yutaka2022-11-242-0/+2
| | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (test::scm): Add VARIANT argument. (tests::new): Likewise. (open-log-file, report): Support VARIANT. * tests/gpgme/all-tests.scm (setup-c, setup-py): Follow the change. * tests/cms/all-tests.scm: Likewise. * tests/cms/run-tests.scm: Likewise. * tests/migrations/all-tests.scm: Likewise. * tests/migrations/run-tests.scm: Likewise. * tests/openpgp/all-tests.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. -- Forward port from 2.2 branch of: 0fd7a902070ad9bdd835fa57dbadff25917bca42 Fixes-commit: 1c88104a3f00f7ca3790fbaab8f67b2b68cd6e18 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests:w32: Fix for non-dot file name for Windows.NIIBE Yutaka2022-11-241-1/+1
| | | | | | | | | | | | * tests/migrations/from-classic.scm (assert-migrated): Handle the case on Windows. -- Forward port from 2.2 branch of: 754175a46d3bc34e9ef8098dbd05abdfd61ada64 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Restrict the use of gpgconf.ctl to make check.Werner Koch2022-09-141-0/+1
| | | | | | | | | | | | | | | | | | | * common/homedir.c (unix_rootdir): Add ".enable" statement to gpgconf.ctl * tests/gpgconf.ctl.in: Use this statement. * tests/cms/Makefile.am (OLD_TESTS_ENVIRONMENT): Enable .enable. (TESTS_ENVIRONMENT): Ditto. * tests/gpgme/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/migrations/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Ditto. -- Without that it was required to delete the gpgconf.ctl to run manual tests. What a hack.
* w32: Fix for make check.NIIBE Yutaka2022-04-061-1/+1
| | | | | | | | | | | | | | * common/Makefile.am (module_tests): Exclude t-exechelp and t-exectool. * common/t-stringhelp.c (mygetcwd): Convert '\' to '/'. * tests/cms/Makefile.am: Add $(EXEEXT). * tests/gpgme/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Prepare for using installed versions for tests.Werner Koch2021-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * tests/gpgconf.ctl.in: New. * tests/Makefile.am (EXTRA_DIST): Add new file. (TESTINST_DIRS): New. (clean-local): New. (clean-local-testinst): New. (check-recursive): New hook. (bin/gpgconf.ctl): Run a test install. * tests/cms/Makefile.am (TESTS_ENVIRONMENT): Set new envvar GNUPG_BUILD_ROOT. * tests/gpgme/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Ditto. -- Right now this helps only with the global configuraion dir which is now not set and thus the build host'ss own /etc/gnupg does not anymore affect the build. Signed-off-by: Werner Koch <[email protected]>
* tests: Improve handling of spaces in $PATHWerner Koch2020-10-041-4/+4
| | | | | | | -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b2590f2e47fe8ab7352a9e3769b195ff9f398dd7)
* tests: Fix no gpg-agent upon removal of GNUPGHOME.NIIBE Yutaka2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | * 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]>
* tests: Make it possible to run all tests using our infrastructure.Justus Winter2017-05-113-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (TESTS_ENVIRONMENT): New variable. (check-all): New phony target to run all tests. * tests/gpgme/gpgme-defs.scm (have-gpgme?): New function that tests whether the GPGME test suite is available instead of exiting the process. * tests/gpgscm/init.scm (export): New macro. * tests/gpgscm/tests.scm (run-tests): New function. (load-tests): Likewise. * tests/gpgme/run-tests.scm: Simplify and move the parsing of the list of tests to 'all-tests.scm'. * tests/gpgsm/run-tests.scm: Likewise. * tests/migrations/run-tests.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. * tests/gpgme/Makefile.am: To select the tests to run, use the variable 'TESTS'. This harmonizes the interface with the automake test suite. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. * tests/openpgp/README: Likewise. * agent/all-tests.scm: New file. * common/all-tests.scm: Likewise. * g10/all-tests.scm: Likewise. * g13/all-tests.scm: Likewise. * tests/gpgme/all-tests.scm: Likewise. * tests/gpgsm/all-tests.scm: Likewise. * tests/migrations/all-tests.scm: Likewise. * tests/openpgp/all-tests.scm: Likewise. * tests/run-tests.scm: Likewise. -- This change allows us to run all tests in parallel and write one XML report capturing the results of every test. It also lays the foundation to parametrize test suites. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Emit JUnit-style XML reports.Justus Winter2017-04-241-1/+1
| | | | | | | | | | | | | | | | | | * tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file. * tests/gpgscm/lib.scm (string-translate): New function. * tests/gpgscm/main.c (main): Load new file. * tests/gpgscm/tests.scm (dirname): New function. (test-pool): Record execution times, emit XML report. (test): Record execution times, record log file name, emit XML report. (run-tests-parallel): Write XML report. (run-tests-sequential): Likewise. * tests/gpgscm/xml.scm: New file. * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Locate resources and scripts relative to top source dir.Justus Winter2017-04-246-13/+16
| | | | | | | | | | | | -- 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-4/+5
| | | | | | | | | * 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: 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: Rework environment setup.Justus Winter2017-03-091-2/+1
| | | | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (test::scm): Add a setup argument. (test::binary): Likewise. (run-tests-parallel): Remove setup parameter. (run-tests-sequential): Likewise. (make-environment-cache): New function that handles the cache protocol. * tests/gpgme/run-tests.scm: Adapt accordingly. * tests/gpgsm/run-tests.scm: Likewise. * tests/migrations/run-tests.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. -- This change allows us to have different environments for tests. This is needed to run more GPGME tests, and to increase concurrency while running all tests. Signed-off-by: Justus Winter <[email protected]>
* tests: Harmonize temporary and socket directory handling.Justus Winter2017-03-064-42/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: 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]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* g10: Properly ignore legacy keys in the keyring cache.Justus Winter2016-07-224-2/+375
| | | | | | | | | | | | | * g10/keyring.c (keyring_rebuild_cache): Properly ignore legacy keys in the keyring cache. * tests/migrations/Makefile.am (TESTS): Add new test. * tests/migrations/common.scm (GPG-no-batch): New variable. (run-test): New function. * tests/migrations/issue2276.scm: New file. * tests/migrations/issue2276.tar.asc: Likewise. GnuPG-bug-id: 2276 Signed-off-by: Justus Winter <[email protected]>
* build: Always build gpgtar.Justus Winter2016-07-151-1/+2
| | | | | | | | | | | | | We use gpgtar to unpack test data, hence we always build it. If the user opts out, we simply don't install it. * configure.ac: Add comment. * tests/migrations/Makefile.am (required_pgms): Make sure gpgtar is built. * tools/Makefile.am: Always build gpgtar, but do not install it if the user used '--disable-gpgtar'. Signed-off-by: Justus Winter <[email protected]>
* tests: Check for gpgtar.Justus Winter2016-07-152-0/+6
| | | | | | | | * tests/migrations/extended-pkf.scm: Skip test if gpgtar is not built. * tests/migrations/from-classic.scm: Likewise. * tests/openpgp/gpgtar.scm: Fix check for gpgtar. Signed-off-by: Justus Winter <[email protected]>
* tests: Honor environment variable 'TMP'.Justus Winter2016-07-051-0/+3
| | | | | | | | | | | | | | This fixes problems with long socket names, e.g. when doing distcheck. * tests/gpgscm/tests.scm (path-join): New function. (with-temporary-working-directory): Honor 'TMP'. (make-temporary-file): Likewise. * tests/migrations/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. * tests/openpgp/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. Signed-off-by: Justus Winter <[email protected]>
* tests/migrations: Fix distcheck.Justus Winter2016-07-0514-324/+442
| | | | | | | | | | | | | | | | | * tests/migrations/Makefile.am (TESTS): Rename test. (TEST_FILES): Update list. (EXTRA_DIST): Add common.scm. * tests/migrations/common.scm (GPGTAR): New variable. (dearmor): Rename and untar archive. * tests/migrations/extended-private-key-format.scm: Rename. (setup): Update. * tests/migrations/extended-pkf.tar.asc: New file. * tests/migrations/extended-private-key-format.gpghome: Delete. * tests/migrations/from-classic.gpghome: Likewise. * tests/migrations/from-classic.scm (setup): Update. * tests/migrations/from-classic.tar.asc: New file. Signed-off-by: Justus Winter <[email protected]>
* tests/migrations: Convert to Scheme and re-enable.Justus Winter2016-06-216-137/+166
| | | | | | | | | | | | | * configure.ac: Re-enable. * tests/Makefile.am: Likewise. * tests/migrations/Makefile.am (TESTS): Use Scheme tests. * tests/migrations/common.scm: New file. * tests/migrations/extended-private-key-format.scm: Likewise. * tests/migrations/from-classic.scm: Likewise. * tests/migrations/extended-private-key-format.test: Drop file. * tests/migrations/from-classic.test: Drop file. Signed-off-by: Justus Winter <[email protected]>
* common: Add support for the new extended private key format.Justus Winter2016-04-217-2/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (write_extended_private_key): New function. (agent_write_private_key): Detect if an existing file is in extended format and update the key within if it is. (read_key_file): Handle the new format. * agent/keyformat.txt: Document the new format. * common/Makefile.am: Add the new files. * common/private-keys.c: New file. * common/private-keys.h: Likewise. * common/t-private-keys.c: Likewise. * common/util.h (alphap, alnump): New macros. * tests/migrations: Add test demonstrating that we can cope with the new format. -- GnuPG 2.3+ will use a new format to store private keys that is both more flexible and easier to read and edit by human beings. The new format stores name,value-pairs using the common mail and http header convention. This patch adds the parser and support code and prepares GnuPG 2.1 for the new format. Signed-off-by: Justus Winter <[email protected]>
* tests: Make migration test more robust and silent.Justus Winter2016-04-211-8/+18
| | | | | | | * tests/migrations/from-classic.test: Fix in-tree build, silence test. Fixes-commit: defbc70b Signed-off-by: Justus Winter <[email protected]>
* agent: Sanitize permissions of the private key directory.Justus Winter2016-04-201-0/+15
| | | | | | | | | | | | | * agent/gpg-agent.c (create_private_keys_directory): Set permissions. * common/sysutils.c (modestr_to_mode): New function. (gnupg_mkdir): Use new function. (gnupg_chmod): New function. * common/sysutils.h (gnupg_chmod): New prototype. * tests/migrations/from-classic.test: Test migration with existing directory. GnuPG-bug-id: 2312 Signed-off-by: Justus Winter <[email protected]>
* tests: Test the migration from a classic GnuPG home directory.Justus Winter2016-04-205-0/+256
* configure.ac: Add new directory. * tests/Makefile.am (SUBDIRS): Likewise. * tests/migrations/Makefile.am: New file. * tests/migrations/from-classic.gpghome/pubring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/secring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/trustdb.gpg.asc: Likewise. * tests/migrations/from-classic.test: Likewise. Signed-off-by: Justus Winter <[email protected]>