summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib9
-rw-r--r--tests/lib-core2
-rwxr-xr-xtests/setup/gnupg15
3 files changed, 21 insertions, 5 deletions
diff --git a/tests/lib b/tests/lib
index 3fe3ab0..39763c6 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 b01a6ea..056a1bc 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 0000000..97cdb64
--- /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.