Skip to content

Commit

Permalink
calyptia: resolve function pointer usage
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens committed Dec 4, 2024
1 parent 89ac5a9 commit 353364e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/custom_calyptia/calyptia.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ static flb_sds_t agent_config_filename(struct calyptia *ctx, char *fname);
/* These are unique to the agent rather than the fleet */
#define machine_id_fleet_config_filename(a) agent_config_filename((a), "machine-id")

/* Function wrappers to enable mocking for unit test filesystem access */
int (*flb_access)(const char *pathname, int mode);
int (*flb_open)(const char *pathname, int flags, ...);
ssize_t (*flb_write)(int fd, const void *buf, size_t count);
int (*flb_close)(int fd);
int (*flb_utils_read_file_wrapper)(char *path, char **out_buf, size_t *out_size);

#endif /* FLB_CALYPTIA_H */
1 change: 1 addition & 0 deletions tests/runtime/custom_calyptia_input_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fluent-bit/flb_custom_plugin.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_str.h>
#include <fluent-bit/flb_utils.h>
#include "flb_tests_runtime.h"
#include "../../plugins/custom_calyptia/calyptia.h"

Expand Down

0 comments on commit 353364e

Please sign in to comment.