[Pkg-gnupg-commit] [gnupg2] 11/180: tests: Delay querying the avaliable algorithms.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Dec 24 22:29:02 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 893a3f7fb46021961914a8acdf1292a80e3eba93
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 17 11:48:38 2016 +0100

    tests: Delay querying the avaliable algorithms.
    
    * tests/openpgp/defs.scm: Set verbosity earlier, turn 'all-*-algos'
    into promises.
    * tests/openpgp/conventional-mdc.scm: Force the promises.
    * tests/openpgp/conventional.scm: Likewise.
    * tests/openpgp/encrypt-dsa.scm: Likewise.
    * tests/openpgp/encrypt.scm: Likewise.
    * tests/openpgp/gpgtar.scm: Likewise.
    * tests/openpgp/sigs.scm: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/openpgp/conventional-mdc.scm |  2 +-
 tests/openpgp/conventional.scm     |  2 +-
 tests/openpgp/defs.scm             | 20 ++++++++++----------
 tests/openpgp/encrypt-dsa.scm      |  2 +-
 tests/openpgp/encrypt.scm          |  2 +-
 tests/openpgp/gpgtar.scm           |  3 ++-
 tests/openpgp/sigs.scm             |  2 +-
 7 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/tests/openpgp/conventional-mdc.scm b/tests/openpgp/conventional-mdc.scm
index fb92217..5b009ae 100755
--- a/tests/openpgp/conventional-mdc.scm
+++ b/tests/openpgp/conventional-mdc.scm
@@ -37,7 +37,7 @@
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
- all-cipher-algos)
+ (force all-cipher-algos))
 
 (for-each-p
  "Checking sign+symencrypt"
diff --git a/tests/openpgp/conventional.scm b/tests/openpgp/conventional.scm
index af889dc..612b992 100755
--- a/tests/openpgp/conventional.scm
+++ b/tests/openpgp/conventional.scm
@@ -46,4 +46,4 @@
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
- all-cipher-algos)
+ (force all-cipher-algos))
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index e91902c..bdb86ca 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -42,6 +42,10 @@
 (define data-files '("data-500" "data-9000" "data-32000" "data-80000"))
 (define exp-files '())
 
+(let ((verbose (string->number (getenv "verbose"))))
+  (if (number? verbose)
+      (*set-verbose!* verbose)))
+
 (define (qualify executable)
   (string-append executable (getenv "EXEEXT")))
 
@@ -95,16 +99,16 @@
 (define (get-config what)
   (string-split (caddar (gpg-with-colons `(--list-config ,what))) #\;))
 
-(define all-pubkey-algos (get-config "pubkeyname"))
-(define all-hash-algos (get-config "digestname"))
-(define all-cipher-algos (get-config "ciphername"))
+(define all-pubkey-algos (delay (get-config "pubkeyname")))
+(define all-hash-algos (delay (get-config "digestname")))
+(define all-cipher-algos (delay (get-config "ciphername")))
 
 (define (have-pubkey-algo? x)
-  (not (not (member x all-pubkey-algos))))
+  (not (not (member x (force all-pubkey-algos)))))
 (define (have-hash-algo? x)
-  (not (not (member x all-hash-algos))))
+  (not (not (member x (force all-hash-algos)))))
 (define (have-cipher-algo? x)
-  (not (not (member x all-cipher-algos))))
+  (not (not (member x (force all-cipher-algos)))))
 
 (define (gpg-pipe args0 args1 errfd)
   (lambda (source sink)
@@ -142,10 +146,6 @@
    (pipe:spawn `(, at GPG --dearmor))
    (pipe:write-to sink-name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
 
-(let ((verbose (string->number (getenv "verbose"))))
-  (if (number? verbose)
-      (*set-verbose!* verbose)))
-
 ;;
 ;; Support for test environment creation and teardown.
 ;;
diff --git a/tests/openpgp/encrypt-dsa.scm b/tests/openpgp/encrypt-dsa.scm
index fccb8c9..7ac1916 100755
--- a/tests/openpgp/encrypt-dsa.scm
+++ b/tests/openpgp/encrypt-dsa.scm
@@ -43,4 +43,4 @@
        (tr:gpg "" '(--yes))
        (tr:assert-identity source)))
     (append plain-files data-files)))
- all-cipher-algos)
+ (force all-cipher-algos))
diff --git a/tests/openpgp/encrypt.scm b/tests/openpgp/encrypt.scm
index ea97b4d..4247aa8 100755
--- a/tests/openpgp/encrypt.scm
+++ b/tests/openpgp/encrypt.scm
@@ -43,7 +43,7 @@
        (tr:gpg "" '(--yes))
        (tr:assert-identity source)))
     (append plain-files data-files)))
- all-cipher-algos)
+ (force all-cipher-algos))
 
 
 ;; We encrypt to two keys and we have also put the first key into our
diff --git a/tests/openpgp/gpgtar.scm b/tests/openpgp/gpgtar.scm
index 69206b4..cd692de 100755
--- a/tests/openpgp/gpgtar.scm
+++ b/tests/openpgp/gpgtar.scm
@@ -84,7 +84,8 @@
 
     (info "Checking gpgtar with symmetric encryption and chosen cipher")
     (do-test `(, at ppflags --symmetric --gpg-args
-			 ,(string-append "--cipher=" (car all-cipher-algos)))
+			 ,(string-append "--cipher="
+					 (car (force all-cipher-algos))))
 	     ppflags (cons '--decrypt ppflags))
 
     (info "Checking gpgtar with both symmetric and asymmetric encryption")
diff --git a/tests/openpgp/sigs.scm b/tests/openpgp/sigs.scm
index abdcd8f..5a1efa7 100755
--- a/tests/openpgp/sigs.scm
+++ b/tests/openpgp/sigs.scm
@@ -48,4 +48,4 @@
 		`(--yes --sign --passphrase-fd "0" --digest-algo ,hash))
 	(tr:gpg "" '(--yes))
 	(tr:assert-identity (car plain-files)))))
- all-hash-algos)
+ (force all-hash-algos))

-- 
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