From ee51c1cc9102b42882861962c32a62363d5227f1 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sun, 3 Apr 2022 22:03:58 +0100 Subject: [PATCH] Unit-test: Only use shellcheck if easyrsa is present in ./easyrsa3/ Signed-off-by: Richard T Bonhomme --- op-test.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/op-test.sh b/op-test.sh index 00c3e417e..ee62e714d 100644 --- a/op-test.sh +++ b/op-test.sh @@ -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 @@ -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