[Pkg-gnupg-commit] [gnupg2] 50/132: tests: Avoid relying on implicit gpg commands.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 17 03:07:41 UTC 2017


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

dkg pushed a commit to branch experimental
in repository gnupg2.

commit cde626e7f7349a73d58ec3236ab3b43dec852bb5
Author: Justus Winter <justus at g10code.com>
Date:   Tue Apr 11 11:37:37 2017 +0200

    tests: Avoid relying on implicit gpg commands.
    
    * tests/openpgp/armdetach.scm: Always use an explicit command instead
    of relying on gpg to guess what we want.
    * tests/openpgp/armdetachm.scm: Likewise.
    * tests/openpgp/armencrypt.scm: Likewise.
    * tests/openpgp/armencryptp.scm: Likewise.
    * tests/openpgp/armor.scm: Likewise.
    * tests/openpgp/armsignencrypt.scm: Likewise.
    * tests/openpgp/armsigs.scm: Likewise.
    * tests/openpgp/clearsig.scm: Likewise.
    * tests/openpgp/compression.scm: Likewise.
    * tests/openpgp/conventional-mdc.scm: Likewise.
    * tests/openpgp/conventional.scm: Likewise.
    * tests/openpgp/decrypt-dsa.scm: Likewise.
    * tests/openpgp/decrypt.scm: Likewise.
    * tests/openpgp/detach.scm: Likewise.
    * tests/openpgp/detachm.scm: Likewise.
    * tests/openpgp/ecc.scm: Likewise.
    * tests/openpgp/encrypt-dsa.scm: Likewise.
    * tests/openpgp/encrypt-multifile.scm: Likewise.
    * tests/openpgp/encrypt.scm: Likewise.
    * tests/openpgp/encryptp.scm: Likewise.
    * tests/openpgp/seat.scm: Likewise.
    * tests/openpgp/signencrypt-dsa.scm: Likewise.
    * tests/openpgp/signencrypt.scm: Likewise.
    * tests/openpgp/sigs-dsa.scm: Likewise.
    * tests/openpgp/sigs.scm: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/openpgp/armdetach.scm         | 2 +-
 tests/openpgp/armdetachm.scm        | 2 +-
 tests/openpgp/armencrypt.scm        | 2 +-
 tests/openpgp/armencryptp.scm       | 2 +-
 tests/openpgp/armor.scm             | 2 +-
 tests/openpgp/armsignencrypt.scm    | 2 +-
 tests/openpgp/armsigs.scm           | 2 +-
 tests/openpgp/clearsig.scm          | 2 +-
 tests/openpgp/compression.scm       | 2 +-
 tests/openpgp/conventional-mdc.scm  | 4 ++--
 tests/openpgp/conventional.scm      | 4 ++--
 tests/openpgp/decrypt-dsa.scm       | 2 +-
 tests/openpgp/decrypt.scm           | 2 +-
 tests/openpgp/detach.scm            | 2 +-
 tests/openpgp/detachm.scm           | 2 +-
 tests/openpgp/ecc.scm               | 9 ++++-----
 tests/openpgp/encrypt-dsa.scm       | 4 ++--
 tests/openpgp/encrypt-multifile.scm | 2 +-
 tests/openpgp/encrypt.scm           | 6 +++---
 tests/openpgp/encryptp.scm          | 2 +-
 tests/openpgp/seat.scm              | 2 +-
 tests/openpgp/signencrypt-dsa.scm   | 4 ++--
 tests/openpgp/signencrypt.scm       | 4 ++--
 tests/openpgp/sigs-dsa.scm          | 4 ++--
 tests/openpgp/sigs.scm              | 6 +++---
 25 files changed, 38 insertions(+), 39 deletions(-)

diff --git a/tests/openpgp/armdetach.scm b/tests/openpgp/armdetach.scm
index f458441..3bae28b 100755
--- a/tests/openpgp/armdetach.scm
+++ b/tests/openpgp/armdetach.scm
@@ -28,5 +28,5 @@
 			 --output ,tmp ,source ) usrpass1)
      (pipe:do
       (pipe:open source (logior O_RDONLY O_BINARY))
-      (pipe:spawn `(, at GPG --yes ,tmp)))))
+      (pipe:spawn `(, at GPG --yes --verify ,tmp -)))))
  (append plain-files data-files))
