diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-24 00:29:43 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-24 00:29:43 +0200 |
commit | b22207754ce0fbeb9234388f995994e33f4139f1 (patch) | |
tree | 11b2dc3af27f7958f66f9459e37b6fe3fe19ddb0 | |
parent | af8b52b2dcb5ae13b7064d1300408863e4d957e1 (diff) |
tests: Only fake gpg agent if gpg2.
-rwxr-xr-x | tests/setup.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/setup.sh b/tests/setup.sh index d23cda9..67c489f 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -34,13 +34,14 @@ alias pass="command \"$PASS\"" # Note: the assumption is the test key is unencrypted. export GNUPGHOME="$TEST_HOME/gnupg/" chmod 700 "$GNUPGHOME" -alias gpg="command gpg" -which gpg2 &>/dev/null && alias gpg="command gpg2" +GPG="gpg" +which gpg2 &>/dev/null && GPG="gpg2" +alias gpg="command $GPG" # We don't want to use any running agent. # We want an agent to appear to pass to be running. # We don't need a real agent. Hence: -export GPG_AGENT_INFO=" " +[[ $GPG == "gpg2" ]] && export GPG_AGENT_INFO=" " || unset GPG_AGENT_INFO KEY1="CF90C77B" # pass test key 1 KEY2="D774A374" # pass test key 2 |