summaryrefslogtreecommitdiff
path: root/tests/setup/gnupg
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup/gnupg')
-rwxr-xr-xtests/setup/gnupg30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/setup/gnupg b/tests/setup/gnupg
new file mode 100755
index 0000000..43a5c96
--- /dev/null
+++ b/tests/setup/gnupg
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+mkdir -p $tmp/gnupg
+cp $troot/gnupg/* $tmp/gnupg
+chmod go-rw $tmp/gnupg/*
+
+export GNUPGHOME=$tmp/gnupg
+
+cat >$tmp/gnupg/gpg-agent.conf <<END
+log-file $tmp/gnupg/AGENT.log
+END
+#debug-all
+
+setup='
+ : ${DGIT_TEST_REAL_GPG_AGENT:=$(type -p gpg-agent)}
+ export DGIT_TEST_REAL_GPG_AGENT=$(type -p gpg-agent)
+ export DGIT_STUNT_AGENT=$troot/tstunt/gpg-agent
+ export GNUPGHOME
+ t-tstunt gpg
+'
+
+eval "$setup"
+
+gpg --list-secret
+
+t-setup-done 'GNUPGHOME' 'gnupg' "$setup"
+
+t-ok