From: Lucjan Bryndza Date: Wed, 29 May 2019 14:02:46 +0000 (+0200) Subject: Search endpoint script fail silently X-Git-Tag: 4.0.0-ONAP~71 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F88776%2F4;p=integration.git Search endpoint script fail silently When nmap or other commands are not installed on the system script fail silently without any information Signed-off-by: Lucjan Bryndza Change-Id: I599b987e223f88617aefa2c0de6cdcbbf3ff50b7 Issue-ID: SECCOM-231 --- diff --git a/test/security/check_for_http_endpoints.sh b/test/security/check_for_http_endpoints.sh index c0da42858..5c2ba20c3 100755 --- a/test/security/check_for_http_endpoints.sh +++ b/test/security/check_for_http_endpoints.sh @@ -29,6 +29,17 @@ # Output: List of pods exposing http endpoints # +#Prerequisities commands list +REQ_APPS=(kubectl nmap awk column sort paste grep wc) + +# Check for prerequisites apps +for cmd in "${REQ_APPS[@]}"; do + if ! [ -x "$(command -v "$cmd")" ]; then + echo "Error: command $cmd is not installed" + exit 1 + fi +done + if [ "$#" -lt 1 ]; then echo "Usage: $0 " exit 1