chiark / gitweb /
Test suite: Introduce setup/gnupg
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 Oct 2016 15:17:44 +0000 (16:17 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 22 Oct 2016 18:47:04 +0000 (19:47 +0100)
To work around #841143 and improve performance by amortising gnupg
migration cost.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib
tests/lib-core
tests/setup/gnupg [new file with mode: 0755]

index 571ab6799107977d656f2b60e6e2e110a74ef16c..55433891db33bb7119a0c968d648581f93a5cd42 100644 (file)
@@ -2,6 +2,8 @@ dgit (2.5~) unstable; urgency=medium
 
   * dgit-maint-merge(7): New tutorial manpage from Sean Whitton.
   * Test suite bugfixes.
+  * Test suite: Introduce setup/gnupg, to work around #841143
+    and improve performance by amortising gnupg migration cost.
 
  --
 
index 3fe3ab06af8e240a98b59b1cea874e4f49dfe18a..39763c6169430058237f1b3d5752b072866798f6 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -55,10 +55,6 @@ env -0 >$tmp/.save-env
 
 ln -f $troot/ssh ssh
 
-mkdir -p $tmp/gnupg
-cp $troot/gnupg/* $tmp/gnupg
-chmod go-rw $tmp/gnupg/*
-
 export DEBCHANGE_VENDOR=dpkg
 
 mkdir -p $tmp/incoming
@@ -937,3 +933,8 @@ t-alt-test () {
        t-${t%%-*}
        t-chain-test "${t#*-}"
 }
+
+case "$0" in
+*/gnupg) ;;
+*)     t-setup-import gnupg    ;;
+esac
index b01a6eae5cda188dde8700bc7e621998319309d8..056a1bc188c49f568df6046af46f94d2907c7f73 100644 (file)
@@ -19,7 +19,7 @@ t-set-using-tmp () {
        export HOME=$tmp
        export DGIT_TEST_DUMMY_DIR=$tmp
        export DGIT_TEST_TMP=$tmp
-       export GNUPGHOME=$tmp/gnupg
+       export GNUPGHOME=$tmp/nonexistent
 }
 
 t-filter-out-git-hyphen-dir () {
diff --git a/tests/setup/gnupg b/tests/setup/gnupg
new file mode 100755 (executable)
index 0000000..97cdb64
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+mkdir -p $tmp/gnupg
+cp $troot/gnupg/* $tmp/gnupg
+chmod go-rw $tmp/gnupg/*
+
+export GNUPGHOME=$tmp/gnupg
+
+gpg --list-secret
+
+t-setup-done 'GNUPGHOME' 'gnupg'
+
+echo ok.