diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2017-04-30 18:59:35 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2017-04-30 18:59:35 +0300 |
commit | 4ecb9d4d05124b813cd4d7ddcaf5671c2f4c4765 (patch) | |
tree | 282f5a4e9e3530ada04d00bda3e8ac118cf70bbd /include/tests_databases | |
parent | 5ccd0912cf74f5d3dd07e5ed5fe0e6a30571fbb5 (diff) |
[bulk change] cleaning up, code enhancements, initialization of variables, and new tests
Diffstat (limited to 'include/tests_databases')
-rw-r--r-- | include/tests_databases | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/tests_databases b/include/tests_databases index ed2b60d7..42f14665 100644 --- a/include/tests_databases +++ b/include/tests_databases @@ -86,7 +86,7 @@ if IsVerbose; then Display --indent 4 --text "- Checking MySQL root password" --result "${STATUS_OK}" --color GREEN; fi AddHP 2 2 fi - else + else LogText "Test skipped, MySQL daemon not running or no MySQL client available" fi # @@ -118,14 +118,14 @@ LogText "Result: found MongoDB configuration file (${FILE})" LogText "Test: determine authorization setting in new style YAML format" AUTH_IN_CONFIG=$(${GREPBINARY} "authorization: enabled" ${FILE} | ${GREPBINARY} -E -v "(^#|#auth)") - if [ ! -z "${AUTH_IN_CONFIG}" ]; then + if HasData "${AUTH_IN_CONFIG}"; then LogText "Result: GOOD, found authorization option enabled in configuration file (YAML format)" MONGODB_AUTHORIZATION_ENABLED=1 else LogText "Result: did NOT find authorization option enabled in configuration file (with YAML format)" LogText "Test: now searching for old style configuration (auth = true) in configuration file" AUTH_IN_CONFIG=$(${GREPBINARY} "auth = true" ${FILE} | ${GREPBINARY} -v "noauth" | ${GREPBINARY} -E -v "(^#|#auth)") - if [ -z "${AUTH_IN_CONFIG}" ]; then + if IsEmpty "${AUTH_IN_CONFIG}"; then LogText "Result: did NOT find auth = true in configuration file" else LogText "Result: GOOD, found authorization option enabled in configuration file (old format)" @@ -139,7 +139,7 @@ # Now check authorization on the command line if [ ${MONGODB_AUTHORIZATION_ENABLED} -eq 0 ]; then - if [ ! -z "${PGREPBINARY}" ]; then + if HasData "${PGREPBINARY}"; then AUTH_ON_CMDLINE=$(for I in $(${PGREPBINARY} mongo); do cat /proc/${I}/cmdline | xargs -0 echo | ${GREPBINARY} -E "\-\-auth( |$)"; done) if [ ! -z "${AUTH_ON_CMDLINE}" ]; then LogText "Result: found authorization enabled via mongod parameter"; MONGODB_AUTHORIZATION_ENABLED=1; fi else |