From b2f13a2f92716cd1e917d7ad00082f38f91e268d Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Wed, 22 Feb 2017 15:06:19 +0100 Subject: [TIME-3148] new test for TZ variable --- db/tests.db | 1 + include/tests_time | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/db/tests.db b/db/tests.db index 5cccb882..a245de54 100644 --- a/db/tests.db +++ b/db/tests.db @@ -384,6 +384,7 @@ TIME-3128:test:security:time::Check preffered time source: TIME-3132:test:security:time::Check NTP falsetickers: TIME-3136:test:security:time:Linux:Check NTP protocol version: #TIME-3146:test:security:time:Linux:Check /etc/default/ntpdate: +TIME-3148:test:performance:time:Linux:Check TZ variable: TIME-3160:test:security:time:Linux:Check empty NTP step-tickers: TIME-3170:test:security:time::Check configuration files: TOOL-5002:test:security:tooling::Checking for automation tools: diff --git a/include/tests_time b/include/tests_time index ee53deb2..cab4db0c 100644 --- a/include/tests_time +++ b/include/tests_time @@ -400,6 +400,18 @@ #if [ ${SKIPTEST} -eq 0 ]; then # ################################################################################# +# + # Test : TIME-3148 + # Description : Check if TZ variable is set (Linux) + # Notes : without TZ variable set, a lot of unneeded calls might be performed. + Register --test-no TIME-3148 --os Linux --weight L --network NO --category performance --description "Check TZ variable" + if [ ${SKIPTEST} -eq 0 ]; then + if [ -z "${TZ}" ]; then + Report "tz_variable_empty=1" + fi + fi +# +################################################################################# # # Test : TIME-3160 # Description : Check empty NTP step-tickers @@ -413,7 +425,7 @@ if [ -z ${FILE} ]; then LogText "Result: ${FILE} is empty. The step-tickers contain no configured NTP servers" Display --indent 2 --text "- Checking NTP step-tickers file" --result "EMPTY FILE" --color YELLOW - ReportSuggestion ${TEST_NO} "Use step-rickers file for quicker time synchronization" + ReportSuggestion ${TEST_NO} "Use step-tickers file for quicker time synchronization" else LogText "Result: /etc/ntp/step-tickers is not empty, which is fine" Display --indent 2 --text "- Checking NTP step-tickers file" --result "${STATUS_OK}" --color GREEN @@ -443,14 +455,6 @@ LogText "Result: test skipped because ${FILE} not found" fi fi -# -################################################################################# -# -# For VMs check ntpd.conf : tinker panic 0 -# - -WaitForKeyPress - # ################################################################################# # @@ -486,6 +490,10 @@ WaitForKeyPress # ################################################################################# # + +# For VMs check ntpd.conf : tinker panic 0 + + # OS Time daemons Configuration file # -------------------------------------------- # AIX xntpd /etc/ntp.conf @@ -495,6 +503,8 @@ WaitForKeyPress # OpenBSD ntpd /etc/ntpd.conf # Solaris xntpd /etc/inet/ntp.conf +WaitForKeyPress + # #================================================================================ # Lynis - Security Auditing and System Hardening for Linux and UNIX - https://cisofy.com -- cgit v1.2.3