From 8f961a968fc521205fee79c86e526d6d61fc58fe Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Thu, 10 Oct 2024 16:54:53 -0700 Subject: [PATCH] fix default value in test case --- tests/test_ocsp_fail_open.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/test_ocsp_fail_open.c b/tests/test_ocsp_fail_open.c index ae7b424316..01ac9bce6d 100644 --- a/tests/test_ocsp_fail_open.c +++ b/tests/test_ocsp_fail_open.c @@ -4,6 +4,8 @@ #include "utils/test_setup.h" +sf_bool FAIL_OPEN_DEFAULT = SF_BOOLEAN_FALSE; + void setCacheFile(char *cache_file) { #ifdef __linux__ @@ -48,6 +50,12 @@ void test_fail_open_revoked(void **unused) { SF_CONNECT *sf = setup_snowflake_connection(); + sf_bool value = SF_BOOLEAN_TRUE; + if (value != FAIL_OPEN_DEFAULT) + { + snowflake_set_attribute(sf, SF_CON_OCSP_FAIL_OPEN, &value); + } + SF_STATUS ret = snowflake_connect(sf); assert_int_not_equal(ret, SF_STATUS_SUCCESS); // must fail SF_ERROR_STRUCT *sferr = snowflake_error(sf); @@ -69,7 +77,10 @@ void test_fail_close_timeout(void** unused) { SF_CONNECT* sf = setup_snowflake_connection(); sf_bool value = SF_BOOLEAN_FALSE; - snowflake_set_attribute(sf, SF_CON_OCSP_FAIL_OPEN, &value); + if (value != FAIL_OPEN_DEFAULT) + { + snowflake_set_attribute(sf, SF_CON_OCSP_FAIL_OPEN, &value); + } SF_STATUS ret = snowflake_connect(sf); assert_int_not_equal(ret, SF_STATUS_SUCCESS); // must fail @@ -91,6 +102,11 @@ void test_fail_open_timeout(void** unused) { sf_setenv("SF_OCSP_RESPONSE_CACHE_SERVER_ENABLED", "false"); SF_CONNECT* sf = setup_snowflake_connection(); + sf_bool value = SF_BOOLEAN_TRUE; + if (value != FAIL_OPEN_DEFAULT) + { + snowflake_set_attribute(sf, SF_CON_OCSP_FAIL_OPEN, &value); + } SF_STATUS ret = snowflake_connect(sf); if (ret != SF_STATUS_SUCCESS) {