tests: Simplify test.

* tests/openpgp/quick-key-manipulation.scm: Avoid creating a temporary
home directory, just make the uids unique.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-10-20 16:54:06 +02:00
parent ca9597f080
commit 71158d8d5f
1 changed files with 31 additions and 36 deletions

View File

@ -33,19 +33,14 @@
`(--with-fingerprint
--list-secret-keys ,(exact id))))))
(define old-home (getenv "GNUPGHOME"))
(define alpha "Alpha <alpha@example.net>")
(define bravo "Bravo <bravo@example.net>")
(define alpha "Alpha <alpha@invalid.example.net>")
(define bravo "Bravo <bravo@invalid.example.net>")
(define (key-data key)
(filter (lambda (x) (or (string=? (car x) "pub")
(string=? (car x) "sub")))
(gpg-with-colons `(-k ,key))))
(with-temporary-working-directory
(file-copy (path-join old-home "gpg.conf") "gpg.conf")
(file-copy (path-join old-home "gpg-agent.conf") "gpg-agent.conf")
(setenv "GNUPGHOME" "." #t)
(setenv "PINENTRY_USER_DATA" "test" #t)
(info "Checking quick key generation...")
@ -84,4 +79,4 @@
(call-check `(,@GPG --check-trustdb)) ; XXX why?
(assert (= 1 (count-uids-of-secret-key bravo))))
(assert (= 1 (count-uids-of-secret-key bravo)))