From 58daab21cd043e1dc37024a7f99b396788372918 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Mar 2024 14:19:48 +0100 Subject: Merging upstream version 1.44.3. Signed-off-by: Daniel Baumann --- .../tests/internal/aws_credentials_test_internal.h | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 fluent-bit/tests/internal/aws_credentials_test_internal.h (limited to 'fluent-bit/tests/internal/aws_credentials_test_internal.h') diff --git a/fluent-bit/tests/internal/aws_credentials_test_internal.h b/fluent-bit/tests/internal/aws_credentials_test_internal.h new file mode 100644 index 000000000..bd3357822 --- /dev/null +++ b/fluent-bit/tests/internal/aws_credentials_test_internal.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +#ifndef AWS_CREDENTIALS_TEST_INTERNAL_H + +#define AWS_CREDENTIALS_TEST_INTERNAL_H + +#include "flb_tests_internal.h" + +#define AWS_TEST_DATA_PATH(FILE_PATH) FLB_TESTS_DATA_PATH "data/aws_credentials/" FILE_PATH + +static int unset_profile_env() +{ + int ret; + ret = unsetenv("HOME"); + if (ret < 0) { + flb_errno(); + return -1; + } + ret = unsetenv("AWS_CONFIG_FILE"); + if (ret < 0) { + flb_errno(); + return -1; + } + ret = unsetenv("AWS_SHARED_CREDENTIALS_FILE"); + if (ret < 0) { + flb_errno(); + return -1; + } + ret = unsetenv("AWS_DEFAULT_PROFILE"); + if (ret < 0) { + flb_errno(); + return -1; + } + ret = unsetenv("AWS_PROFILE"); + if (ret < 0) { + flb_errno(); + return -1; + } + return 0; +} + +#endif /* AWS_CREDENTIALS_TEST_INTERNAL_H */ -- cgit v1.2.3