aboutsummaryrefslogtreecommitdiffstats
path: root/tests/json (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-01-02tests,json: Prevent failing tests after 2027-05-15Ingo Klöcker2-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
2024-08-07tests,json: Remove no longer needed codeIngo Klöcker1-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).
2024-05-24tests: Add new files to distributionIngo Klöcker1-0/+2
* tests/json/Makefile.am (EXTRA_DIST): Add files added with f2575b63. -- Fixes-commit: f2575b6313aeb23d867682856f7842704786349e GnuPG-bug-id: 7118
2024-05-21json: Add information about revocation keys to key list resultIngo Klöcker5-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
2024-05-21tests: Fix segv in t-json.cWerner Koch1-1/+1
* tests/json/t-json.c (test_contains): Avoid calling recusivly with no child.
2023-10-13doc: Fix typos in documentation and source code commentsIngo Klöcker1-1/+1
-- Anonymous contribution Signed-off-by: Ingo Klöcker <[email protected]>
2023-02-09tests: Stop daemons after setting up test environmentIngo Klöcker1-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".
2020-10-03tests: Fix gcc incompatibilityWerner Koch1-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
2020-05-08tests, json: Do not check for keygrip of pubkeysAndre Heinecke1-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
2020-01-29Do not test for a bug in older GnuPG versionsAndre Heinecke1-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
2019-08-06json: Fix t-decrypt-verify.out for GnuPG >= 2.3.NIIBE Yutaka1-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]>
2019-01-16build: With LD_LIBRARY_PATH defined, use --disable-new-dtags.NIIBE Yutaka1-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]>
2018-11-28tests, json: Make them run on debian stableAndre Heinecke1-2/+2
* tests/json/t-json.c (main): Relax version check a bit.
2018-11-16Add SPDX identifiers to most source filesWerner Koch2-21/+21
-- Signed-off-by: Werner Koch <[email protected]>
2018-11-15tests,json: Clean openpgp-revocs.dAndre Heinecke1-0/+1
* tests/json/clean-local: Remove revocs.d
2018-11-15tests,json: Move version check into t-jsonAndre Heinecke1-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.
2018-11-14tests,json: Add sig-notations testAndre Heinecke4-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.
2018-11-14tests,json: Fix distcheckAndre Heinecke1-2/+3
* tests/json/Makefile.am (EXTRA_DIST): Add inital and final scripts. (t_json_SOURCES): Don't use cJSON.o as source.
2018-11-14tests,json: Add more testsAndre Heinecke6-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.
2018-11-14tests,json: Add missing files and chunking testAndre Heinecke6-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..
2018-11-14tests,json: Fix match if the first child differsAndre Heinecke1-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.
2018-11-14tests,json: Add the bulk of testsAndre Heinecke25-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.
2018-11-14tests,json: Add wildcard string matchingAndre Heinecke1-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.
2018-11-14tests,json: Skip tests for older GnuPG versionsAndre Heinecke1-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.
2018-11-14tests,json: Suffix .json to test patternAndre Heinecke3-2/+2
* tests/json/t-config.in, tests/json/t-config.out: Renamed. * t-json.c (run_test): Use new naming pattern.
2018-11-14tests,json: Improve verbose mode and add verbose 2Andre Heinecke1-13/+25
* tests/json/t-json.c (main): Handle multiple verbose args. (test-contains): Improve verbose output
2018-11-14tests,json: Fix and improve t-jsonAndre Heinecke1-10/+17
* tests/json/t-json.c (run_test): Terminate argv array correctly. (run_test): Note and handle empty response.
2018-11-14tests: Add json testrunnerAndre Heinecke3-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.