From 20232a9ecd5f4909f0965b3abc1f80a70671076e Mon Sep 17 00:00:00 2001 From: Lucid One Date: Wed, 7 Mar 2018 10:38:41 -0500 Subject: Check that testing prerequisites are installed --- test/setup.sh | 18 +++++++++++------- 1 file 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 -- cgit v1.2.3