From d88f2134e60aa1bb8daba26418722445de4bf46d Mon Sep 17 00:00:00 2001 From: Artjoms Rimdjonoks Date: Fri, 19 Feb 2021 11:32:27 +0200 Subject: ........S. [DEV-1836] added warning for unsupported DB version --- tests/libs/zbxdbcache/Makefile.am | 1 + tests/libs/zbxserver/Makefile.am | 1 + tests/mocks/valuecache/valuecache_mock.c | 5 +++++ 3 files changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/libs/zbxdbcache/Makefile.am b/tests/libs/zbxdbcache/Makefile.am index bb6690c133f..2f64538bf88 100644 --- a/tests/libs/zbxdbcache/Makefile.am +++ b/tests/libs/zbxdbcache/Makefile.am @@ -83,6 +83,7 @@ COMMON_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_add_values \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ + -Wl,--wrap=zbx_elastic_check_version \ -Wl,--wrap=time zbx_vc_get_values_SOURCES = \ diff --git a/tests/libs/zbxserver/Makefile.am b/tests/libs/zbxserver/Makefile.am index bfb601796df..97950e028bf 100755 --- a/tests/libs/zbxserver/Makefile.am +++ b/tests/libs/zbxserver/Makefile.am @@ -151,6 +151,7 @@ VALUECACHE_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_add_values \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ + -Wl,--wrap=zbx_elastic_check_version \ -Wl,--wrap=time \ -Wl,--wrap=substitute_simple_macros \ -Wl,--wrap=DCget_data_expected_from \ diff --git a/tests/mocks/valuecache/valuecache_mock.c b/tests/mocks/valuecache/valuecache_mock.c index f8564929d4f..28ee87d8a51 100644 --- a/tests/mocks/valuecache/valuecache_mock.c +++ b/tests/mocks/valuecache/valuecache_mock.c @@ -54,6 +54,7 @@ int __wrap_zbx_history_get_values(zbx_uint64_t itemid, int value_type, int start int __wrap_zbx_history_add_values(const zbx_vector_ptr_t *history); int __wrap_zbx_history_sql_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); int __wrap_zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); +void __wrap_zbx_elastic_check_version(void); time_t __wrap_time(time_t *ptr); void __wrap_zbx_timespec(zbx_timespec_t *ts); @@ -685,6 +686,10 @@ int __wrap_zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char val return SUCCEED; } +void __wrap_zbx_elastic_check_version(void) +{ +} + /* * cache allocator size limit handling */ -- cgit v1.2.3 From 852a4ca054dad29647ce9bc11b8b3f4b1d518d1b Mon Sep 17 00:00:00 2001 From: Artjoms Rimdjonoks Date: Tue, 2 Mar 2021 21:30:05 +0200 Subject: ........S. [DEV-1836] improved code formatting --- tests/libs/zbxdbcache/Makefile.am | 1 + tests/libs/zbxserver/Makefile.am | 1 + tests/mocks/valuecache/valuecache_mock.c | 5 +++++ 3 files changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/libs/zbxdbcache/Makefile.am b/tests/libs/zbxdbcache/Makefile.am index 2f64538bf88..2421bf446b8 100644 --- a/tests/libs/zbxdbcache/Makefile.am +++ b/tests/libs/zbxdbcache/Makefile.am @@ -84,6 +84,7 @@ COMMON_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ -Wl,--wrap=zbx_elastic_check_version \ + -Wl,--wrap=zbx_elastic_get_version \ -Wl,--wrap=time zbx_vc_get_values_SOURCES = \ diff --git a/tests/libs/zbxserver/Makefile.am b/tests/libs/zbxserver/Makefile.am index 97950e028bf..7f3d25f6648 100755 --- a/tests/libs/zbxserver/Makefile.am +++ b/tests/libs/zbxserver/Makefile.am @@ -152,6 +152,7 @@ VALUECACHE_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ -Wl,--wrap=zbx_elastic_check_version \ + -Wl,--wrap=zbx_elastic_get_version \ -Wl,--wrap=time \ -Wl,--wrap=substitute_simple_macros \ -Wl,--wrap=DCget_data_expected_from \ diff --git a/tests/mocks/valuecache/valuecache_mock.c b/tests/mocks/valuecache/valuecache_mock.c index 28ee87d8a51..6c4c2d80744 100644 --- a/tests/mocks/valuecache/valuecache_mock.c +++ b/tests/mocks/valuecache/valuecache_mock.c @@ -55,6 +55,7 @@ int __wrap_zbx_history_add_values(const zbx_vector_ptr_t *history); int __wrap_zbx_history_sql_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); int __wrap_zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); void __wrap_zbx_elastic_check_version(void); +int __wrap_zbx_elastic_get_version(void); time_t __wrap_time(time_t *ptr); void __wrap_zbx_timespec(zbx_timespec_t *ts); @@ -690,6 +691,10 @@ void __wrap_zbx_elastic_check_version(void) { } +int __wrap_zbx_elastic_get_version(void) +{ +} + /* * cache allocator size limit handling */ -- cgit v1.2.3 From e8ad06818c854deac2a0a9e7c1b2c1e342b6a2e4 Mon Sep 17 00:00:00 2001 From: Michael Veksler Date: Tue, 6 Apr 2021 23:33:30 +0300 Subject: ........S. [DEV-1836] fixed tests --- tests/libs/zbxdbcache/Makefile.am | 4 ++-- tests/libs/zbxserver/Makefile.am | 4 ++-- tests/mocks/valuecache/valuecache_mock.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/libs/zbxdbcache/Makefile.am b/tests/libs/zbxdbcache/Makefile.am index 2421bf446b8..7f478685909 100644 --- a/tests/libs/zbxdbcache/Makefile.am +++ b/tests/libs/zbxdbcache/Makefile.am @@ -83,8 +83,8 @@ COMMON_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_add_values \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ - -Wl,--wrap=zbx_elastic_check_version \ - -Wl,--wrap=zbx_elastic_get_version \ + -Wl,--wrap=zbx_elastic_version_extract \ + -Wl,--wrap=zbx_elastic_version_get \ -Wl,--wrap=time zbx_vc_get_values_SOURCES = \ diff --git a/tests/libs/zbxserver/Makefile.am b/tests/libs/zbxserver/Makefile.am index 7f3d25f6648..2bd23a8e868 100755 --- a/tests/libs/zbxserver/Makefile.am +++ b/tests/libs/zbxserver/Makefile.am @@ -151,8 +151,8 @@ VALUECACHE_WRAP_FUNCS = \ -Wl,--wrap=zbx_history_add_values \ -Wl,--wrap=zbx_history_sql_init \ -Wl,--wrap=zbx_history_elastic_init \ - -Wl,--wrap=zbx_elastic_check_version \ - -Wl,--wrap=zbx_elastic_get_version \ + -Wl,--wrap=zbx_elastic_version_extract \ + -Wl,--wrap=zbx_elastic_version_get \ -Wl,--wrap=time \ -Wl,--wrap=substitute_simple_macros \ -Wl,--wrap=DCget_data_expected_from \ diff --git a/tests/mocks/valuecache/valuecache_mock.c b/tests/mocks/valuecache/valuecache_mock.c index 6c4c2d80744..323bc8fc773 100644 --- a/tests/mocks/valuecache/valuecache_mock.c +++ b/tests/mocks/valuecache/valuecache_mock.c @@ -54,8 +54,8 @@ int __wrap_zbx_history_get_values(zbx_uint64_t itemid, int value_type, int start int __wrap_zbx_history_add_values(const zbx_vector_ptr_t *history); int __wrap_zbx_history_sql_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); int __wrap_zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char value_type, char **error); -void __wrap_zbx_elastic_check_version(void); -int __wrap_zbx_elastic_get_version(void); +void __wrap_zbx_elastic_version_extract(void); +int __wrap_zbx_elastic_version_get(void); time_t __wrap_time(time_t *ptr); void __wrap_zbx_timespec(zbx_timespec_t *ts); @@ -687,12 +687,13 @@ int __wrap_zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char val return SUCCEED; } -void __wrap_zbx_elastic_check_version(void) +void __wrap_zbx_elastic_version_extract(void) { } -int __wrap_zbx_elastic_get_version(void) +int __wrap_zbx_elastic_version_get(void) { + return ZBX_DBVERSION_UNDEFINED; } /* -- cgit v1.2.3 From d509cc28602c4b3d44de1941980f06f2beb89af4 Mon Sep 17 00:00:00 2001 From: Artjoms Rimdjonoks Date: Fri, 7 May 2021 18:02:00 +0300 Subject: ........S. [DEV-1836] fixed ant cmocka build --- tests/libs/zbxhistory/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/libs/zbxhistory/Makefile.am b/tests/libs/zbxhistory/Makefile.am index 4b47a289c8f..60066cbef8a 100644 --- a/tests/libs/zbxhistory/Makefile.am +++ b/tests/libs/zbxhistory/Makefile.am @@ -22,6 +22,9 @@ HISTORY_LIBS = \ $(top_srcdir)/src/libs/zbxcommon/libzbxcommon.a \ $(top_srcdir)/src/libs/zbxdbhigh/libzbxdbhigh.a \ $(top_srcdir)/src/libs/zbxdb/libzbxdb.a \ + $(top_srcdir)/src/libs/zbxjson/libzbxjson.a \ + $(top_srcdir)/src/libs/zbxregexp/libzbxregexp.a \ + $(top_srcdir)/src/libs/zbxcommon/libzbxcommon.a \ $(top_srcdir)/tests/libzbxmockdata.a zbx_history_get_values_SOURCES = \ -- cgit v1.2.3