From 816ed64edd5f42c114bda166878008e6a3877215 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 22 Oct 2016 16:17:44 +0100 Subject: [PATCH 1/1] Test suite: Introduce setup/gnupg To work around #841143 and improve performance by amortising gnupg migration cost. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ tests/lib | 9 +++++---- tests/lib-core | 2 +- tests/setup/gnupg | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 tests/setup/gnupg diff --git a/debian/changelog b/debian/changelog index 571ab679..55433891 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. -- diff --git a/tests/lib b/tests/lib index 3fe3ab06..39763c61 100644 --- 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 diff --git a/tests/lib-core b/tests/lib-core index b01a6eae..056a1bc1 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -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 index 00000000..97cdb649 --- /dev/null +++ b/tests/setup/gnupg @@ -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. -- 2.30.2