diff --git a/tests/internal/parser_json.c b/tests/internal/parser_json.c index 5e13562ebba..ea2ad6bd2b8 100644 --- a/tests/internal/parser_json.c +++ b/tests/internal/parser_json.c @@ -171,7 +171,7 @@ void test_basic() } parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -223,7 +223,7 @@ void test_time_key() } parser = flb_parser_create("json", "json", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -284,7 +284,7 @@ void test_time_keep() } parser = flb_parser_create("json", "json", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_TRUE /*time_keep */, FLB_FALSE, + FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -365,7 +365,7 @@ void test_types_is_not_supported() types->type = FLB_PARSER_TYPE_HEX; parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, types, 1, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -450,7 +450,7 @@ void test_decode_field_json() } parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, decoder, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); diff --git a/tests/internal/parser_logfmt.c b/tests/internal/parser_logfmt.c index ccb68140109..ea363c53ab2 100644 --- a/tests/internal/parser_logfmt.c +++ b/tests/internal/parser_logfmt.c @@ -171,7 +171,7 @@ void test_basic() } parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -223,7 +223,7 @@ void test_time_key() } parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -284,7 +284,7 @@ void test_time_keep() } parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_TRUE /*time_keep */, FLB_FALSE, + FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -361,7 +361,7 @@ void test_types() types->type = FLB_PARSER_TYPE_HEX; parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, types, 1, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); diff --git a/tests/internal/parser_ltsv.c b/tests/internal/parser_ltsv.c index 81facb55821..3f9170518aa 100644 --- a/tests/internal/parser_ltsv.c +++ b/tests/internal/parser_ltsv.c @@ -171,7 +171,7 @@ void test_basic() } parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -223,7 +223,7 @@ void test_time_key() } parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -284,7 +284,7 @@ void test_time_keep() } parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_TRUE /*time_keep */, FLB_FALSE, + FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -361,7 +361,7 @@ void test_types() types->type = FLB_PARSER_TYPE_HEX; parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, types, 1, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -446,7 +446,7 @@ void test_decode_field_json() } parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, decoder, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); diff --git a/tests/internal/parser_regex.c b/tests/internal/parser_regex.c index 08133accc57..2283231ce57 100644 --- a/tests/internal/parser_regex.c +++ b/tests/internal/parser_regex.c @@ -172,7 +172,7 @@ void test_basic() } parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -225,7 +225,7 @@ void test_time_key() } parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -287,7 +287,7 @@ void test_time_keep() } parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL, - FLB_TRUE /*time_keep */, FLB_FALSE, + FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, NULL, 0, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -365,7 +365,7 @@ void test_types() types->type = FLB_PARSER_TYPE_HEX; parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, types, 1, NULL, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); @@ -451,7 +451,7 @@ void test_decode_field_json() } parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL, - FLB_FALSE, FLB_FALSE, + FLB_FALSE, FLB_FALSE, FLB_FALSE, NULL, 0, decoder, config); if (!TEST_CHECK(parser != NULL)) { TEST_MSG("flb_parser_create failed"); diff --git a/tests/runtime/custom_calyptia_test.c b/tests/runtime/custom_calyptia_test.c index 27cc911ca2b..5ad30e7a0bf 100644 --- a/tests/runtime/custom_calyptia_test.c +++ b/tests/runtime/custom_calyptia_test.c @@ -8,18 +8,19 @@ flb_sds_t custom_calyptia_pipeline_config_get(struct flb_config *ctx); void flb_custom_calyptia_pipeline_config_get_test() { - const char *cfg_str = "[INPUT]\n name cpu.0\n[INPUT]\n name fluentbit_metrics.1\n tag _calyptia_cloud\n scrape_on_start true\n scrape_interval 30\n\n\n[OUTPUT]\n name stdout.0\n match *\n retry_limit 1\n\n"; + const char *cfg_str = "[INPUT]\n name dummy.0\n[INPUT]\n name fluentbit_metrics.1\n tag _calyptia_cloud\n scrape_on_start true\n scrape_interval 30\n\n\n[OUTPUT]\n name stdout.0\n match *\n retry_limit 1\n\n"; flb_ctx_t *ctx; - int in_ffd_cpu; + int in_ffd_dummy; int in_ffd_metrics; int out_ffd; struct flb_custom_instance *calyptia; flb_sds_t cfg; ctx = flb_create(); + flb_service_set(ctx, "flush", "1", "grace", "1", NULL); - in_ffd_cpu = flb_input(ctx, (char *) "cpu", NULL); - TEST_CHECK(in_ffd_cpu >= 0); + in_ffd_dummy = flb_input(ctx, (char *) "dummy", NULL); + TEST_CHECK(in_ffd_dummy >= 0); in_ffd_metrics = flb_input(ctx, (char *) "fluentbit_metrics", NULL); TEST_CHECK(in_ffd_metrics >= 0); @@ -41,11 +42,12 @@ void flb_custom_calyptia_pipeline_config_get_test() flb_custom_set_property(calyptia, "add_label", "pipeline_id 7DDD2941-3ED6-4B8C-9F84-DD04C4A018A4"); flb_custom_set_property(calyptia, "calyptia_host", "cloud-api.calyptia.com"); flb_custom_set_property(calyptia, "calyptia_port", "443"); - flb_custom_set_property(calyptia, "tls", "on"); - flb_custom_set_property(calyptia, "tls_verify", "on"); cfg = custom_calyptia_pipeline_config_get(ctx->config); TEST_CHECK(strcmp(cfg, cfg_str) == 0); + + // fix a thread local storage bug on macos + flb_output_prepare(); flb_sds_destroy(cfg); flb_destroy(ctx); } diff --git a/tests/runtime/filter_parser.c b/tests/runtime/filter_parser.c index f79e7e0350b..973ef2192f7 100644 --- a/tests/runtime/filter_parser.c +++ b/tests/runtime/filter_parser.c @@ -413,11 +413,20 @@ void flb_test_filter_parser_handle_time_key_with_time_zone() NULL); /* Parser */ - parser = flb_parser_create("timestamp", "regex", "^(?