Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/zabbix_server/trapper/Makefile.am3
-rw-r--r--tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c10
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/zabbix_server/trapper/Makefile.am b/tests/zabbix_server/trapper/Makefile.am
index 06437cbdb77..5b9d49d6bc8 100644
--- a/tests/zabbix_server/trapper/Makefile.am
+++ b/tests/zabbix_server/trapper/Makefile.am
@@ -44,7 +44,8 @@ zbx_trapper_preproc_test_run_LDFLAGS = @SERVER_LDFLAGS@
zbx_trapper_preproc_test_run_CFLAGS = \
-I@top_srcdir@/tests @LIBXML2_CFLAGS@ \
-Wl,--wrap=zbx_preprocessor_test \
- -Wl,--wrap=DBget_user_by_active_session
+ -Wl,--wrap=DBget_user_by_active_session \
+ -Wl,--wrap=DBget_user_by_auth_token
endif
diff --git a/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c b/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c
index 4f4a93d78f2..4251f28fc58 100644
--- a/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c
+++ b/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c
@@ -92,6 +92,16 @@ int __wrap_DBget_user_by_active_session(const char *sessionid, zbx_user_t *user)
return SUCCEED;
}
+int __wrap_DBget_user_by_auth_token(const char *authtoken, zbx_user_t *user)
+{
+ ZBX_UNUSED(authtoken);
+
+ user->type = USER_TYPE_ZABBIX_ADMIN;
+ user->userid = 0;
+
+ return SUCCEED;
+}
+
void zbx_mock_test_entry(void **state)
{
const char *request;