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@g10code.com>
This commit is contained in:
Justus Winter 2016-11-17 11:48:38 +01:00
parent 6ce14a805f
commit 893a3f7fb4
7 changed files with 17 additions and 16 deletions

View File

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

View File

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

View File

@ -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.
;;

View File

@ -43,4 +43,4 @@
(tr:gpg "" '(--yes))
(tr:assert-identity source)))
(append plain-files data-files)))
all-cipher-algos)
(force all-cipher-algos))

View File

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

View File

@ -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")

View File

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