diff --git a/tests/openpgp/armdetachm.scm b/tests/openpgp/armdetachm.scm
index 8d30fd3..6812263 100755
--- a/tests/openpgp/armdetachm.scm
+++ b/tests/openpgp/armdetachm.scm
@@ -33,4 +33,4 @@
 			      (pipe:open file (logior O_RDONLY O_BINARY))
 			      (pipe:splice sink)))
 			   files)))
-   (pipe:spawn `(, at GPG --yes ,tmp))))
+   (pipe:spawn `(, at GPG --yes --verify ,tmp -))))
diff --git a/tests/openpgp/armencrypt.scm b/tests/openpgp/armencrypt.scm
index b9dfc1e..21131ea 100755
--- a/tests/openpgp/armencrypt.scm
+++ b/tests/openpgp/armencrypt.scm
@@ -26,6 +26,6 @@
    (tr:do
     (tr:open source)
     (tr:gpg usrpass1 `(--yes --passphrase-fd "0" -ea --recipient ,usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/armencryptp.scm b/tests/openpgp/armencryptp.scm
index d280902..4a00166 100755
--- a/tests/openpgp/armencryptp.scm
+++ b/tests/openpgp/armencryptp.scm
@@ -27,6 +27,6 @@
     (tr:open source)
     (tr:pipe-do
      (pipe:gpg `(--yes -ea --recipient ,usrname2))
-     (pipe:gpg '(--yes)))
+     (pipe:gpg '(--yes --decrypt)))
     (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/armor.scm b/tests/openpgp/armor.scm
index 7498ba7..6f57c78 100755
--- a/tests/openpgp/armor.scm
+++ b/tests/openpgp/armor.scm
@@ -764,4 +764,4 @@ wg7Md81a5RI3F2FG8747t9gX
 (tr:do
  (tr:pipe-do
   (pipe:echo nopad_armored_msg)
-  (pipe:gpg '())))
+  (pipe:gpg '(--decrypt))))
diff --git a/tests/openpgp/armsignencrypt.scm b/tests/openpgp/armsignencrypt.scm
index 18178f1..49eea07 100755
--- a/tests/openpgp/armsignencrypt.scm
+++ b/tests/openpgp/armsignencrypt.scm
@@ -26,6 +26,6 @@
    (tr:do
     (tr:open source)
     (tr:gpg usrpass1 `(--yes --passphrase-fd "0" -sea --recipient ,usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/armsigs.scm b/tests/openpgp/armsigs.scm
index 6e5d056..2fab729 100755
--- a/tests/openpgp/armsigs.scm
+++ b/tests/openpgp/armsigs.scm
@@ -26,6 +26,6 @@
    (tr:do
     (tr:open source)
     (tr:gpg usrpass1 `(--yes --passphrase-fd "0" -sa --recipient ,usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/clearsig.scm b/tests/openpgp/clearsig.scm
index cdbf603..a9f20f2 100755
--- a/tests/openpgp/clearsig.scm
+++ b/tests/openpgp/clearsig.scm
@@ -25,7 +25,7 @@
     (lettmp (signed)
 	    (call-popen `(, at GPG --output ,signed --yes
 				, at args ,source) input)
-	    (call-popen `(, at GPG --output ,sink --yes ,signed) ""))))
+	    (call-popen `(, at GPG --output ,sink --yes --verify ,signed) ""))))
 
 (for-each-p
  "Checking signing and verifying plain text messages"
diff --git a/tests/openpgp/compression.scm b/tests/openpgp/compression.scm
index f39c132..bab7572 100755
--- a/tests/openpgp/compression.scm
+++ b/tests/openpgp/compression.scm
@@ -30,7 +30,7 @@
        (tr:open source)
        (tr:gpg "" `(--yes --encrypt --recipient ,usrname2
 			  --compress-algo ,compression))
-       (tr:gpg "" '(--yes))
+       (tr:gpg "" '(--yes --decrypt))
        (tr:assert-identity source)))
     (append plain-files data-files)))
  (force all-compression-algos))
diff --git a/tests/openpgp/conventional-mdc.scm b/tests/openpgp/conventional-mdc.scm
index 5b009ae..af27fad 100755
--- a/tests/openpgp/conventional-mdc.scm
+++ b/tests/openpgp/conventional-mdc.scm
@@ -34,7 +34,7 @@
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k
 				  --force-mdc -c
 				  --cipher-algo ,algo))
-       (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
+       (tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
  (force all-cipher-algos))
@@ -45,6 +45,6 @@
    (tr:do
     (tr:open source)
      (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -cs))
-     (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
+     (tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
      (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/conventional.scm b/tests/openpgp/conventional.scm
index 612b992..4bca3c9 100755
--- a/tests/openpgp/conventional.scm
+++ b/tests/openpgp/conventional.scm
@@ -29,7 +29,7 @@
    (tr:do
     (tr:open source)
      (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -c))
-     (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
+     (tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
      (tr:assert-identity source)))
  '("plain-2" "data-32000"))
 
@@ -43,7 +43,7 @@
        (tr:open source)
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -c
 				  --cipher-algo ,algo))
-       (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
+       (tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
  (force all-cipher-algos))
diff --git a/tests/openpgp/decrypt-dsa.scm b/tests/openpgp/decrypt-dsa.scm
index 49f9534..640dfd2 100755
--- a/tests/openpgp/decrypt-dsa.scm
+++ b/tests/openpgp/decrypt-dsa.scm
@@ -25,6 +25,6 @@
  (lambda (name)
    (tr:do
     (tr:open (in-srcdir (string-append name "-pgp.asc")))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity name)))
  (list (car plain-files)))
diff --git a/tests/openpgp/decrypt.scm b/tests/openpgp/decrypt.scm
index ba8bcee..8dac38a 100755
--- a/tests/openpgp/decrypt.scm
+++ b/tests/openpgp/decrypt.scm
@@ -25,6 +25,6 @@
  (lambda (name)
    (tr:do
     (tr:open (in-srcdir (string-append name ".asc")))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity name)))
  plain-files)
diff --git a/tests/openpgp/detach.scm b/tests/openpgp/detach.scm
index 2180f78..ac2bc36 100755
--- a/tests/openpgp/detach.scm
+++ b/tests/openpgp/detach.scm
@@ -28,5 +28,5 @@
 			 --output ,tmp ,source ) usrpass1)
      (pipe:do
       (pipe:open source (logior O_RDONLY O_BINARY))
-      (pipe:spawn `(, at GPG --yes ,tmp)))))
+      (pipe:spawn `(, at GPG --yes --verify ,tmp -)))))
  (append plain-files data-files))
