浏览代码

Improved validate_database / adjusted backup name

Jaap Marcus 5 年之前
父节点
当前提交
5fd1e75f8a
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      test/test.bats

+ 3 - 5
test/test.bats

@@ -143,11 +143,9 @@ function validate_database(){
     host_str=$(grep "HOST='localhost'" $HESTIA/conf/mysql.conf)
     host_str=$(grep "HOST='localhost'" $HESTIA/conf/mysql.conf)
     parse_object_kv_list "$host_str"
     parse_object_kv_list "$host_str"
     if [ -z $PORT ]; then PORT=3306; fi
     if [ -z $PORT ]; then PORT=3306; fi
-    if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
-        echo "Error: mysql config parsing failed"
-        log_event "$E_PARSING" "$ARGUMENTS"
-        exit $E_PARSING
-    fi
+    
+    refute [ -z "$HOST" ]
+    refute [ -z "$PORT" ]
     
     
     # Create an connection to verify correct username / password has been set correctly
     # Create an connection to verify correct username / password has been set correctly
     tmpfile=$(mktemp /tmp/mysql.XXXXXX)
     tmpfile=$(mktemp /tmp/mysql.XXXXXX)