From 4c17757f634d4f5242ad1c7e23b702d62536e923 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 30 Sep 2007 13:08:59 +0000 Subject: [PATCH] Exit if zombie jobs or log errors git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5692 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/check_for_zombie_jobs | 10 ++++++++++ regress/scripts/functions | 10 ++++++++++ regress/tests/auto-label-test | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/regress/scripts/check_for_zombie_jobs b/regress/scripts/check_for_zombie_jobs index 768c4e1731..d35a5ffc37 100755 --- a/regress/scripts/check_for_zombie_jobs +++ b/regress/scripts/check_for_zombie_jobs @@ -23,12 +23,14 @@ status $1 quit END_OF_DATA +export zstat grep "No Jobs running." tmp/dir.out 2>&1 >/dev/null if [ $? != 0 ] ; then echo " " echo " !!!! Zombie Jobs in Director !!!!" echo " !!!! Zombie Jobs in Director !!!!" >>test.out echo " " + zstat=1 exit 1 fi grep "No Jobs running." tmp/fd.out 2>&1 >/dev/null @@ -37,6 +39,7 @@ if [ $? != 0 ] ; then echo " !!!! Zombie Jobs in File daemon !!!!" echo " !!!! Zombie Jobs in File daemon !!!!" >>test.out echo " " + zstat=1 exit 1 fi grep "No Jobs running." tmp/sd.out 2>&1 >/dev/null @@ -45,6 +48,7 @@ if [ $? != 0 ] ; then echo " !!!! Zombie Jobs in Storage daemon !!!!" echo " !!!! Zombie Jobs in Storage daemon !!!!" >>test.out echo " " + zstat=1 exit 1 fi grep "ERROR" tmp/log*.out 2>&1 >/dev/null @@ -52,7 +56,9 @@ if [ $? = 0 ] ; then echo " " echo " !!!! ERROR in log output !!!!" echo " !!!! ERROR in log output !!!!" >>test.out + grep "ERROR" tmp/log*.out echo " " + zstat=1 exit 1 fi grep "Fatal Error" tmp/log*.out 2>&1 >/dev/null @@ -60,7 +66,9 @@ if [ $? = 0 ] ; then echo " " echo " !!!! Fatal Error in log output !!!!" echo " !!!! Fatal Error in log output !!!!" >>test.out + grep "Fatal Error" tmp/log*.out echo " " + zstat=1 exit 1 fi @@ -69,6 +77,8 @@ if [ $? = 0 ] ; then echo " " echo " !!!! glibc detected Error in log output !!!!" echo " !!!! glibc detected Error in log output !!!!" >>test.out + grep "glibc detected" tmp/log*.out echo " " + zstat=1 exit 1 fi diff --git a/regress/scripts/functions b/regress/scripts/functions index 0028283472..798bc0a786 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -9,6 +9,7 @@ start_test() echo " === Starting $TestName at `date +%R:%S` ===" echo " === Starting $TestName at `date +%R:%S` ===" >>working/log echo " " + export zstat } require_root() @@ -38,6 +39,7 @@ set_debug() run_bacula() { debug_wait + zstat=0 if test "$debug" -eq 1 ; then bin/bacula-ctl-sd start bin/bacula-ctl-fd start @@ -137,6 +139,14 @@ check_restore_tmp_build_diff() end_test() { + if [ $zstat != 0 ] ; then + echo " " + echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " + echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " >>test.out + echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out + echo " " + exit 1 + fi if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then echo " " echo " " diff --git a/regress/tests/auto-label-test b/regress/tests/auto-label-test index 247f30303c..4a952b4f95 100755 --- a/regress/tests/auto-label-test +++ b/regress/tests/auto-label-test @@ -56,7 +56,7 @@ quit END_OF_SCRIPT run_bacula -check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=File || exit 1 stop_bacula check_two_logs -- 2.39.5