aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLucid One <LucidOne@users.noreply.github.com>2018-03-07 10:38:41 -0500
committerTad Fisher <tadfisher@gmail.com>2018-03-07 11:05:49 -0800
commit20232a9ecd5f4909f0965b3abc1f80a70671076e (patch)
treef26792ef7a5c100d7a96a0ec97f9acf6fbf3679b /test
parent742aaaab15a78bce52fbe5bed4bcc29cdfca7ee8 (diff)
downloadpass-otp-20232a9ecd5f4909f0965b3abc1f80a70671076e.tar.gz
pass-otp-20232a9ecd5f4909f0965b3abc1f80a70671076e.zip
Check that testing prerequisites are installed
Diffstat (limited to 'test')
-rw-r--r--test/setup.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/setup.sh b/test/setup.sh
index f407164..2ec49d3 100644
--- a/test/setup.sh
+++ b/test/setup.sh
@@ -41,17 +41,21 @@ export GIT_WORK_TREE="$PASSWORD_STORE_DIR"
git config --global user.email "Pass-Automated-Testing-Suite@zx2c4.com"
git config --global user.name "Pass Automated Testing Suite"
-PASS=`which pass`
-if [[ ! -e $PASS ]]; then
- echo "Could not find pass command"
- exit 1
-fi
+PASS=$(which pass)
+[[ -e $PASS ]] || error "Could not find pass command"
+
+EXPECT=$(which expect)
+[[ -e $EXPECT ]] || error "Could not find expect command"
+
+OAUTHTOOL=$(which oathtool)
+[[ -e $OAUTHTOOL ]] || error "Could not find oathtool command"
+
+GPG=$(which gpg2) || GPG=$(which gpg)
+[[ -e $GPG ]] || error "Could not find gpg command"
# Note: the assumption is the test key is unencrypted.
export GNUPGHOME="$TEST_HOME/gnupg/"
chmod 700 "$GNUPGHOME"
-GPG="gpg"
-which gpg2 &>/dev/null && GPG="gpg2"
# We don't want any currently running agent to conflict.
unset GPG_AGENT_INFO