aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-11-17 10:48:38 +0000
committerJustus Winter <[email protected]>2016-11-22 11:09:47 +0000
commit893a3f7fb46021961914a8acdf1292a80e3eba93 (patch)
treee9c883dc65325f94eac475e2cfa9e50a9925d12e
parentg10: Fix memory leak. (diff)
downloadgnupg-893a3f7fb46021961914a8acdf1292a80e3eba93.tar.gz
gnupg-893a3f7fb46021961914a8acdf1292a80e3eba93.zip
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 <[email protected]>
-rwxr-xr-xtests/openpgp/conventional-mdc.scm2
-rwxr-xr-xtests/openpgp/conventional.scm2
-rw-r--r--tests/openpgp/defs.scm20
-rwxr-xr-xtests/openpgp/encrypt-dsa.scm2
-rwxr-xr-xtests/openpgp/encrypt.scm2
-rwxr-xr-xtests/openpgp/gpgtar.scm3
-rwxr-xr-xtests/openpgp/sigs.scm2
7 files changed, 17 insertions, 16 deletions
diff --git a/tests/openpgp/conventional-mdc.scm b/tests/openpgp/conventional-mdc.scm
index fb9221773..5b009aef0 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 af889dcee..612b99298 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 e91902c79..bdb86caf1 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 `(,@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 fccb8c9f9..7ac191645 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 ea97b4d90..4247aa875 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 69206b409..cd692de84 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 `(,@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 abdcd8fe7..5a1efa76f 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))