aboutsummaryrefslogtreecommitdiffstats
path: root/tests/migrations/common.scm
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-07-22 11:29:26 +0000
committerJustus Winter <[email protected]>2016-07-22 12:17:24 +0000
commitd9839c9d303a01dc1032a6de311e034fe14e81da (patch)
tree8434eab8d12950dc881a787a5d781fc367f6f4a0 /tests/migrations/common.scm
parentg10: Fix error handling. (diff)
downloadgnupg-d9839c9d303a01dc1032a6de311e034fe14e81da.tar.gz
gnupg-d9839c9d303a01dc1032a6de311e034fe14e81da.zip
g10: Properly ignore legacy keys in the keyring cache.
* 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]>
Diffstat (limited to 'tests/migrations/common.scm')
-rw-r--r--tests/migrations/common.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/common.scm b/tests/migrations/common.scm
index 79f69e5d1..944d4f662 100644
--- a/tests/migrations/common.scm
+++ b/tests/migrations/common.scm
@@ -30,6 +30,9 @@
--no-secmem-warning --batch
,(string-append "--agent-program=" GPG-AGENT
"|--debug-quick-random")))
+(define GPG-no-batch
+ (filter (lambda (arg) (not (equal? arg '--batch))) GPG))
+
(define GPGTAR (qualify (string-append (getcwd) "/../../tools/gpgtar")))
(define (untar-armored source-name)
@@ -37,3 +40,13 @@
(pipe:open source-name (logior O_RDONLY O_BINARY))
(pipe:spawn `(,@GPG --dearmor))
(pipe:spawn `(,GPGTAR --extract --directory=. -))))
+
+(define (run-test message src-tarball test)
+ (catch (skip "gpgtar not built")
+ (call-check `(,GPGTAR --help)))
+
+ (with-temporary-working-directory
+ (info message)
+ (untar-armored src-tarball)
+ (setenv "GNUPGHOME" (getcwd) #t)
+ (test (getcwd))))