[PATCH] tests: move FINGERPRINT definition to add_gnupg_home

Subject: [PATCH] tests: move FINGERPRINT definition to add_gnupg_home

Date: Sat, 20 Apr 2019 13:40:39 -0400

To: Notmuch Mail

Cc:

From: Daniel Kahn Gillmor


If a test has added a GnuPG homedir, it may well want to know the
fingerprint.  This saves us from having to redefine this magic string
in multiple places when more tests evenutally use the GnuPG homedir.
---
 test/T350-crypto.sh | 2 --
 test/test-lib.sh    | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh
index 73aa58de..7b10f434 100755
--- a/test/T350-crypto.sh
+++ b/test/T350-crypto.sh
@@ -10,8 +10,6 @@ test_description='PGP/MIME signature verification and decryption'
 ##################################################
 
 add_gnupg_home
-# Change this if we ship a new test key
-FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381"
 
 test_begin_subtest "emacs delivery of signed message"
 test_expect_success \
diff --git a/test/test-lib.sh b/test/test-lib.sh
index fca5277d..58909ee7 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -117,6 +117,9 @@ add_gnupg_home ()
 	echo debug-quick-random >> "$GNUPGHOME"/gpg.conf
     fi
     echo no-emit-version >> "$GNUPGHOME"/gpg.conf
+
+    # Change this if we ship a new test key
+    FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381"
 }
 
 # Each test should start with something like this, after copyright notices:
-- 
2.20.1

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: