summaryrefslogtreecommitdiff
path: root/test/testenv
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-09-29 18:44:29 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-09-29 19:30:26 -0400
commit36c7b060591d5980ceaaa2c58197f0d390ecc8f5 (patch)
tree832c7c2602cb90a481b810d452a3b2be82e7b756 /test/testenv
parentd32af77762e742771cb2ea9b33b2dac58563bcfb (diff)
test: Have GPG stop dropping private keys in my home directory
Diffstat (limited to 'test/testenv')
-rwxr-xr-xtest/testenv17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/testenv b/test/testenv
index faad4e1..4fc2860 100755
--- a/test/testenv
+++ b/test/testenv
@@ -80,6 +80,23 @@
'_sudo "$@"' \
> "$destdir/usr/bin/testsudo"
chmod 755 "$destdir/usr/bin/testsudo"
+ # Hack to work around GnuPG being stupid with locating gpg-agent's socket
+ install -Dm755 /dev/stdin "$destdir/usr/bin/gpg" <<-'eot'
+ #!/bin/bash
+ export GNUPGHOME="${GNUPGHOME:-$HOME/.gnupg}"
+ if [[ $GNUPGHOME = "$HOME/.gnupg" ]]; then
+ export HOME=/var/empty
+ fi
+ exec /usr/bin/gpg "$@"
+ eot
+ install -Dm755 /dev/stdin "$destdir/usr/bin/gpg-connect-agent" <<-'eot'
+ #!/bin/bash
+ export GNUPGHOME="${GNUPGHOME:-$HOME/.gnupg}"
+ if [[ $GNUPGHOME = "$HOME/.gnupg" ]]; then
+ export HOME=/var/empty
+ fi
+ exec /usr/bin/gpg-connect-agent "$@"
+ eot
# Run the tests
command -- "$@"