From 1e2b9bf2d4ed4edc9ed70c51f414bb2890074a21 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Jun 2020 16:34:53 +0200 Subject: tests: Move OpenPGP helpers to (guix tests gnupg). * tests/git-authenticate.scm (key-id): Remove. (%ed25519-public-key-file, %ed25519-secret-key-file) (%ed25519bis-public-key-file, %ed25519bis-secret-key-file) (read-openpgp-packet, key-fingerprint): Move to... * guix/tests/gnupg.scm: ... here. --- tests/git-authenticate.scm | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'tests/git-authenticate.scm') diff --git a/tests/git-authenticate.scm b/tests/git-authenticate.scm index 97990acaea..a06176c16b 100644 --- a/tests/git-authenticate.scm +++ b/tests/git-authenticate.scm @@ -32,31 +32,6 @@ (define-module (test-git-authenticate) ;; Test the (guix git-authenticate) tools. -(define %ed25519-public-key-file - (search-path %load-path "tests/ed25519.key")) -(define %ed25519-secret-key-file - (search-path %load-path "tests/ed25519.sec")) -(define %ed25519bis-public-key-file - (search-path %load-path "tests/ed25519bis.key")) -(define %ed25519bis-secret-key-file - (search-path %load-path "tests/ed25519bis.sec")) - -(define (read-openpgp-packet file) - (get-openpgp-packet - (open-bytevector-input-port - (call-with-input-file file read-radix-64)))) - -(define key-fingerprint - (compose openpgp-format-fingerprint - openpgp-public-key-fingerprint - read-openpgp-packet)) - -(define (key-id file) - (define id - (openpgp-public-key-id (read-openpgp-packet))) - - (string-pad (number->string id 16) 16 #\0)) - (define (gpg+git-available?) (and (which (git-command)) (which (gpg-command)) (which (gpgconf-command)))) -- cgit v1.2.3 From 7b06781a58326f251c4af6340379d68e3cb98adb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 20 Jun 2020 12:55:59 +0200 Subject: tests: Skip tests that requires gpg when gpg is unavailable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partly fixes . Reported by Simen Endsjø . * tests/git-authenticate.scm ("signed commits, SHA1 signature"): Use 'gpg+git-available?' in skip guard. --- tests/git-authenticate.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/git-authenticate.scm') diff --git a/tests/git-authenticate.scm b/tests/git-authenticate.scm index a06176c16b..865481f7c5 100644 --- a/tests/git-authenticate.scm +++ b/tests/git-authenticate.scm @@ -56,7 +56,7 @@ (define (gpg+git-available?) #:keyring-reference "master") 'failed))))) -(unless (which (git-command)) (test-skip 1)) +(unless (which (gpg+git-available?)) (test-skip 1)) (test-assert "signed commits, SHA1 signature" (with-fresh-gnupg-setup (list %ed25519-public-key-file %ed25519-secret-key-file) -- cgit v1.2.3