diff --git a/tests/openpgp/detachm.scm b/tests/openpgp/detachm.scm
index 1de8da9..0b64458 100755
--- a/tests/openpgp/detachm.scm
+++ b/tests/openpgp/detachm.scm
@@ -33,4 +33,4 @@
 			      (pipe:open file (logior O_RDONLY O_BINARY))
 			      (pipe:splice sink)))
 			   files)))
-   (pipe:spawn `(, at GPG --yes ,tmp))))
+   (pipe:spawn `(, at GPG --yes --verify ,tmp -))))
diff --git a/tests/openpgp/ecc.scm b/tests/openpgp/ecc.scm
index a40869d..2ea8c39 100755
--- a/tests/openpgp/ecc.scm
+++ b/tests/openpgp/ecc.scm
@@ -101,8 +101,7 @@ Ic1RdzgeCfosMF+l/zVRchcLKzenEQA=
      (lettmp (x y)
        (call-with-output-file
 	   x (lambda (p) (display (eval test (current-environment)) p)))
-       (call-check `(,(tool 'gpg) --verify ,x))
-       (call-check `(,(tool 'gpg) --output ,y ,x))
+       (call-check `(,(tool 'gpg) --output ,y --verify ,x))
        (unless (file=? y z) (fail "mismatch"))))
    '(msg_opaque_signed_256 msg_opaque_signed_384 msg_opaque_signed_521)))
 
@@ -181,7 +180,7 @@ Rg==
      (lettmp (x y)
        (call-with-output-file
 	   x (lambda (p) (display (eval test (current-environment)) p)))
-       (call-check `(, at GPG --yes --output ,y ,x))
+       (call-check `(, at GPG --yes --output ,y --decrypt ,x))
        (unless (file=? y z) (fail "mismatch"))))
    '(msg_encrypted_256 msg_encrypted_384 msg_encrypted_521)))
 
@@ -200,7 +199,7 @@ Rg==
       (tr:do
        (tr:open source)
        (tr:gpg "" `(--yes --encrypt --recipient ,keyid))
-       (tr:gpg "" '(--yes))
+       (tr:gpg "" '(--yes --decrypt))
        (tr:assert-identity source)))
     mainkeyids))
  (append plain-files data-files))
@@ -217,7 +216,7 @@ Rg==
       (tr:do
        (tr:open source)
        (tr:gpg "" `(--yes --sign --local-user ,keyid))
-       (tr:gpg "" '(--yes))
+       (tr:gpg "" '(--yes --decrypt))
        (tr:assert-identity source)))
     mainkeyids))
  (append plain-files data-files))
diff --git a/tests/openpgp/encrypt-dsa.scm b/tests/openpgp/encrypt-dsa.scm
index 7ac1916..0c5a2fd 100755
--- a/tests/openpgp/encrypt-dsa.scm
+++ b/tests/openpgp/encrypt-dsa.scm
@@ -26,7 +26,7 @@
    (tr:do
     (tr:open source)
     (tr:gpg "" `(--yes --encrypt --recipient ,dsa-usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
@@ -40,7 +40,7 @@
        (tr:open source)
        (tr:gpg "" `(--yes --encrypt --recipient ,dsa-usrname2
 			  --cipher-algo ,cipher))
-       (tr:gpg "" '(--yes))
+       (tr:gpg "" '(--yes --decrypt))
        (tr:assert-identity source)))
     (append plain-files data-files)))
  (force all-cipher-algos))
diff --git a/tests/openpgp/encrypt-multifile.scm b/tests/openpgp/encrypt-multifile.scm
index 4b76ff0..d55971c 100755
--- a/tests/openpgp/encrypt-multifile.scm
+++ b/tests/openpgp/encrypt-multifile.scm
@@ -34,6 +34,6 @@
  (lambda (source)
    (tr:do
     (tr:open (string-append source ".gpg"))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  files)
diff --git a/tests/openpgp/encrypt.scm b/tests/openpgp/encrypt.scm
index 4247aa8..1888a00 100755
--- a/tests/openpgp/encrypt.scm
+++ b/tests/openpgp/encrypt.scm
@@ -26,7 +26,7 @@
    (tr:do
     (tr:open source)
     (tr:gpg "" `(--yes --encrypt --recipient ,usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
@@ -40,7 +40,7 @@
        (tr:open source)
        (tr:gpg "" `(--yes --encrypt --recipient ,usrname2
 			  --cipher-algo ,cipher))
-       (tr:gpg "" '(--yes))
+       (tr:gpg "" '(--yes --decrypt))
        (tr:assert-identity source)))
     (append plain-files data-files)))
  (force all-cipher-algos))
@@ -56,6 +56,6 @@
     (tr:gpg "" `(--yes -v --no-keyring --encrypt
                  --recipient-file ,(in-srcdir key-file1)
                  --hidden-recipient-file ,(in-srcdir key-file2)))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  plain-files)
diff --git a/tests/openpgp/encryptp.scm b/tests/openpgp/encryptp.scm
index d939190..ccd5c7b 100755
--- a/tests/openpgp/encryptp.scm
+++ b/tests/openpgp/encryptp.scm
@@ -27,6 +27,6 @@
     (tr:open source)
     (tr:pipe-do
      (pipe:gpg `(--yes --encrypt --recipient ,usrname2))
-     (pipe:gpg '(--yes)))
+     (pipe:gpg '(--yes --decrypt)))
     (tr:assert-identity source)))
  (append plain-files data-files))
diff --git a/tests/openpgp/seat.scm b/tests/openpgp/seat.scm
index 22a5a67..31bd71a 100755
--- a/tests/openpgp/seat.scm
+++ b/tests/openpgp/seat.scm
@@ -26,6 +26,6 @@
    (tr:do
     (tr:open source)
     (tr:gpg usrpass1 '(--yes -seat -r two at example.com --passphrase-fd "0"))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-weak-identity source)))
  plain-files)
diff --git a/tests/openpgp/signencrypt-dsa.scm b/tests/openpgp/signencrypt-dsa.scm
index c969d2f..00ce625 100755
--- a/tests/openpgp/signencrypt-dsa.scm
+++ b/tests/openpgp/signencrypt-dsa.scm
@@ -28,7 +28,7 @@
     (tr:gpg usrpass1 `(--yes --passphrase-fd "0" -se
 			     -u ,dsa-usrname1
 			     --recipient ,dsa-usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
@@ -44,6 +44,6 @@
 			     -u ,dsa-usrname1
 			     --recipient ,dsa-usrname2
 			     --digest-algo ,hash))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity (car plain-files))))
  algos)
diff --git a/tests/openpgp/signencrypt.scm b/tests/openpgp/signencrypt.scm
index 35ac89a..3021eb4 100755
--- a/tests/openpgp/signencrypt.scm
+++ b/tests/openpgp/signencrypt.scm
@@ -26,14 +26,14 @@
    (tr:do
     (tr:open source)
     (tr:gpg usrpass1 `(--yes --passphrase-fd "0" -se --recipient ,usrname2))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
 (info "Checking bug 537: MDC problem with old style compressed packets.")
 (lettmp (tmp)
   (call-popen `(, at GPG --yes --passphrase-fd "0"
-		      --output ,tmp ,(in-srcdir "bug537-test.data.asc"))
+		      --output ,tmp --decrypt ,(in-srcdir "bug537-test.data.asc"))
 	      usrpass1)
   (if (not (string=? "4336AE2A528FAE091E73E59E325B588FEE795F9B"
 		     (cadar (gpg-hash-string `(--print-md SHA1 ,tmp) ""))))
diff --git a/tests/openpgp/sigs-dsa.scm b/tests/openpgp/sigs-dsa.scm
index f909078..d8494d5 100755
--- a/tests/openpgp/sigs-dsa.scm
+++ b/tests/openpgp/sigs-dsa.scm
@@ -26,7 +26,7 @@
    (tr:do
     (tr:open source)
     (tr:gpg "" `(--yes --sign --user ,dsa-usrname1))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
@@ -39,6 +39,6 @@
    (tr:do
     (tr:open (car plain-files))
     (tr:gpg "" `(--yes --sign --user ,dsa-usrname1 --digest-algo ,hash))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity (car plain-files))))
  algos)
diff --git a/tests/openpgp/sigs.scm b/tests/openpgp/sigs.scm
index 5a1efa7..c2298f9 100755
--- a/tests/openpgp/sigs.scm
+++ b/tests/openpgp/sigs.scm
@@ -26,7 +26,7 @@
    (tr:do
     (tr:open source)
     (tr:gpg "" '(--yes --sign))
-    (tr:gpg "" '(--yes))
+    (tr:gpg "" '(--yes --decrypt))
     (tr:assert-identity source)))
  (append plain-files data-files))
 
@@ -38,7 +38,7 @@
        (tr:do
 	(tr:open (car plain-files))
 	(tr:gpg "" `(--yes --sign --user ,usrname3 --digest-algo ,hash))
-	(tr:gpg "" '(--yes))
+	(tr:gpg "" '(--yes --decrypt))
 	(tr:assert-identity (car plain-files))))
    (if (not (equal? "MD5" hash))
        ;; Using the DSA sig key - only 160 bit or larger hashes
@@ -46,6 +46,6 @@
 	(tr:open (car plain-files))
 	(tr:gpg usrpass1
 		`(--yes --sign --passphrase-fd "0" --digest-algo ,hash))
-	(tr:gpg "" '(--yes))
+	(tr:gpg "" '(--yes --decrypt))
 	(tr:assert-identity (car plain-files)))))
  (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