diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2019-07-26 12:32:48 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2019-07-26 12:32:48 +0300 |
commit | 17137408d29d004e7ec1512ab7e6b7d30ff28ebe (patch) | |
tree | 85991b6df7fa8f8d49845b48c43038b049b68121 /include/tests_logging | |
parent | 8321b986891eae1f928434ea9ac0003ae743ab67 (diff) |
Use IsRunning exit code instead of variable
Diffstat (limited to 'include/tests_logging')
-rw-r--r-- | include/tests_logging | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/include/tests_logging b/include/tests_logging index f8492c90..b7bb260e 100644 --- a/include/tests_logging +++ b/include/tests_logging @@ -65,8 +65,7 @@ Register --test-no LOGG-2132 --weight L --network NO --category security --description "Check for running syslog-ng daemon" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Searching for syslog-ng daemon in process list" - IsRunning syslog-ng - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "syslog-ng"; then LogText "Result: Found syslog-ng in process list" Display --indent 4 --text "- Checking Syslog-NG status" --result "${STATUS_FOUND}" --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -104,8 +103,7 @@ Register --test-no LOGG-2136 --weight L --network NO --category security --description "Check for running systemd journal daemon" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Searching for systemd journal daemon in process list" - IsRunning systemd-journal - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "systemd-journal"; then Display --indent 4 --text "- Checking systemd journal status" --result "${STATUS_FOUND}" --color GREEN SYSTEMD_JOURNAL_RUNNING=1 Report "syslog_daemon_present=1" @@ -122,8 +120,7 @@ Register --test-no LOGG-2210 --weight L --network NO --category security --description "Check for running metalog daemon" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Searching for metalog daemon in process list" - IsRunning metalog - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "metalog"; then LogText "Result: Found metalog in process list" Display --indent 4 --text "- Checking Metalog status" --result "${STATUS_FOUND}" --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -143,8 +140,7 @@ Register --test-no LOGG-2230 --weight L --network NO --category security --description "Check for running RSyslog daemon" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Searching for RSyslog daemon in process list" - IsRunning rsyslogd - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "rsyslogd"; then LogText "Result: Found rsyslogd in process list" Display --indent 4 --text "- Checking RSyslog status" --result "${STATUS_FOUND}" --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -164,8 +160,7 @@ Register --test-no LOGG-2240 --weight L --network NO --category security --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" - IsRunning rfc3195d - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "rfc3195d"; then LogText "Result: Found rfc3195d in process list" Display --indent 4 --text "- Checking RFC 3195 daemon status" --result "${STATUS_FOUND}" --color GREEN SYSLOG_DAEMON_PRESENT=1 @@ -190,8 +185,7 @@ if [ ${RSYSLOG_RUNNING} -eq 0 -a ${SYSTEMD_JOURNAL_RUNNING} -eq 0 ]; then # Search for klogd, but ignore other lines related to klogd (like dd with input/output file) #FIND=$(${PSBINARY} ax | ${GREPBINARY} "klogd" | ${GREPBINARY} -v "dd" | ${GREPBINARY} -v "grep") - IsRunning klogd - if [ ${RUNNING} -eq 1 ]; then + if IsRunning "klogd"; then LogText "Result: klogd running" Display --indent 4 --text "- Checking klogd" --result "${STATUS_FOUND}" --color GREEN else @@ -212,8 +206,7 @@ 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 - IsRunning minilogd - if [ ${RUNNING} -eq 0 ]; then + if IsRunning "minilogd"; then Display --indent 4 --text "- Checking minilogd instances" --result "${STATUS_NOT_FOUND}" --color WHITE LogText "Result: No minilogd is running" else |