[git] GnuPG - branch, master, updated. gnupg-2.1.15-98-gaa81e32

by Justus Winter cvs at cvs.gnupg.org
Mon Sep 12 11:08:52 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  aa81e32df7189c3eb44d4c602fd63f5b3f6a9e49 (commit)
      from  eddcba038025cdbd58aaf67cafd6d83f0ea042d5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit aa81e32df7189c3eb44d4c602fd63f5b3f6a9e49
Author: Justus Winter <justus at g10code.com>
Date:   Mon Sep 12 11:07:48 2016 +0200

    tests: Simplify tofu test.
    
    * tests/openpgp/tofu.scm: Simplify now that we only have one db
    format.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/tofu.scm b/tests/openpgp/tofu.scm
index cf2b389..f4de1d8 100755
--- a/tests/openpgp/tofu.scm
+++ b/tests/openpgp/tofu.scm
@@ -95,70 +95,68 @@
   (call-check `(, at GPG --trust-model=tofu , at args
 		      --tofu-policy ,policy ,keyid)))
 
+(info "Checking tofu policies and trust...")
+
+;; Carefully remove the TOFU db.
+(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
+(catch '() (unlink-recursively (string-append GNUPGHOME "/tofu.d")))
+
+;; Verify a message.  There should be no conflict and the trust
+;; policy should be set to auto.
+(call-check `(, at GPG --trust-model=tofu
+		    --verify ,(in-srcdir "tofu-2183839A-1.txt")))
+
+(checkpolicy "2183839A" "auto")
+;; Check default trust.
+(checktrust "2183839A" "m")
+
+;; Trust should be derived lazily.  Thus, if the policy is set to
+;; auto and we change --tofu-default-policy, then the trust should
+;; change as well.  Try it.
+(checktrust "2183839A" "f" '--tofu-default-policy=good)
+(checktrust "2183839A" "-" '--tofu-default-policy=unknown)
+(checktrust "2183839A" "n" '--tofu-default-policy=bad)
+
+;; Change the policy to something other than auto and make sure the
+;; policy and the trust are correct.
 (for-each-p
- "Testing tofu db"
- (lambda (1)
-   ;; Carefully remove the TOFU db.
-   (catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
-   (catch '() (unlink-recursively (string-append GNUPGHOME "/tofu.d")))
-
-   ;; Verify a message.  There should be no conflict and the trust
-   ;; policy should be set to auto.
-   (call-check `(, at GPG --trust-model=tofu
-		       --verify ,(in-srcdir "tofu-2183839A-1.txt")))
-
-   (checkpolicy "2183839A" "auto")
-   ;; Check default trust.
-   (checktrust "2183839A" "m")
-
-   ;; Trust should be derived lazily.  Thus, if the policy is set to
-   ;; auto and we change --tofu-default-policy, then the trust should
-   ;; change as well.  Try it.
-   (checktrust "2183839A" "f" '--tofu-default-policy=good)
-   (checktrust "2183839A" "-" '--tofu-default-policy=unknown)
-   (checktrust "2183839A" "n" '--tofu-default-policy=bad)
-
-   ;; Change the policy to something other than auto and make sure the
-   ;; policy and the trust are correct.
-   (for-each-p
-    ""
-    (lambda (policy)
-      (let ((expected-trust
-	     (cond
-	      ((string=? "good" policy) "f")
-	      ((string=? "unknown" policy) "-")
-	      (else "n"))))
-	(setpolicy "2183839A" policy)
-
-	;; Since we have a fixed policy, the trust level shouldn't
-	;; change if we change the default policy.
-	(for-each-p
-	 ""
-	 (lambda (default-policy)
-	   (checkpolicy "2183839A" policy
-			'--tofu-default-policy default-policy)
-	   (checktrust "2183839A" expected-trust
-		       '--tofu-default-policy default-policy))
-	 '("auto" "good" "unknown" "bad" "ask"))))
-    '("good" "unknown" "bad"))
-
-   ;; BC15C85A conflicts with 2183839A.  On conflict, this will set
-   ;; BC15C85A to ask.  If 2183839A is auto (it's not, it's bad), then
-   ;; it will be set to ask.
-   (call-check `(, at GPG --trust-model=tofu
-		       --verify ,(in-srcdir "tofu-BC15C85A-1.txt")))
-   (checkpolicy "BC15C85A" "ask")
-   (checkpolicy "2183839A" "bad")
-
-   ;; EE37CF96 conflicts with 2183839A and BC15C85A.  We change
-   ;; BC15C85A's policy to auto and leave 2183839A's policy at bad.
-   ;; This conflict should cause BC15C85A's policy to be changed to
-   ;; ask (since it is auto), but not affect 2183839A's policy.
-   (setpolicy "BC15C85A" "auto")
-   (checkpolicy "BC15C85A" "auto")
-   (call-check `(, at GPG --trust-model=tofu
-		       --verify ,(in-srcdir "tofu-EE37CF96-1.txt")))
-   (checkpolicy "BC15C85A" "ask")
-   (checkpolicy "2183839A" "bad")
-   (checkpolicy "EE37CF96" "ask"))
- '("flat"))
+ "Setting a fixed policy..."
+ (lambda (policy)
+   (let ((expected-trust
+	  (cond
+	   ((string=? "good" policy) "f")
+	   ((string=? "unknown" policy) "-")
+	   (else "n"))))
+     (setpolicy "2183839A" policy)
+
+     ;; Since we have a fixed policy, the trust level shouldn't
+     ;; change if we change the default policy.
+     (for-each-p
+      ""
+      (lambda (default-policy)
+	(checkpolicy "2183839A" policy
+		     '--tofu-default-policy default-policy)
+	(checktrust "2183839A" expected-trust
+		    '--tofu-default-policy default-policy))
+      '("auto" "good" "unknown" "bad" "ask"))))
+ '("good" "unknown" "bad"))
+
+;; BC15C85A conflicts with 2183839A.  On conflict, this will set
+;; BC15C85A to ask.  If 2183839A is auto (it's not, it's bad), then
+;; it will be set to ask.
+(call-check `(, at GPG --trust-model=tofu
+		    --verify ,(in-srcdir "tofu-BC15C85A-1.txt")))
+(checkpolicy "BC15C85A" "ask")
+(checkpolicy "2183839A" "bad")
+
+;; EE37CF96 conflicts with 2183839A and BC15C85A.  We change
+;; BC15C85A's policy to auto and leave 2183839A's policy at bad.
+;; This conflict should cause BC15C85A's policy to be changed to
+;; ask (since it is auto), but not affect 2183839A's policy.
+(setpolicy "BC15C85A" "auto")
+(checkpolicy "BC15C85A" "auto")
+(call-check `(, at GPG --trust-model=tofu
+		    --verify ,(in-srcdir "tofu-EE37CF96-1.txt")))
+(checkpolicy "BC15C85A" "ask")
+(checkpolicy "2183839A" "bad")
+(checkpolicy "EE37CF96" "ask")

-----------------------------------------------------------------------

Summary of changes:
 tests/openpgp/tofu.scm | 130 ++++++++++++++++++++++++-------------------------
 1 file changed, 64 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list