summaryrefslogtreecommitdiffstats
path: root/fluent-bit/tests/runtime/in_event_test.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /fluent-bit/tests/runtime/in_event_test.c
parentInitial commit. (diff)
downloadnetdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz
netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/tests/runtime/in_event_test.c')
-rw-r--r--fluent-bit/tests/runtime/in_event_test.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/fluent-bit/tests/runtime/in_event_test.c b/fluent-bit/tests/runtime/in_event_test.c
new file mode 100644
index 00000000..1169d8fd
--- /dev/null
+++ b/fluent-bit/tests/runtime/in_event_test.c
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#include <fluent-bit.h>
+#include "flb_tests_runtime.h"
+
+void flb_test_input_event()
+{
+ int ret;
+ flb_ctx_t *ctx;
+ int in_ffd;
+ int out_ffd;
+
+ ctx = flb_create();
+
+ in_ffd = flb_input(ctx, (char *) "event_test", NULL);
+ TEST_CHECK(in_ffd >= 0);
+
+ out_ffd = flb_output(ctx, (char *) "null", NULL);
+ TEST_CHECK(out_ffd >= 0);
+ flb_output_set(ctx, out_ffd, "match", "test", NULL);
+
+ ret = flb_start(ctx);
+ TEST_CHECK(ret == 0);
+
+ sleep(8);
+
+ flb_stop(ctx);
+ flb_destroy(ctx);
+}
+
+/* Test list */
+TEST_LIST = {
+ {"event_test", flb_test_input_event},
+ {NULL, NULL}
+};