aboutsummaryrefslogtreecommitdiffstats
path: root/tests/json (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tests,json: Prevent failing tests after 2027-05-15Ingo Klöcker2025-01-022-20/+20
| | | | | | | | | | | | | | | | | | | * tests/json/key-with-revokers.asc: Replace with new public key. * tests/json/t-keylist-revokers.out.json: Update to new public key. -- The old test key expired on 2027-05-15 which would break the tests after this date. Replace it with a new test key which doesn't expire. The new key was generated with gpg --faked-system-time 1715782979 \ --add-desig-revoker sensitive:A0FF4590BB6122EDEF6E3C542D727CC768697734 \ --add-desig-revoker 23FD347A419429BACCD5E72D6BC4778054ACD246 \ --quick-gen-key [email protected] default default never and exported with gpg --export --armor --export-options export-sensitive-revkeys \ [email protected] GnuPG-bug-id: 7471
* tests,json: Remove no longer needed codeIngo Klöcker2024-08-071-106/+1
| | | | | | | | | | * tests/json/t-json.c (parse_version_number, parse_version_string, compare_versions, check_gpg_version): Remove. (main): Use have_gpg_version from t-support.h. -- In the meantime gpgrt provides API for comparing versions (which is used by have_gpg_version in t-support.h).
* tests: Add new files to distributionIngo Klöcker2024-05-241-0/+2
| | | | | | | | * tests/json/Makefile.am (EXTRA_DIST): Add files added with f2575b63. -- Fixes-commit: f2575b6313aeb23d867682856f7842704786349e GnuPG-bug-id: 7118
* json: Add information about revocation keys to key list resultIngo Klöcker2024-05-215-1/+127
| | | | | | | | | | | | | | * src/gpgme-json.c (revocation_key_to_json): New. (key_to_json): Add list of revocation keys. * tests/json/Makefile.am (pubring-stamp): Import new pub key. * tests/json/key-with-revokers.asc: New. * tests/json/t-json.c (tests): Add "t-keylist-revokers". * tests/json/t-keylist-revokers.in.json, tests/json/t-keylist-revokers.in.json: New. -- GnuPG-bug-id: 7118
* tests: Fix segv in t-json.cWerner Koch2024-05-211-1/+1
| | | | | * tests/json/t-json.c (test_contains): Avoid calling recusivly with no child.
* doc: Fix typos in documentation and source code commentsIngo Klöcker2023-10-131-1/+1
| | | | | | | | -- Anonymous contribution Signed-off-by: Ingo Klöcker <[email protected]>
* tests: Stop daemons after setting up test environmentIngo Klöcker2023-02-091-0/+1
| | | | | | | | | | * lang/python/tests/Makefile.am, lang/qt/tests/Makefile.am, tests/gpg/Makefile.am, tests/json/Makefile.am (pubring-stamp): Call `gpgconf --kill all` after importing test keys. -- This ensures that no gpg-agents or other daemons are running after "make".
* tests: Fix gcc incompatibilityWerner Koch2020-10-031-5/+13
| | | | | | | | | | * tests/json/t-json.c: Remove var definitions inside a for statement. -- This useful C99 feature seems to work only in recent gcc versions. We can't use it; see gnupg/doc/HACKING. GnuPG-bug-id: 5088
* tests, json: Do not check for keygrip of pubkeysAndre Heinecke2020-05-081-2/+0
| | | | | | | | | | | | | | | | | | | * tests/json/t-keylist-secret.out.json: Do not check for keygrip of bravo key. -- Since GnuPG 2.2.19 the keygrip is not emitted for public keys in a keylisting --with-secret. As the GPGME test suite should pass with several versions the json test cannot test this as the suite does not allow version checks for different output. What the intended behavior is might still be up for discussion, always adding --with-keygip is not a good solution because it slows down keylistings for large keyrings. GnuPG-Bug-Id: T4820
* Do not test for a bug in older GnuPG versionsAndre Heinecke2020-01-291-1/+0
| | | | | | | | | | | * tests/json/t-keylist-secret.out.json -- Since at least 2.2.19 GnuPG no longer emits secret = true for keys where it does not have a secret. To avoid failures with older versions we remove the check altogether. GnuPG-Bug-Id: T4820
* json: Fix t-decrypt-verify.out for GnuPG >= 2.3.NIIBE Yutaka2019-08-061-5/+0
| | | | | | | | | | | | | | | | | | | | | | * tests/json/t-decrypt-verify.out.json: Remove check with key of 04071FB807287134. -- GnuPG 2.3 changes how public key decryption works; It collects list of PUBKEY_ENC packets and then processes an ENCRYPTED* packet. At the stage of processing an ENCRYPTED* packet, it checks if private keys can decrypt any of PUBKEY_ENC packets. It does not necessarily examine all of PUBKEY_ENC packets. Only when it finds a PUBKEY_ENC packet cannot be decrypted, it reports STATUS_NO_SECKEY with keyid of that packet. GnuPG 2.2 or older tries PUBKEY_ENC packets in order, and the first successful PUBKEY_ENC packet is used. Rest of PUBKEY_ENC packets are not examined, but STATUS_NO_SECKEY with keyid is reported even when there is a valid private key. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: With LD_LIBRARY_PATH defined, use --disable-new-dtags.NIIBE Yutaka2019-01-161-2/+3
| | | | | | | | | | | | | * configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags. * tests/Makefile.am (LDADD): Use LDADD_FOR_TESTS_KLUDGE. * lang/cpp/tests/Makefile.am, lang/qt/tests/Makefile.am: Likewise. * tests/gpg/Makefile.am, tests/gpgsm/Makefile.am: Likewise. * tests/json/Makefile.am, tests/opassuan/Makefile.am: Likewise. -- GnuPG-bug-id: 4298 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests, json: Make them run on debian stableAndre Heinecke2018-11-281-2/+2
| | | | * tests/json/t-json.c (main): Relax version check a bit.
* Add SPDX identifiers to most source filesWerner Koch2018-11-162-21/+21
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* tests,json: Clean openpgp-revocs.dAndre Heinecke2018-11-151-0/+1
| | | | * tests/json/clean-local: Remove revocs.d
* tests,json: Move version check into t-jsonAndre Heinecke2018-11-151-0/+106
| | | | | | | | | | | | | * tests/gpg/t-support.h (check_gpg_version, compare_versions), (parse_version_string, parse_version_number): Remove version check code. * tests/json/t-json.c (check_gpg_version, compare_versions), (parse_version_string, parse_version_number): Add. -- t-support header was not a good place for this. It should go into a library e.g. gpgrt in the future. For now we can keep it close to where it is needed.
* tests,json: Add sig-notations testAndre Heinecke2018-11-144-1/+62
| | | | | | | * tests/json/t-sig-notations.in.json, tests/json/t-sig-notations.out.json: New * tests/json/Makefile.am (EXTRA_DIST): Add files. * tests/json/t-json.c: Register it.
* tests,json: Fix distcheckAndre Heinecke2018-11-141-2/+3
| | | | | * tests/json/Makefile.am (EXTRA_DIST): Add inital and final scripts. (t_json_SOURCES): Don't use cJSON.o as source.
* tests,json: Add more testsAndre Heinecke2018-11-146-0/+50
| | | | | | | | | | | | * t-config-opt.in.json, t-config-opt.out.json, t-import.in.json, t-import.out.json, t-sign.in.json, t-sign.out.json: New. -- These should actually have been in a previous commit as they are already registered.
* tests,json: Add missing files and chunking testAndre Heinecke2018-11-146-1/+125
| | | | | | | | | | | * tests/json/Makefile.am, tests/json/final.test, tests/json/initial.test: New. * tests/json/t-chunking.in.json, tests/json/t-chunking.out.json: New test. * tests/json/t-json.c: Register new test. -- Oops..
* tests,json: Fix match if the first child differsAndre Heinecke2018-11-141-1/+13
| | | | | | | | | | | * tests/json/t-json.c (test_contains): Try all siblings of the haystack child. -- This fixes the case where we don't match against the first child because the order might have changed or a new element was inserted at the top. Then we have to try out also all the siblings.
* tests,json: Add the bulk of testsAndre Heinecke2018-11-1425-1/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * t-json.c (tests): Register new tests. * t-createkey.in.json, t-createkey.out.json, t-decrypt-verify.in.json, t-decrypt-verify.out.json, t-decrypt.in.json, t-decrypt.out.json, t-delete.in.json, t-delete.out.json, t-encrypt-sign.in.json, t-encrypt-sign.out.json, t-encrypt.in.json, t-encrypt.out.json, t-export-secret-info.in.json, t-export-secret-info.out.json, t-export.in.json, t-export.out.json, t-json.c, t-keylist-secret.in.json, t-keylist-secret.out.json, t-keylist.in.json, t-keylist.out.json, t-verify.in.json, t-verify.out.json, t-version.in.json, t-version.out.json: New. -- Except for help and getmore there is now a test for each command.
* tests,json: Add wildcard string matchingAndre Heinecke2018-11-141-1/+3
| | | | | | | | | * tests/json/t-json.c (test_contains): When searching for "*" accept every string. -- This allows it to write tests that check for the existence of a string value but don't care about the contents. E.g. for Data.
* tests,json: Skip tests for older GnuPG versionsAndre Heinecke2018-11-141-0/+8
| | | | | | | | | | | * tests/json/t-json.c (main): Skip if version is not at least 2.2.0 -- In the past new tests often failed when a modern GPGME was used with old GnuPG's. This should avoid the hassle for packagers without the requirement that we test against old versions.
* tests,json: Suffix .json to test patternAndre Heinecke2018-11-143-2/+2
| | | | | * tests/json/t-config.in, tests/json/t-config.out: Renamed. * t-json.c (run_test): Use new naming pattern.
* tests,json: Improve verbose mode and add verbose 2Andre Heinecke2018-11-141-13/+25
| | | | | * tests/json/t-json.c (main): Handle multiple verbose args. (test-contains): Improve verbose output
* tests,json: Fix and improve t-jsonAndre Heinecke2018-11-141-10/+17
| | | | | * tests/json/t-json.c (run_test): Terminate argv array correctly. (run_test): Note and handle empty response.
* tests: Add json testrunnerAndre Heinecke2018-11-143-0/+367
* configure.ac: Configure makefile. * tests/Makefile.am: Run json tests if gpg tests are run. * tests/json/t-json.c: New testrunner for json tests. * tests/json/t-config.in, tests/json/t-config.out: First test. -- The idea of this test runner is that it only looks for parts in the output. This should allow it to write robust tests that check for the basics in the output but don't fail when the output is extended or slightly changed.