diff options
author | mboelen <michael@cisofy.com> | 2014-09-19 03:17:05 +0400 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2014-09-19 03:17:05 +0400 |
commit | 6b7362cefd14cfdbd5ef181a2dc9983fa46cb631 (patch) | |
tree | 914ac2b92137be09fea9c13e15f56a07099ae950 | |
parent | 805cdf6bf5ab235c5d42f25463136d93cd2bb9cf (diff) |
Generic code enhancements
-rw-r--r-- | include/tests_logging | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/tests_logging b/include/tests_logging index ff9a48f3..ad07ea4c 100644 --- a/include/tests_logging +++ b/include/tests_logging @@ -65,8 +65,8 @@ Register --test-no LOGG-2132 --weight L --network NO --description "Check for running syslog-ng daemon" if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: Searching for syslog-ng daemon in process list" - FIND=`${PSBINARY} ax | grep "/syslog-ng" | grep -v "grep"` - if [ ! "${FIND}" = "" ]; then + IsRunning syslog-ng + if [ ${RUNNING} -eq 1 ]; then logtext "Result: Found syslog-ng in process list" Display --indent 4 --text "- Checking Syslog-NG status" --result FOUND --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -103,8 +103,8 @@ Register --test-no LOGG-2210 --weight L --network NO --description "Check for running metalog daemon" if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: Searching for metalog daemon in process list" - FIND=`${PSBINARY} ax | grep "metalog" | grep -v "grep"` - if [ ! "${FIND}" = "" ]; then + IsRunning metalog + if [ ${RUNNING} -eq 1 ]; then logtext "Result: Found metalog in process list" Display --indent 4 --text "- Checking Metalog status" --result FOUND --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -122,8 +122,8 @@ Register --test-no LOGG-2230 --weight L --network NO --description "Check for running RSyslog daemon" if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: Searching for RSyslog daemon in process list" - FIND=`${PSBINARY} ax | grep "rsyslogd" | grep -v "grep"` - if [ ! "${FIND}" = "" ]; then + IsRunning rsyslogd + if [ ${RUNNING} -eq 1 ]; then logtext "Result: Found rsyslogd in process list" Display --indent 4 --text "- Checking RSyslog status" --result FOUND --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -141,8 +141,8 @@ Register --test-no LOGG-2240 --weight L --network NO --description "Check for running RFC 3195 compliant daemon" if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: Searching for RFC 3195 daemon (alias syslog reliable) in process list" - FIND=`${PSBINARY} ax | grep "rfc3195d" | grep -v "grep"` - if [ ! "${FIND}" = "" ]; then + IsRunning rfc3195d + if [ ${RUNNING} -eq 1 ]; then logtext "Result: Found rfc3195d in process list" Display --indent 4 --text "- Checking RFC 3195 daemon status" --result FOUND --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -166,8 +166,9 @@ logtext "Test: Searching kernel logger daemon (klogd)" if [ ${RSYSLOG_RUNNING} -eq 0 ]; then # Search for klogd, but ignore other lines related to klogd (like dd with input/output file) - FIND=`${PSBINARY} ax | grep "klogd" | grep -v "dd" | grep -v "grep"` - if [ ! "${FIND}" = "" ]; then + #FIND=`${PSBINARY} ax | grep "klogd" | grep -v "dd" | grep -v "grep"` + IsRunning klogd + if [ ${RUNNING} -eq 1 ]; then logtext "Result: klogd running" Display --indent 4 --text "- Checking klogd" --result FOUND --color GREEN else @@ -189,8 +190,8 @@ if [ ${SKIPTEST} -eq 0 ]; then logtext "Result: Checking for unkilled minilogd instances" # Search for minilogd. It shouldn't be running normally, if another syslog daemon is started - FIND=`${PSBINARY} ax | grep "minilogd" | grep -v "grep"` - if [ "${FIND}" = "" ]; then + IsRunning minilogd + if [ ${RUNNING} -eq 0 ]; then Display --indent 4 --text "- Checking minilogd instances" --result "NOT FOUND" --color WHITE logtext "Result: No minilogd is running" else |