summaryrefslogtreecommitdiffstats
path: root/fluent-bit/tests/internal/aws_credentials_test_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/tests/internal/aws_credentials_test_internal.h')
-rw-r--r--fluent-bit/tests/internal/aws_credentials_test_internal.h42
1 files changed, 42 insertions, 0 deletions
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 00000000..bd335782
--- /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 */