diff options
author | Werner Koch <wk@gnupg.org> | 2020-09-24 10:35:05 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-09-24 10:37:42 +0200 |
commit | b19a60c6f7e892635db9e22499a7a44087c86c41 (patch) | |
tree | 1f3a7859eb61c8bfff903d1f07747d83ec655feb | |
parent | keyboxd: Implement multiple search descriptions. (diff) | |
download | gnupg2-b19a60c6f7e892635db9e22499a7a44087c86c41.tar.xz gnupg2-b19a60c6f7e892635db9e22499a7a44087c86c41.zip |
tests: Integrate --use-keyboxd into the OpenPGP test suite.
* 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 <wk@gnupg.org>
-rw-r--r-- | tests/openpgp/all-tests.scm | 19 | ||||
-rw-r--r-- | tests/openpgp/defs.scm | 14 | ||||
-rwxr-xr-x | tests/openpgp/gpgv.scm | 14 | ||||
-rwxr-xr-x | tests/openpgp/issue2419.scm | 2 |
4 files changed, 37 insertions, 12 deletions
diff --git a/tests/openpgp/all-tests.scm b/tests/openpgp/all-tests.scm index e12b175b9..046012cfa 100644 --- a/tests/openpgp/all-tests.scm +++ b/tests/openpgp/all-tests.scm @@ -45,7 +45,7 @@ (string-append "--" variant)))) (define setup-use-keyring (setup* "use-keyring")) - (define setup-extended-key-format (setup* "extended-key-format")) + (define setup-use-keyboxd (setup* "use-keyboxd")) (define all-tests (parse-makefile-expand "Makefile" @@ -55,24 +55,27 @@ (define tests (map (lambda (name) (test::scm setup - (path-join "tests" "openpgp" name) + (qualify (path-join "tests" "openpgp" name) "standard") (in-srcdir "tests" "openpgp" name))) all-tests)) (when *run-all-tests* (set! tests (append tests + ;; The second pass uses the keyboxd (map (lambda (name) - (test::scm setup-use-keyring + (test::scm setup-use-keyboxd (qualify (path-join "tests" "openpgp" name) - "use-keyring") + "keyboxd") (in-srcdir "tests" "openpgp" name) - "--use-keyring")) all-tests) + "--use-keyboxd")) all-tests) + ;; The third pass uses the legact pubring.gpg (map (lambda (name) - (test::scm setup-extended-key-format + (test::scm setup-use-keyring (qualify (path-join "tests" "openpgp" name) - "extended-key-format") + "keyring") (in-srcdir "tests" "openpgp" name) - "--extended-key-format")) all-tests)))) + "--use-keyring")) all-tests) + ))) tests) diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm index 75c66b52c..fab033659 100644 --- a/tests/openpgp/defs.scm +++ b/tests/openpgp/defs.scm @@ -336,6 +336,8 @@ (create-file "pubring.gpg")) (create-file "gpg.conf" + ;;"log-file socket:///tmp/S.wklog" + ;;"verbose" "no-greeting" "no-secmem-warning" "no-permission-warning" @@ -349,14 +351,20 @@ (string-append "agent-program " (tool 'gpg-agent) "|--debug-quick-random\n") + (if (flag "--use-keyboxd" *args*) + "use-keyboxd" "#use-keyboxd") ) + (create-file "keyboxd.conf" + ;;"log-file socket:///tmp/S.wklog" + ;;"verbose" + ;;"debug ipc" + ) + (create-file "gpg-agent.conf" "allow-preset-passphrase" "no-grab" "enable-ssh-support" "s2k-count 65536" - (if (flag "--extended-key-format" *args*) - "enable-extended-key-format" "#enable-extended-key-format") (string-append "pinentry-program " (tool 'pinentry)) "disable-scdaemon")) @@ -505,5 +513,7 @@ (set! gpg `(,@valgrind ,@gpg))) +;;(set! *args* (append *args* (list "--use-keyboxd"))) + ;; end diff --git a/tests/openpgp/gpgv.scm b/tests/openpgp/gpgv.scm index 819d15f1b..398f05052 100755 --- a/tests/openpgp/gpgv.scm +++ b/tests/openpgp/gpgv.scm @@ -21,7 +21,16 @@ (load (in-srcdir "tests" "openpgp" "signed-messages.scm")) (setup-legacy-environment) -(define keyring (if (file-exists? "pubring.kbx") "pubring.kbx" "pubring.gpg")) +;; In keyboxd mode we need to export all keys first +(if (flag "--use-keyboxd" *args*) + (call-check `(,@GPG --quiet --yes + --export --yes --batch -o mytrustedkeys.gpg))) + +(define keyring (if (flag "--use-keyboxd" *args*) + "mytrustedkeys.gpg" + (if (file-exists? "pubring.kbx") + "pubring.kbx" + "pubring.gpg"))) ;; ;; Two simple tests to check that verify fails for bad input data @@ -66,6 +75,9 @@ ;; Need to import the ed25519 sample key used for the next two tests. (call-check `(,@gpg --quiet --yes --import ,(in-srcdir "tests" "openpgp" key-file2))) +(if (flag "--use-keyboxd" *args*) + (call-check `(,@GPG --quiet --yes + --export --yes --batch -o mytrustedkeys.gpg))) (for-each-p "Checking that a valid Ed25519 signature is verified as such" (lambda (armored-file) diff --git a/tests/openpgp/issue2419.scm b/tests/openpgp/issue2419.scm index 641fb32b5..1bfabb07f 100755 --- a/tests/openpgp/issue2419.scm +++ b/tests/openpgp/issue2419.scm @@ -25,5 +25,5 @@ (onebyte) (dearmor (in-srcdir "tests" "openpgp" "samplemsgs/issue2419.asc") onebyte) (catch (assert (string-contains? (car *error*) "invalid packet")) - (call-popen `(,@GPG --list-packets ,onebyte) "") + (call-popen `(,@GPG --log-file - --list-packets ,onebyte) "") (fail "Expected an error but got none"))) |