-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: add option/property checks for input/output/filters. (#3317)
This patch implements helper methods in the library to validate if a given k, v option is valid for a input/output/plugin. Signed-off-by: Jorge Niedbalski <j@calyptia.com>
- Loading branch information
1 parent
99f75bc
commit abca758
Showing
7 changed files
with
160 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -735,8 +735,6 @@ int flb_engine_shutdown(struct flb_config *config) | |
} | ||
#endif | ||
|
||
flb_config_exit(config); | ||
|
||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
#include <fluent-bit.h> | ||
#include "flb_tests_runtime.h" | ||
|
||
/* Test functions */ | ||
void flb_test_config_map_opts(void); | ||
|
||
/* Test list */ | ||
TEST_LIST = { | ||
{"config_map_opts", flb_test_config_map_opts }, | ||
{NULL, NULL} | ||
}; | ||
|
||
void flb_test_config_map_opts(void) | ||
{ | ||
flb_ctx_t *ctx = NULL; | ||
int in_ffd, r; | ||
ctx = flb_create(); | ||
in_ffd = flb_input(ctx, (char *) "tail", NULL); | ||
r = flb_input_property_check(ctx, in_ffd, "invalid_option", "invalid value"); | ||
TEST_CHECK(r != 0); | ||
|
||
in_ffd = flb_filter(ctx, (char *) "kubernetes", NULL); | ||
r = flb_filter_property_check(ctx, in_ffd, "invalid_option", "invalid value"); | ||
TEST_CHECK(r != 0); | ||
|
||
in_ffd = flb_output(ctx, (char *) "stdout", NULL); | ||
r = flb_output_property_check(ctx, in_ffd, "invalid_option", "invalid value"); | ||
TEST_CHECK(r != 0); | ||
|
||
flb_destroy(ctx); | ||
} |