This is an automated email from the ASF dual-hosted git repository.

otto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/metron-bro-plugin-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new 946e664  METRON-2020 Running run_end_to_end.sh with docker give 
warning if bash < 4.0 (JonZeolla via ottobackwards) closes 
apache/metron-bro-plugin-kafka#31
946e664 is described below

commit 946e664b0a56fd99bfb505e976bd07ad02f5c733
Author: JonZeolla <zeo...@gmail.com>
AuthorDate: Thu Feb 28 14:43:21 2019 -0500

    METRON-2020 Running run_end_to_end.sh with docker give warning if bash &lt; 
4.0 (JonZeolla via ottobackwards) closes apache/metron-bro-plugin-kafka#31
---
 docker/run_end_to_end.sh          | 11 ++++++++++-
 docker/scripts/analyze_results.sh | 17 ++++++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/docker/run_end_to_end.sh b/docker/run_end_to_end.sh
index ae06715..a1dfb6a 100755
--- a/docker/run_end_to_end.sh
+++ b/docker/run_end_to_end.sh
@@ -25,14 +25,23 @@ set -o pipefail
 
 function help {
   echo " "
-  echo "usage: ${0}"
+  echo "USAGE"
   echo "    --skip-docker-build             [OPTIONAL] Skip build of bro 
docker machine."
   echo "    --data-path                     [OPTIONAL] The pcap data path. 
Default: ./data"
   echo "    -h/--help                       Usage information."
   echo " "
+  echo "COMPATABILITY"
+  echo "     bash >= 4.0 is required."
   echo " "
 }
 
+# Require bash >= 4
+if (( BASH_VERSINFO[0] < 4 )); then
+  >&2 echo "ERROR> bash >= 4.0 is required" >&2
+  help
+  exit 1
+fi
+
 SKIP_REBUILD_BRO=false
 
 ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
diff --git a/docker/scripts/analyze_results.sh 
b/docker/scripts/analyze_results.sh
index 790ec18..01c026f 100755
--- a/docker/scripts/analyze_results.sh
+++ b/docker/scripts/analyze_results.sh
@@ -23,6 +23,12 @@ set -e # errexit
 set -E # errtrap
 set -o pipefail
 
+declare -r txtDEFAULT='\033[0m'
+# shellcheck disable=SC2034
+declare -r txtERROR='\033[0;31m'
+# shellcheck disable=SC2034
+declare -r txtWARN='\033[0;33m'
+
 #
 # Analyzes the results.csv files to identify issues
 #
@@ -51,17 +57,18 @@ function _echo() {
   esac
 }
 
+# Require bash >= 4
+if (( BASH_VERSINFO[0] < 4 )); then
+  _echo ERROR "bash >= 4.0 is required"
+  exit 1
+fi
+
 SCRIPT_NAME=$(basename -- "$0")
 TEST_DIRECTORY=
 declare -A LOGS_WITH_UNEQUAL_RESULTS
 declare -a LOG_NAMES
 declare -A OVERALL_LOG_CARDINALITY
 declare -A LOG_ISSUE_COUNT
-declare -r txtDEFAULT='\033[0m'
-# shellcheck disable=SC2034
-declare -r txtERROR='\033[0;31m'
-# shellcheck disable=SC2034
-declare -r txtWARN='\033[0;33m'
 
 # Handle command line options
 for i in "$@"; do

Reply via email to