diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/tests/runtime/out_td.c | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/tests/runtime/out_td.c')
-rw-r--r-- | src/fluent-bit/tests/runtime/out_td.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/fluent-bit/tests/runtime/out_td.c b/src/fluent-bit/tests/runtime/out_td.c new file mode 100644 index 000000000..d54916052 --- /dev/null +++ b/src/fluent-bit/tests/runtime/out_td.c @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +#include <fluent-bit.h> +#include "flb_tests_runtime.h" + +/* Test data */ +#include "data/td/json_td.h" /* JSON_TD */ + +/* Test functions */ +void flb_test_td_json_long(void); + +/* Test list */ +TEST_LIST = { + {"json_long", flb_test_td_json_long }, + {NULL, NULL} +}; + + +/* It writes a big JSON message (> 3.5MB) */ +void flb_test_td_json_long(void) +{ + int ret; + flb_ctx_t *ctx; + int in_ffd; + int out_ffd; + + ctx = flb_create(); + + in_ffd = flb_input(ctx, (char *) "lib", NULL); + TEST_CHECK(in_ffd >= 0); + flb_input_set(ctx,in_ffd, "tag", "test", NULL); + + out_ffd = flb_output(ctx, (char *) "td", NULL); + TEST_CHECK(out_ffd >= 0); + flb_output_set(ctx, out_ffd,"match", "test", NULL); + + ret = flb_lib_config_file(ctx, (char *) "/tmp/td.conf"); + + ret = flb_start(ctx); + TEST_CHECK(ret == 0); + + flb_lib_push(ctx, in_ffd, (char *) JSON_TD , (int) sizeof(JSON_TD) - 1); + + flb_stop(ctx); + flb_destroy(ctx); +} |