diff options
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/zabbix_server/preprocessor/item_preproc_test.c | 110 | ||||
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/zabbix_server/Makefile.am | 2 | ||||
-rw-r--r-- | tests/zabbix_server/preprocessor/Makefile.am | 32 | ||||
-rw-r--r-- | tests/zabbix_server/preprocessor/zbx_item_preproc.c | 178 | ||||
-rw-r--r-- | tests/zabbix_server/preprocessor/zbx_item_preproc.yaml | 1132 | ||||
-rw-r--r-- | tests/zbxmockdata.c | 9 | ||||
-rw-r--r-- | tests/zbxmockdata.h | 1 |
11 files changed, 1367 insertions, 115 deletions
diff --git a/.gitattributes b/.gitattributes index 57e5c3d9b82..1a931228c88 100644 --- a/.gitattributes +++ b/.gitattributes @@ -343,7 +343,6 @@ src/zabbix_server/ipmi/ipmi_poller.c -text src/zabbix_server/ipmi/ipmi_poller.h -text src/zabbix_server/ipmi/ipmi_protocol.c -text src/zabbix_server/ipmi/ipmi_protocol.h -text -src/zabbix_server/preprocessor/item_preproc_test.c -text src/zabbix_server/preprocessor/preprocessing.c -text src/zabbix_server/scripts/Makefile.am -text src/zabbix_server/taskmanager/Makefile.am -text @@ -361,3 +360,4 @@ tests/libs/zbxdbcache/zbx_vc_add_values.yaml -text tests/libs/zbxdbcache/zbx_vc_get_value.yaml -text tests/libs/zbxdbcache/zbx_vc_get_values.yaml -text tests/libs/zbxhistory/zbx_history_get_values.yaml -text +tests/zabbix_server/preprocessor/zbx_item_preproc.yaml -text diff --git a/.gitignore b/.gitignore index 1095f730170..ba33e29bda1 100644 --- a/.gitignore +++ b/.gitignore @@ -346,6 +346,7 @@ src/zabbix_server/poller/.deps src/zabbix_server/poller/Makefile src/zabbix_server/poller/Makefile.in src/zabbix_server/preprocessor/.deps +src/zabbix_server/preprocessor/.dirstamp src/zabbix_server/preprocessor/Makefile src/zabbix_server/preprocessor/Makefile.in src/zabbix_server/proxypoller/.deps @@ -387,9 +388,7 @@ tests/libs/zbxalgo/.deps tests/libs/zbxalgo/Makefile tests/libs/zbxalgo/Makefile.in tests/libs/zbxalgo/evaluate -tests/libs/zbxcommon/..........[!!-~][ZBXNEXT-4724] tests/libs/zbxcommon/.deps -tests/libs/zbxcommon/ADFGIJLPST tests/libs/zbxcommon/Makefile tests/libs/zbxcommon/Makefile.in tests/libs/zbxcommon/calculate_item_nextcheck @@ -457,4 +456,12 @@ tests/libs/zbxsysinfo/linux/SYSTEM_CPU_SWITCHES tests/libs/zbxsysinfo/linux/VFS_FS_DISCOVERY tests/libs/zbxsysinfo/parse_item_key tests/libs/zbxsysinfo/process +tests/zabbix_server/Makefile +tests/zabbix_server/Makefile.in +tests/zabbix_server/preprocessor/..........[!!-~][ZBXNEXT-4724] +tests/zabbix_server/preprocessor/.deps +tests/zabbix_server/preprocessor/ADFGIJLPST +tests/zabbix_server/preprocessor/Makefile +tests/zabbix_server/preprocessor/Makefile.in +tests/zabbix_server/preprocessor/zbx_item_preproc /zabbix-*.tar.gz diff --git a/configure.ac b/configure.ac index a55081c3204..94fde883da0 100644 --- a/configure.ac +++ b/configure.ac @@ -1729,6 +1729,8 @@ if test -d tests; then tests/libs/zbxsysinfo/common/Makefile tests/libs/zbxcommshigh/Makefile tests/libs/zbxalgo/Makefile + tests/zabbix_server/Makefile + tests/zabbix_server/preprocessor/Makefile ) AC_DEFINE([HAVE_TESTS], [1], ["Define to 1 if tests directory is present"]) fi diff --git a/src/zabbix_server/preprocessor/item_preproc_test.c b/src/zabbix_server/preprocessor/item_preproc_test.c deleted file mode 100644 index f537cb63696..00000000000 --- a/src/zabbix_server/preprocessor/item_preproc_test.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -** Zabbix -** Copyright (C) 2001-2018 Zabbix SIA -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -**/ - -#include "../../libs/zbxcunit/zbxcunit.h" - -static void cu_xml_error_func(void *ctx, const char *msg, ...) -{ - ZBX_UNUSED(ctx); - ZBX_UNUSED(msg); -} - -static xmlGenericErrorFunc cu_xml_error_func_ptr = cu_xml_error_func; - -static int cu_init_empty() -{ - initGenericErrorDefaultFunc(&cu_xml_error_func_ptr); - return CUE_SUCCESS; -} - -static int cu_clean_empty() -{ - initGenericErrorDefaultFunc(NULL); - return CUE_SUCCESS; -} - -static void cu_test_xpath_preproc(const char *xml, const char *xpath, const char *result, int success) -{ - zbx_variant_t value; - char *errmsg = NULL; - int ret; - char description[MAX_STRING_LEN]; - - zbx_snprintf(description, sizeof(description), "XML:%s, xpath:%s", xml, xpath); - zbx_variant_set_str(&value, zbx_strdup(NULL, xml)); - - ret = item_preproc_xpath(&value, xpath, &errmsg); - ZBX_CU_ASSERT_INT_EQ_FATAL(description, ret, success); - - if (FAIL == ret) - { - ZBX_CU_ASSERT_PTR_NOT_NULL_FATAL(description, errmsg); - zbx_variant_clear(&value); - zbx_free(errmsg); - return; - } - - ZBX_CU_ASSERT_STRING_EQ_FATAL(description, value.data.str, result); - zbx_variant_clear(&value); -} - -static void test_item_preproc_xpath() -{ - struct zbx_cu_xml_input_t - { - const char *xml; - const char *xpath; - const char *result; - int success; /* expected return value */ - }; - - size_t i; - struct zbx_cu_xml_input_t data[] = { - {"", "", "", FAIL}, - {"<a>", "", "", FAIL}, - {"<a/>", "", "", FAIL}, - {"<a/>", "/a[\"]", "", FAIL}, - {"<a/>", "1 div 0", "", FAIL}, - {"<a/>", "-a", "", FAIL}, - {"<a/>", "/b", "", SUCCEED}, - {"<a/>", "3 div 2", "1.5", SUCCEED}, - {"<a/>", "/a", "<a/>", SUCCEED}, - {"<a>1</a>", "/a/text()", "1", SUCCEED}, - {"<a>1</a>", "string(/a)", "1", SUCCEED}, - {"<a b=\"10\">1</a>", "string(/a/@b)", "10", SUCCEED}, - {"<a><b x=\"1\"/><c x=\"2\"/><d x=\"1\"/></a>", "//*[@x=\"1\"]", "<b x=\"1\"/><d x=\"1\"/>", - SUCCEED}, - }; - - for (i = 0; ARRSIZE(data) > i; i++) - cu_test_xpath_preproc(data[i].xml, data[i].xpath, data[i].result, data[i].success); -} - -int ZBX_CU_DECLARE(item_preproc) -{ - CU_pSuite suite = NULL; - - /* test suite: zbx_user_macro_parse() */ - if (NULL == (suite = CU_add_suite("test_item_preproc_xpath", cu_init_empty, cu_clean_empty))) - return CU_get_error(); - - ZBX_CU_ADD_TEST(suite, test_item_preproc_xpath); - - return CUE_SUCCESS; -} diff --git a/tests/Makefile.am b/tests/Makefile.am index 93040649a2a..62aba8f6dc4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = \ . \ - libs + libs \ + zabbix_server noinst_LIBRARIES = \ libzbxmocktest.a \ diff --git a/tests/zabbix_server/Makefile.am b/tests/zabbix_server/Makefile.am new file mode 100644 index 00000000000..48defec4f66 --- /dev/null +++ b/tests/zabbix_server/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = \ + preprocessor diff --git a/tests/zabbix_server/preprocessor/Makefile.am b/tests/zabbix_server/preprocessor/Makefile.am new file mode 100644 index 00000000000..372ec85b33b --- /dev/null +++ b/tests/zabbix_server/preprocessor/Makefile.am @@ -0,0 +1,32 @@ +noinst_PROGRAMS = zbx_item_preproc + +JSON_LIBS = \ + $(top_srcdir)/tests/libzbxmocktest.a \ + $(top_srcdir)/tests/libzbxmockdata.a \ + $(top_srcdir)/src/libs/zbxjson/libzbxjson.a \ + $(top_srcdir)/src/libs/zbxalgo/libzbxalgo.a \ + $(top_srcdir)/src/libs/zbxcommon/libzbxcommon.a \ + $(top_srcdir)/src/libs/zbxcomms/libzbxcomms.a \ + $(top_srcdir)/src/libs/zbxcompress/libzbxcompress.a \ + $(top_srcdir)/src/libs/zbxcommon/libzbxcommon.a \ + $(top_srcdir)/src/libs/zbxregexp/libzbxregexp.a \ + $(top_srcdir)/src/libs/zbxnix/libzbxnix.a \ + $(top_srcdir)/src/libs/zbxcrypto/libzbxcrypto.a \ + $(top_srcdir)/src/libs/zbxsys/libzbxsys.a \ + $(top_srcdir)/src/libs/zbxlog/libzbxlog.a \ + $(top_srcdir)/src/libs/zbxsys/libzbxsys.a \ + $(top_srcdir)/src/libs/zbxconf/libzbxconf.a \ + $(top_srcdir)/tests/libzbxmockdata.a + +zbx_item_preproc_SOURCES = \ + ../../../src/zabbix_server/preprocessor/item_preproc.c \ + zbx_item_preproc.c + +zbx_item_preproc_LDADD = $(JSON_LIBS) + +if SERVER +zbx_item_preproc_LDADD += @SERVER_LIBS@ +zbx_item_preproc_LDFLAGS = @SERVER_LDFLAGS@ +endif + +zbx_item_preproc_CFLAGS = -I@top_srcdir@/tests @LIBXML2_CFLAGS@ diff --git a/tests/zabbix_server/preprocessor/zbx_item_preproc.c b/tests/zabbix_server/preprocessor/zbx_item_preproc.c new file mode 100644 index 00000000000..42eef3902e2 --- /dev/null +++ b/tests/zabbix_server/preprocessor/zbx_item_preproc.c @@ -0,0 +1,178 @@ +/* +** Zabbix +** Copyright (C) 2001-2018 Zabbix SIA +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +**/ + +#include "zbxmocktest.h" +#include "zbxmockdata.h" +#include "zbxmockassert.h" +#include "zbxmockutil.h" + +#include "common.h" +#include "zbxjson.h" +#include "dbcache.h" + +#include "../../../src/zabbix_server/preprocessor/item_preproc.h" + +static int str_to_preproc_type(const char *str) +{ + if (0 == strcmp(str, "ZBX_PREPROC_MULTIPLIER")) + return ZBX_PREPROC_MULTIPLIER; + if (0 == strcmp(str, "ZBX_PREPROC_RTRIM")) + return ZBX_PREPROC_RTRIM; + if (0 == strcmp(str, "ZBX_PREPROC_LTRIM")) + return ZBX_PREPROC_LTRIM; + if (0 == strcmp(str, "ZBX_PREPROC_TRIM")) + return ZBX_PREPROC_TRIM; + if (0 == strcmp(str, "ZBX_PREPROC_REGSUB")) + return ZBX_PREPROC_REGSUB; + if (0 == strcmp(str, "ZBX_PREPROC_BOOL2DEC")) + return ZBX_PREPROC_BOOL2DEC; + if (0 == strcmp(str, "ZBX_PREPROC_OCT2DEC")) + return ZBX_PREPROC_OCT2DEC; + if (0 == strcmp(str, "ZBX_PREPROC_HEX2DEC")) + return ZBX_PREPROC_HEX2DEC; + if (0 == strcmp(str, "ZBX_PREPROC_DELTA_VALUE")) + return ZBX_PREPROC_DELTA_VALUE; + if (0 == strcmp(str, "ZBX_PREPROC_DELTA_SPEED")) + return ZBX_PREPROC_DELTA_SPEED; + if (0 == strcmp(str, "ZBX_PREPROC_XPATH")) + return ZBX_PREPROC_XPATH; + if (0 == strcmp(str, "ZBX_PREPROC_JSONPATH")) + return ZBX_PREPROC_JSONPATH; + if (0 == strcmp(str, "ZBX_PREPROC_VALIDATE_RANGE")) + return ZBX_PREPROC_VALIDATE_RANGE; + if (0 == strcmp(str, "ZBX_PREPROC_VALIDATE_REGEX")) + return ZBX_PREPROC_VALIDATE_REGEX; + if (0 == strcmp(str, "ZBX_PREPROC_VALIDATE_NOT_REGEX")) + return ZBX_PREPROC_VALIDATE_NOT_REGEX; + if (0 == strcmp(str, "ZBX_PREPROC_ERROR_FIELD_JSON")) + return ZBX_PREPROC_ERROR_FIELD_JSON; + if (0 == strcmp(str, "ZBX_PREPROC_ERROR_FIELD_XML")) + return ZBX_PREPROC_ERROR_FIELD_XML; + if (0 == strcmp(str, "ZBX_PREPROC_ERROR_FIELD_REGEX")) + return ZBX_PREPROC_ERROR_FIELD_REGEX; + if (0 == strcmp(str, "ZBX_PREPROC_THROTTLE_VALUE")) + return ZBX_PREPROC_THROTTLE_VALUE; + if (0 == strcmp(str, "ZBX_PREPROC_THROTTLE_TIMED_VALUE")) + return ZBX_PREPROC_THROTTLE_TIMED_VALUE; + + fail_msg("unknow preprocessing step type: %s", str); + return FAIL; +} + +static int str_to_preproc_error_handler(const char *str) +{ + if (0 == strcmp(str, "ZBX_PREPROC_FAIL_DEFAULT")) + return ZBX_PREPROC_FAIL_DEFAULT; + if (0 == strcmp(str, "ZBX_PREPROC_FAIL_DISCARD_VALUE")) + return ZBX_PREPROC_FAIL_DISCARD_VALUE; + if (0 == strcmp(str, "ZBX_PREPROC_FAIL_SET_VALUE")) + return ZBX_PREPROC_FAIL_SET_VALUE; + if (0 == strcmp(str, "ZBX_PREPROC_FAIL_SET_ERROR")) + return ZBX_PREPROC_FAIL_SET_ERROR; + + fail_msg("unknow preprocessing error handler: %s", str); + return FAIL; +} + +static void read_value(const char *path, unsigned char *value_type, zbx_timespec_t *ts, + zbx_variant_t *value) +{ + zbx_mock_handle_t handle; + + handle = zbx_mock_get_parameter_handle(path); + *value_type = zbx_mock_str_to_value_type(zbx_mock_get_object_member_string(handle, "value_type")); + zbx_strtime_to_timespec(zbx_mock_get_object_member_string(handle, "time"), ts); + zbx_variant_set_str(value, zbx_strdup(NULL, zbx_mock_get_object_member_string(handle, "data"))); +} + +static void read_step(const char *path, zbx_preproc_op_t *op) +{ + zbx_mock_handle_t hop, hop_params, herror, herror_params; + + hop = zbx_mock_get_parameter_handle(path); + op->type = str_to_preproc_type(zbx_mock_get_object_member_string(hop, "type")); + + if (ZBX_MOCK_SUCCESS == zbx_mock_object_member(hop, "params", &hop_params)) + op->params = (char *)zbx_mock_get_object_member_string(hop, "params"); + else + op->params = ""; + + if (ZBX_MOCK_SUCCESS == zbx_mock_object_member(hop, "error_handler", &herror)) + op->error_handler = str_to_preproc_error_handler(zbx_mock_get_object_member_string(hop, "error_handler")); + else + op->error_handler = ZBX_PREPROC_FAIL_DEFAULT; + + if (ZBX_MOCK_SUCCESS == zbx_mock_object_member(hop, "error_handler_params", &herror_params)) + op->error_handler_params = (char *)zbx_mock_get_object_member_string(hop, "error_handler_params"); + else + op->error_handler_params = ""; +} + +void zbx_mock_test_entry(void **state) +{ + zbx_variant_t value; + unsigned char value_type; + zbx_timespec_t ts; + zbx_item_history_value_t history, *phistory = NULL; + zbx_preproc_op_t op; + int returned_ret, expected_ret; + char *error = NULL; + + ZBX_UNUSED(state); + + read_value("in.value", &value_type, &ts, &value); + read_step("in.step", &op); + + if (ZBX_MOCK_SUCCESS == zbx_mock_parameter_exists("in.history")) + { + history.itemid = 0; + read_value("in.history", &history.value_type, &history.timestamp, &history.value); + phistory = &history; + } + + returned_ret = zbx_item_preproc(0, value_type, &value, &ts, &op, phistory, &error); + expected_ret = zbx_mock_str_to_return_code(zbx_mock_get_parameter_string("out.return")); + zbx_mock_assert_result_eq("zbx_item_preproc() return", expected_ret, returned_ret); + + if (SUCCEED == returned_ret) + { + if (ZBX_MOCK_SUCCESS == zbx_mock_parameter_exists("out.value")) + { + if (ZBX_VARIANT_NONE == value.type) + fail_msg("preprocessing result was empty value"); + + zbx_variant_convert(&value, ZBX_VARIANT_STR); + del_zeros(value.data.str); + zbx_mock_assert_str_eq("processed value", zbx_mock_get_parameter_string("out.value"), + value.data.str); + } + else + { + if (ZBX_VARIANT_NONE != value.type) + fail_msg("expected empty value, but got %s", zbx_variant_value_desc(&value)); + } + } + + if (FAIL == returned_ret && ZBX_MOCK_SUCCESS == zbx_mock_parameter_exists("out.error")) + zbx_mock_assert_str_eq("error message", zbx_mock_get_parameter_string("out.error"), error); + + zbx_variant_clear(&value); + zbx_free(error); + +} diff --git a/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml b/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml new file mode 100644 index 00000000000..8ed7a0f0680 --- /dev/null +++ b/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml @@ -0,0 +1,1132 @@ +--- +test case: string(10) * 10 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 10 +out: + return: SUCCEED + value: 100 +--- +test case: string(10x) * 10 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10x + step: + type: ZBX_PREPROC_MULTIPLIER + params: 10 +out: + return: FAIL +--- +test case: string(10) * abc +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_MULTIPLIER + params: abc +out: + return: FAIL +--- +test case: string(1.5) * 3 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 1.5 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 3 +out: + return: SUCCEED + value: 4.5 +--- +test case: uint64(1.5) * 3 +in: + value: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:15:00 +03:00 + data: 1.5 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 3 +out: + return: SUCCEED + value: 3 +--- +test case: uint64(3) * 1.5 +in: + value: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:15:00 +03:00 + data: 3 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 1.5 +out: + return: SUCCEED + value: 4 +--- +test case: float(1.5) * 3 +in: + value: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:15:00 +03:00 + data: 1.5 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 3 +out: + return: SUCCEED + value: 4.5 +--- +test case: float(3) * 1.5 +in: + value: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:15:00 +03:00 + data: 3 + step: + type: ZBX_PREPROC_MULTIPLIER + params: 1.5 +out: + return: SUCCEED + value: 4.5 +--- +test case: rtrim(01abc01, 01) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_RTRIM + params: 01 +out: + return: SUCCEED + value: 01abc +--- +test case: rtrim(01abc01, abc) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_RTRIM + params: abc +out: + return: SUCCEED + value: 01abc01 +--- +test case: ltrim(01abc01, 01) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_LTRIM + params: 01 +out: + return: SUCCEED + value: abc01 +--- +test case: ltrim(01abc01, abc) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_LTRIM + params: abc +out: + return: SUCCEED + value: 01abc01 +--- +test case: trim(01abc01, 01) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_TRIM + params: 01 +out: + return: SUCCEED + value: abc +--- +test case: trim(01abc01, abc) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 01abc01 + step: + type: ZBX_PREPROC_TRIM + params: abc +out: + return: SUCCEED + value: 01abc01 +--- +test case: regsub("test 123 number", "([0-9]+", 1) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: test 123 number + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+\n\\1" +out: + return: FAIL +--- +test case: regsub("test 123 number", "([0-9]+)", \1) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: test 123 number + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+)\n\\1" +out: + return: SUCCEED + value: 123 +--- +test case: regsub("test 123 number", "([0-9]+)", x\1y) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: test 123 number + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+)\nx\\1y" +out: + return: SUCCEED + value: x123y +--- +test case: regsub("test 123 number", "([0-9]+)", ) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: test 123 number + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+)" +out: + return: FAIL +--- +test case: regsub("test abc number", "([0-9]+)", \1) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: test abc number + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+)\n\\1" +out: + return: FAIL +--- +test case: regsub("", "([0-9]+)", \1) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: + step: + type: ZBX_PREPROC_REGSUB + params: "([0-9]+)\n\\1" +out: + return: FAIL +--- +test case: regsub("", "^$", ok) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "" + step: + type: ZBX_PREPROC_REGSUB + params: "^$\nok" +out: + return: SUCCEED + value: ok +--- +test case: bool2dec() +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: FAIL +--- +test case: bool2dec(abc) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "abc" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: FAIL +--- +test case: bool2dec(1) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "1" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(0) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "0" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(true) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "true" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(t) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "t" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(yes) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "yes" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(y) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "y" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(ok) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "ok" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(on) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "on" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 1 +--- +test case: bool2dec(false) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "false" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(f) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "f" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(no) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "no" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(n) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "n" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(err) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "err" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: bool2dec(off) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "off" + step: + type: ZBX_PREPROC_BOOL2DEC +out: + return: SUCCEED + value: 0 +--- +test case: oct2dec(0) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 0 + step: + type: ZBX_PREPROC_OCT2DEC +out: + return: SUCCEED + value: 0 +--- +test case: oct2dec(7) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 7 + step: + type: ZBX_PREPROC_OCT2DEC +out: + return: SUCCEED + value: 7 +--- +test case: oct2dec(10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_OCT2DEC +out: + return: SUCCEED + value: 8 +--- +test case: oct2dec(8) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 8 + step: + type: ZBX_PREPROC_OCT2DEC +out: + return: FAIL +--- +test case: hex2dec(F) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: F + step: + type: ZBX_PREPROC_HEX2DEC +out: + return: SUCCEED + value: 15 +--- +test case: hex2dec(a) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: a + step: + type: ZBX_PREPROC_HEX2DEC +out: + return: SUCCEED + value: 10 +--- +test case: hex2dec(10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_HEX2DEC +out: + return: SUCCEED + value: 16 +--- +test case: hex2dec(g) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: g + step: + type: ZBX_PREPROC_HEX2DEC +out: + return: FAIL +--- +test case: hex2dec(ff ff) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: ff ff + step: + type: ZBX_PREPROC_HEX2DEC +out: + return: SUCCEED + value: 65535 +--- +test case: deltavalue(5, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:00 +03:00 + data: 5 + step: + type: ZBX_PREPROC_DELTA_VALUE +out: + return: SUCCEED + value: 5 +--- +test case: deltavalue(-4.5, 5.5) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 5.5 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:00 +03:00 + data: -4.5 + step: + type: ZBX_PREPROC_DELTA_VALUE +out: + return: SUCCEED + value: 10 +--- +test case: deltavalue(10, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_DELTA_VALUE +out: + return: SUCCEED + value: 0 +--- +test case: deltavalue(10, 9) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 0 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_DELTA_VALUE +out: + return: SUCCEED +--- +test case: deltavalue(0, 1.5) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 1.5 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:00 +03:00 + data: 0 + step: + type: ZBX_PREPROC_DELTA_VALUE +out: + return: SUCCEED + value: 1.5 +--- +test case: deltaspeed(2, 1, 10s) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 1 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:50 +03:00 + data: 2 + step: + type: ZBX_PREPROC_DELTA_SPEED +out: + return: SUCCEED +--- +test case: deltaspeed(1, 2, -10s) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 2 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:15:10 +03:00 + data: 1 + step: + type: ZBX_PREPROC_DELTA_SPEED +out: + return: SUCCEED +--- +test case: deltaspeed(1, 2, 10s) +in: + value: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:15:00 +03:00 + data: 2 + history: + value_type: ITEM_VALUE_TYPE_FLOAT + time: 2017-10-29 03:14:50 +03:00 + data: 1 + step: + type: ZBX_PREPROC_DELTA_SPEED +out: + return: SUCCEED + value: 0.1 +--- +test case: deltaspeed(2, 3, 10s) +in: + value: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:15:00 +03:00 + data: 3 + history: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:14:50 +03:00 + data: 2 + step: + type: ZBX_PREPROC_DELTA_SPEED +out: + return: SUCCEED + value: 0 +--- +test case: deltaspeed(2, 3, 1s) +in: + value: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:15:00 +03:00 + data: 3 + history: + value_type: ITEM_VALUE_TYPE_UINT64 + time: 2017-10-29 03:14:59 +03:00 + data: 2 + step: + type: ZBX_PREPROC_DELTA_SPEED +out: + return: SUCCEED + value: 1 +--- +test case: xpath1 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: "" + step: + type: ZBX_PREPROC_XPATH + params: "" +out: + return: FAIL +--- +test case: xpath2 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: "" +out: + return: FAIL +--- +test case: xpath3 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: |- + /a["] +out: + return: FAIL +--- +test case: xpath4 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: 1 div 0 +out: + return: FAIL +--- +test case: xpath5 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: -a +out: + return: FAIL +--- +test case: xpath6 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: /b +out: + return: SUCCEED + value: "" +--- +test case: xpath7 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: 3 div 2 +out: + return: SUCCEED + value: 1.5 +--- +test case: xpath8 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a/> + step: + type: ZBX_PREPROC_XPATH + params: /a +out: + return: SUCCEED + value: <a/> +--- +test case: xpath9 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a>1</a> + step: + type: ZBX_PREPROC_XPATH + params: /a/text() +out: + return: SUCCEED + value: 1 +--- +test case: xpath10 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a>1</a> + step: + type: ZBX_PREPROC_XPATH + params: string(/a) +out: + return: SUCCEED + value: 1 +--- +test case: xpath11 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a b="10">1</a> + step: + type: ZBX_PREPROC_XPATH + params: string(/a/@b) +out: + return: SUCCEED + value: 10 +--- +test case: xpath12 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: <a><b x="1"/><c x="2"/><d x="1"/></a> + step: + type: ZBX_PREPROC_XPATH + params: //*[@x="1"] +out: + return: SUCCEED + value: <b x="1"/><d x="1"/> +--- +test case: jsonpath1 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc + step: + type: ZBX_PREPROC_JSONPATH + params: +out: + return: FAIL +--- +test case: jsonpath2 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: |- + {"a":{"b":[1, 2, 3]}} + step: + type: ZBX_PREPROC_JSONPATH + params: $abc +out: + return: FAIL +--- +test case: jsonpath3 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: |- + {"a":{"b":[1, 2, 3]}} + step: + type: ZBX_PREPROC_JSONPATH + params: $.abc +out: + return: FAIL +--- +test case: jsonpath4 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: |- + {"a":{"b":[1, 2, 3]}} + step: + type: ZBX_PREPROC_JSONPATH + params: $.a +out: + return: SUCCEED + value: |- + {"b":[1, 2, 3]} +--- +test case: jsonpath5 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: |- + {"a":{"b":[1, 2, 3]}} + step: + type: ZBX_PREPROC_JSONPATH + params: $.a['b'] +out: + return: SUCCEED + value: |- + [1, 2, 3] +--- +test case: jsonpath6 +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: |- + {"a":{"b":[1, 2, 3]}} + step: + type: ZBX_PREPROC_JSONPATH + params: $.a['b'][1] +out: + return: SUCCEED + value: 2 +--- +test case: validate_range(1, 5, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 1 + step: + type: ZBX_PREPROC_VALIDATE_RANGE + params: |- + 5 + 10 +out: + return: FAIL +--- +test case: validate_range(5, 5, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 5 + step: + type: ZBX_PREPROC_VALIDATE_RANGE + params: |- + 5 + 10 +out: + return: SUCCEED + value: 5 +--- +test case: validate_range(10, 5, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10 + step: + type: ZBX_PREPROC_VALIDATE_RANGE + params: |- + 5 + 10 +out: + return: SUCCEED + value: 10 +--- +test case: validate_range(10.1, 5, 10) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: 10.1 + step: + type: ZBX_PREPROC_VALIDATE_RANGE + params: |- + 5 + 10 +out: + return: FAIL +--- +test case: validate_regex(abc 123 xyz, ([0-9+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc 123 xyz + step: + type: ZBX_PREPROC_VALIDATE_REGEX + params: ([0-9+) +out: + return: FAIL +--- +test case: validate_regex(abc opq xyz, ([0-9]+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc opq xyz + step: + type: ZBX_PREPROC_VALIDATE_REGEX + params: ([0-9]+) +out: + return: FAIL +--- +test case: validate_regex(abc 123 xyz, ([0-9]+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc 123 xyz + step: + type: ZBX_PREPROC_VALIDATE_REGEX + params: ([0-9]+) +out: + return: SUCCEED + value: abc 123 xyz +--- +test case: validate_regex(abc 123 xyz, ([0-9+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc 123 xyz + step: + type: ZBX_PREPROC_VALIDATE_NOT_REGEX + params: ([0-9+) +out: + return: FAIL +--- +test case: validate_regex(abc opq xyz, ([0-9]+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc opq xyz + step: + type: ZBX_PREPROC_VALIDATE_NOT_REGEX + params: ([0-9]+) +out: + return: SUCCEED + value: abc opq xyz +--- +test case: validate_regex(abc 123 xyz, ([0-9]+)) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: abc 123 xyz + step: + type: ZBX_PREPROC_VALIDATE_NOT_REGEX + params: ([0-9]+) +out: + return: FAIL +--- +test case: string(10) * 10 (discard) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: x + step: + type: ZBX_PREPROC_MULTIPLIER + params: 10 + error_handler: ZBX_PREPROC_FAIL_DISCARD_VALUE +out: + return: SUCCEED +--- +test case: string(10) * 10 (set value) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: x + step: + type: ZBX_PREPROC_MULTIPLIER + params: 10 + error_handler: ZBX_PREPROC_FAIL_SET_VALUE + error_handler_params: invalid +out: + return: SUCCEED + value: invalid +--- +test case: string(10) * 10 (set error) +in: + value: + value_type: ITEM_VALUE_TYPE_STR + time: 2017-10-29 03:15:00 +03:00 + data: x + step: + type: ZBX_PREPROC_MULTIPLIER + params: 10 + error_handler: ZBX_PREPROC_FAIL_SET_ERROR + error_handler_params: custom error +out: + return: FAIL + error: custom error +... + + diff --git a/tests/zbxmockdata.c b/tests/zbxmockdata.c index 2129c918c1a..ffbca1a843c 100644 --- a/tests/zbxmockdata.c +++ b/tests/zbxmockdata.c @@ -612,7 +612,9 @@ static zbx_mock_error_t zbx_mock_parameter_rec(const yaml_node_t *node, const ch /* end of the path, return whatever has been found */ if ('\0' == *pnext) { - *parameter = zbx_mock_handle_alloc(node); + if (NULL != parameter) + *parameter = zbx_mock_handle_alloc(node); + return ZBX_MOCK_SUCCESS; } @@ -662,6 +664,11 @@ zbx_mock_error_t zbx_mock_parameter(const char *path, zbx_mock_handle_t *paramet return zbx_mock_parameter_rec(root, path, parameter); } +zbx_mock_error_t zbx_mock_parameter_exists(const char *path) +{ + return zbx_mock_parameter_rec(root, path, NULL); +} + zbx_mock_error_t zbx_mock_uint64(zbx_mock_handle_t object, zbx_uint64_t *value) { const zbx_mock_pool_handle_t *handle; diff --git a/tests/zbxmockdata.h b/tests/zbxmockdata.h index af8f5e22bb9..7bd92315cf4 100644 --- a/tests/zbxmockdata.h +++ b/tests/zbxmockdata.h @@ -59,6 +59,7 @@ zbx_mock_error_t zbx_mock_vector_element(zbx_mock_handle_t vector, zbx_mock_hand zbx_mock_error_t zbx_mock_string(zbx_mock_handle_t string, const char **value); zbx_mock_error_t zbx_mock_binary(zbx_mock_handle_t binary, const char **value, size_t *length); zbx_mock_error_t zbx_mock_parameter(const char *path, zbx_mock_handle_t *parameter); +zbx_mock_error_t zbx_mock_parameter_exists(const char *path); zbx_mock_error_t zbx_mock_uint64(zbx_mock_handle_t object, zbx_uint64_t *value); /* date/time support */ |