Skip to content

Commit

Permalink
Unit-test: Only use shellcheck if easyrsa is present in ./easyrsa3/
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Apr 3, 2022
1 parent 7227adc commit ee51c1c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions op-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ github_url='https://raw.githubusercontent.com'
if [ -e "shellcheck" ] && [ "$EASYRSA_NIX" ]; then
chmod +x shellcheck
./shellcheck -V
./shellcheck easyrsa3/easyrsa
if [ -e easyrsa3/easyrsa ];then
./shellcheck easyrsa3/easyrsa
else
echo "* easyrsa binary not present, using path, no shellcheck"
fi
elif [ "$EASYRSA_NIX" ]; then
github_target='OpenVPN/easyrsa-unit-tests/master/shellcheck'
curl -O "${github_url}/${github_target}"
[ -e "shellcheck" ] || { echo "shellcheck download failed."; exit 9; }
chmod +x shellcheck
./shellcheck -V
./shellcheck easyrsa3/easyrsa
if [ -e easyrsa3/easyrsa ];then
./shellcheck easyrsa3/easyrsa
else
echo "* easyrsa binary not present, using path, no shellcheck"
fi
rm -f ./shellcheck
fi

Expand All @@ -30,7 +38,9 @@ estat=0

if [ -e "easyrsa-unit-tests.sh" ]; then
if sh easyrsa-unit-tests.sh "$verb"; then
: # ok
if [ "$EASYRSA_NIX" ]; then
sh easyrsa-unit-tests.sh "$verb" -x || estat=2
fi
else
estat=1
fi
Expand Down

0 comments on commit ee51c1c

Please sign in to comment.