From adf20cc8b3a285d098d1bfc2f4b76c20cb5801d5 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 28 Jul 2023 00:13:33 +0900 Subject: [PATCH] tests: internal: input_chunk: Use the different storage.path per tests This is because different storage.paths should be used per test. Sometimes this cause failure for retrieving the file contents to prepare the data for input_chunk test cases: ```log Test input_chunk_exceed_limit... [ FAILED ] input_chunk.c:91: Check getting output file content: ~/GitHub/fluent-bit/tests/internal/data/input_chunk/out/a_thousand_plus_one_bytes.out... failed [2023/07/28 00:03:09] [error] [~/GitHub/fluent-bit/tests/internal/input_chunk.c:56 errno=0] Success ``` After splitting the storage.path per test case, this error won't happen. Signed-off-by: Hiroshi Hatake --- tests/internal/input_chunk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/internal/input_chunk.c b/tests/internal/input_chunk.c index 757e3b4cc0c..7154b324baf 100644 --- a/tests/internal/input_chunk.c +++ b/tests/internal/input_chunk.c @@ -162,6 +162,7 @@ void do_test(char *system, const char *target, ...) int out_ffd; char path[PATH_MAX]; struct tail_test_result result = {0}; + char storage_path[PATH_MAX]; result.nMatched = 0; result.target = target; @@ -175,10 +176,12 @@ void do_test(char *system, const char *target, ...) ctx = flb_create(); + snprintf(storage_path, sizeof(storage_path) - 1, "/tmp/input-chunk-test-%s", target); + /* create chunks in /tmp folder */ ret = flb_service_set(ctx, "Parsers_File", DPATH "parser.conf", - "storage.path", "/tmp/input-chunk-test/", + "storage.path", storage_path, "Log_Level", "error", NULL); TEST_CHECK_(ret == 0, "setting service options");