summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup/gnupg16
-rwxr-xr-xtests/tstunt/gpg6
-rwxr-xr-xtests/tstunt/gpg-agent6
3 files changed, 27 insertions, 1 deletions
diff --git a/tests/setup/gnupg b/tests/setup/gnupg
index d23ecfa..6100bf5 100755
--- a/tests/setup/gnupg
+++ b/tests/setup/gnupg
@@ -8,8 +8,22 @@ 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='
+ 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'
+t-setup-done 'GNUPGHOME' 'gnupg' "$setup"
t-ok
diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg
new file mode 100755
index 0000000..d71aa63
--- /dev/null
+++ b/tests/tstunt/gpg
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+exec \
+$DGIT_TEST_REAL_GPG \
+ --agent-program=$DGIT_STUNT_AGENT \
+ "$@"
diff --git a/tests/tstunt/gpg-agent b/tests/tstunt/gpg-agent
new file mode 100755
index 0000000..96ae839
--- /dev/null
+++ b/tests/tstunt/gpg-agent
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+exec \
+$DGIT_TEST_REAL_GPG_AGENT \
+ --debug-quick-random \
+ "$@"