From b22207754ce0fbeb9234388f995994e33f4139f1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 24 Apr 2014 00:29:43 +0200 Subject: tests: Only fake gpg agent if gpg2. --- tests/setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3