[Pkg-gnupg-commit] [gnupg2] 140/292: tests: Simplify test.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 71158d8d5f823888abc8588caa6497860ce59c06
Author: Justus Winter <justus at g10code.com>
Date:   Thu Oct 20 16:54:06 2016 +0200

    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 at g10code.com>
---
 tests/openpgp/quick-key-manipulation.scm | 67 +++++++++++++++-----------------
 1 file changed, 31 insertions(+), 36 deletions(-)

diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index 8a3e3f1..b6411d0 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -33,55 +33,50 @@
 		   `(--with-fingerprint
 		     --list-secret-keys ,(exact id))))))
 
-(define old-home (getenv "GNUPGHOME"))
-(define alpha "Alpha <alpha at example.net>")
-(define bravo "Bravo <bravo at example.net>")
+(define alpha "Alpha <alpha at invalid.example.net>")
+(define bravo "Bravo <bravo at 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)
+(setenv "PINENTRY_USER_DATA" "test" #t)
 
- (info "Checking quick key generation...")
- (call-check `(, at GPG --quick-gen-key ,alpha))
+(info "Checking quick key generation...")
+(call-check `(, at GPG --quick-gen-key ,alpha))
 
- (call-check `(, at GPG --check-trustdb)) ; XXX why?
+(call-check `(, at GPG --check-trustdb)) ; XXX why?
 
- (assert (= 1 (count-uids-of-secret-key alpha)))
+(assert (= 1 (count-uids-of-secret-key alpha)))
 
- (info "Checking that we can add a user ID...")
+(info "Checking that we can add a user ID...")
 
- ;; Make sure the key capabilities don't change when we add a user id.
- ;; (See bug #2697.)
- (let ((pre (key-data (exact alpha)))
-       (result (call-check `(, at GPG --quick-adduid ,(exact alpha) ,bravo)))
-       (post (key-data (exact alpha))))
-   (if (not (equal? pre post))
-       (begin
-         (display "Key capabilities changed when adding a user id:")
-         (newline)
-         (display "  Pre: ")
-         (display pre)
-         (newline)
-         (display " Post: ")
-         (display post)
-         (newline)
-         (exit 1))))
+;; Make sure the key capabilities don't change when we add a user id.
+;; (See bug #2697.)
+(let ((pre (key-data (exact alpha)))
+      (result (call-check `(, at GPG --quick-adduid ,(exact alpha) ,bravo)))
+      (post (key-data (exact alpha))))
+  (if (not (equal? pre post))
+      (begin
+	(display "Key capabilities changed when adding a user id:")
+	(newline)
+	(display "  Pre: ")
+	(display pre)
+	(newline)
+	(display " Post: ")
+	(display post)
+	(newline)
+	(exit 1))))
 
- (call-check `(, at GPG --check-trustdb)) ; XXX why?
+(call-check `(, at GPG --check-trustdb)) ; XXX why?
 
- (assert (= 2 (count-uids-of-secret-key alpha)))
- (assert (= 2 (count-uids-of-secret-key bravo)))
+(assert (= 2 (count-uids-of-secret-key alpha)))
+(assert (= 2 (count-uids-of-secret-key bravo)))
 
- (info "Checking that we can revoke a user ID...")
- (call-check `(, at GPG --quick-revuid ,(exact bravo) ,alpha))
+(info "Checking that we can revoke a user ID...")
+(call-check `(, at GPG --quick-revuid ,(exact bravo) ,alpha))
 
- (call-check `(, at GPG --check-trustdb)) ; XXX why?
+(call-check `(, at GPG --check-trustdb)) ; XXX why?
 
- (assert (= 1 (count-uids-of-secret-key bravo))))
+(assert (= 1 (count-uids-of-secret-key bravo)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list