Function to check and abort deploy if $message seen in karaf.log 22/28422/1
authorJamo Luhrsen <jluhrsen@redhat.com>
Thu, 15 Oct 2015 06:03:07 +0000 (23:03 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Thu, 15 Oct 2015 06:03:07 +0000 (23:03 -0700)
Change-Id: Ib5143527f08c32c8a6916034bde45a122e6a259a
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
jjb/integration/include-raw-integration-deploy-controller-run-test.sh
jjb/integration/include-raw-integration-start-cluster-run-test.sh

index cc617f7a80453ef303639ef56c65423729a9fc14..ff0d118fbed29c1b1a63baf39d23935284079dbd 100644 (file)
@@ -1,3 +1,4 @@
+#@IgnoreInspection BashAddShebang
 # Activate robotframework virtualenv
 # ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
 # script.
@@ -87,13 +88,18 @@ sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
 echo "Listing all open ports on controller system"
 netstat -natu
 
-# checking for any bind exceptions in log which could indicate a port conflict
-if grep --quiet 'BindException: Address already in use' /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then
-    echo BindException found: Possible port conflict
-    echo "Dumping Karaf log..."
-    cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
-    exit 1
-fi
+function exit_on_log_file_message {
+    echo "looking for \"\$1\" in log file"
+    if grep --quiet "\$1" /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then
+        echo ABORTING: found "\$1"
+        echo "Dumping Karaf log..."
+        cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
+        exit 1
+    fi
+}
+
+exit_on_log_file_message 'BindException: Address already in use'
+exit_on_log_file_message 'server is unhealthy'
 
 EOF
 
index 4f74dc9086b70e9a18d0b914fc9b721a8bf14433..cc311cd84a1d476489017c9fa4d39488245283be 100644 (file)
@@ -1,3 +1,4 @@
+#@IgnoreInspection BashAddShebang
 # Activate robotframework virtualenv
 # ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
 # script.
@@ -42,13 +43,18 @@ sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
 echo "Listing all open ports on controller system"
 netstat -natu
 
-# checking for any bind exceptions in log which could indicate a port conflict
-if grep --quiet 'BindException: Address already in use' /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then
-    echo BindException found: Possible port conflict
-    echo "Dumping Karaf log..."
-    cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
-    exit 1
-fi
+function exit_on_log_file_message {
+    echo "looking for \"\$1\" in log file"
+    if grep --quiet "\$1" /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then
+        echo ABORTING: found "\$1"
+        echo "Dumping Karaf log..."
+        cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
+        exit 1
+    fi
+}
+
+exit_on_log_file_message 'BindException: Address already in use'
+exit_on_log_file_message 'server is unhealthy'
 
 EOF