summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-28 02:50:47 (GMT)
committerGitHub <noreply@github.com>2023-07-28 02:50:47 (GMT)
commite6210c80cfe823a7ee6e938daf9e87d302ca9a8e (patch)
tree97aa10381d063c57652f534b068c4a18f83c18b4 /test
parent38e234b620595f3eac5ff68dd71d4b29cfd46b18 (diff)
downloadhdf5-e6210c80cfe823a7ee6e938daf9e87d302ca9a8e.zip
hdf5-e6210c80cfe823a7ee6e938daf9e87d302ca9a8e.tar.gz
hdf5-e6210c80cfe823a7ee6e938daf9e87d302ca9a8e.tar.bz2
Sync ros3 VFD w/ develop (#3299)
* Sync ros3 VFD w/ develop Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/ros3.c76
-rw-r--r--test/s3comms.c47
2 files changed, 61 insertions, 62 deletions
diff --git a/test/ros3.c b/test/ros3.c
index 9a41a54..ab77d93 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -549,7 +549,7 @@ test_fapl_config_validation(void)
*/
success = H5Pset_fapl_ros3(fapl_id, &case_ptr->config);
}
- H5E_END_TRY;
+ H5E_END_TRY
JSVERIFY(case_ptr->expected, success, case_ptr->msg)
@@ -590,7 +590,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
return 1;
} /* test_fapl_config_validation */
@@ -664,7 +664,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
@@ -832,7 +832,7 @@ test_vfd_open(void)
{
fd = H5FDopen(T.url, T.flags, _fapl_id, T.maxaddr);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (NULL != fd)
JSVERIFY(1, 0, T.message); /* wrapper to print message and fail */
}
@@ -876,14 +876,14 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
if (fapl_file_access >= 0) {
H5E_BEGIN_TRY
{
(void)H5Pclose(fapl_file_access);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
if (curl_ready == TRUE) {
curl_global_cleanup();
@@ -1014,7 +1014,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
return 1;
@@ -1078,17 +1078,17 @@ test_H5FDread_without_eoa_set_fails(void)
* TEST *
********/
- H5E_BEGIN_TRY{/* mute stack trace on expected failure */
- JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer),
- "cannot read before eoa is set")} H5E_END_TRY;
- JSVERIFY_STR("", buffer, "buffer should remain untouched")
+ H5E_BEGIN_TRY{
+ /* mute stack trace on expected failure */
+ JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer),
+ "cannot read before eoa is set")} H5E_END_TRY JSVERIFY_STR("", buffer,
+ "buffer should remain untouched")
- /************
- * TEARDOWN *
- ************/
+ /************
+ * TEARDOWN *
+ ************/
- FAIL_IF(FAIL == H5FDclose(file_shakespeare))
- file_shakespeare = NULL;
+ FAIL_IF(FAIL == H5FDclose(file_shakespeare)) file_shakespeare = NULL;
FAIL_IF(FAIL == H5Pclose(fapl_id))
fapl_id = -1;
@@ -1109,7 +1109,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
return 1;
@@ -1276,7 +1276,7 @@ test_read(void)
{
open_return = H5FDread(file_raven, H5FD_MEM_DRAW, H5P_DEFAULT, test.addr, test.len, buffer);
}
- H5E_END_TRY;
+ H5E_END_TRY
JSVERIFY(test.success, open_return, test.message)
if (open_return == SUCCEED)
@@ -1309,7 +1309,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
return 1;
@@ -1386,19 +1386,19 @@ test_noops_and_autofails(void)
/* auto-fail calls to write and truncate
*/
H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data),
- "write must fail")} H5E_END_TRY;
+ "write must fail")} H5E_END_TRY
- H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY;
+ H5E_BEGIN_TRY{
+ JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY
- H5E_BEGIN_TRY{
- JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY;
+ H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE),
+ "truncate must fail (closing)")} H5E_END_TRY
- /************
- * TEARDOWN *
- ************/
+ /************
+ * TEARDOWN *
+ ************/
- FAIL_IF(FAIL == H5FDclose(file))
- file = NULL;
+ FAIL_IF(FAIL == H5FDclose(file)) file = NULL;
FAIL_IF(FAIL == H5Pclose(fapl_id))
fapl_id = -1;
@@ -1419,7 +1419,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
if (file) {
(void)H5FDclose(file);
@@ -1550,7 +1550,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
return 1;
@@ -1620,15 +1620,15 @@ test_H5F_integration(void)
/* Read-Write Open access is not allowed with this file driver.
*/
- H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fopen(url_h5_public, H5F_ACC_RDWR, fapl_id))} H5E_END_TRY;
+ H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fopen(url_h5_public, H5F_ACC_RDWR, fapl_id))} H5E_END_TRY
- /* H5Fcreate() is not allowed with this file driver.
- */
- H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fcreate(url_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY;
+ /* H5Fcreate() is not allowed with this file driver.
+ */
+ H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fcreate(url_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY
- /* Successful open.
- */
- file = H5Fopen(url_h5_public, H5F_ACC_RDONLY, fapl_id);
+ /* Successful open.
+ */
+ file = H5Fopen(url_h5_public, H5F_ACC_RDONLY, fapl_id);
FAIL_IF(file < 0)
/************
@@ -1656,7 +1656,7 @@ error:
{
(void)H5Pclose(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
if (file > 0)
(void)H5Fclose(file);
diff --git a/test/s3comms.c b/test/s3comms.c
index 7307673..ea32769 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -348,6 +348,7 @@ static int s3_test_credentials_loaded = 0;
static char s3_test_aws_region[16] = "";
static char s3_test_aws_access_key_id[64] = "";
static char s3_test_aws_secret_access_key[128] = "";
+static char s3_test_aws_security_token[1024] = "";
static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = "";
static hbool_t s3_test_bucket_defined = FALSE;
@@ -1692,10 +1693,7 @@ error:
} /* end test_percent_encode_char() */
/*---------------------------------------------------------------------------
- * Function: test_s3r_open()
- *
- * Programmer: Jacob Smith 2018-01-24
- *
+ * Function: test_s3r_get_filesize()
*---------------------------------------------------------------------------
*/
static herr_t
@@ -1725,7 +1723,7 @@ test_s3r_get_filesize(void)
JSVERIFY(0, H5FD_s3comms_s3r_get_filesize(NULL), "filesize of the null handle should be 0")
- handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL, NULL);
FAIL_IF(handle == NULL)
JSVERIFY(6464, H5FD_s3comms_s3r_get_filesize(handle), NULL)
@@ -1833,14 +1831,14 @@ test_s3r_open(void)
/* attempt anonymously
*/
- handle = H5FD_s3comms_s3r_open(url_missing, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_missing, NULL, NULL, NULL, NULL);
FAIL_IF(handle != NULL);
/* attempt with authentication
*/
- handle =
- H5FD_s3comms_s3r_open(url_missing, (const char *)s3_test_aws_region,
- (const char *)s3_test_aws_access_key_id, (const unsigned char *)signing_key);
+ handle = H5FD_s3comms_s3r_open(
+ url_missing, (const char *)s3_test_aws_region, (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key, (const char *)s3_test_aws_security_token);
FAIL_IF(handle != NULL);
/*************************
@@ -1849,7 +1847,7 @@ test_s3r_open(void)
#if S3_TEST_RUN_TIMEOUT
printf("Opening on inactive port may hang for a minute; waiting for timeout\n");
- handle = H5FD_s3comms_s3r_open(url_raven_badport, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_raven_badport, NULL, NULL, NULL, NULL);
FAIL_IF(handle != NULL);
#endif
@@ -1859,20 +1857,21 @@ test_s3r_open(void)
/* anonymous access on restricted file
*/
- handle = H5FD_s3comms_s3r_open(url_shakespeare, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_shakespeare, NULL, NULL, NULL, NULL);
FAIL_IF(handle != NULL);
/* passed in a bad ID
*/
- handle = H5FD_s3comms_s3r_open(url_shakespeare, (const char *)s3_test_aws_region, "I_MADE_UP_MY_ID",
- (const unsigned char *)signing_key);
+ handle =
+ H5FD_s3comms_s3r_open(url_shakespeare, (const char *)s3_test_aws_region, "I_MADE_UP_MY_ID",
+ (const unsigned char *)signing_key, (const char *)s3_test_aws_security_token);
FAIL_IF(handle != NULL);
/* using an invalid signing key
*/
- handle =
- H5FD_s3comms_s3r_open(url_shakespeare, (const char *)s3_test_aws_region,
- (const char *)s3_test_aws_access_key_id, (const unsigned char *)EMPTY_SHA256);
+ handle = H5FD_s3comms_s3r_open(
+ url_shakespeare, (const char *)s3_test_aws_region, (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)EMPTY_SHA256, (const char *)s3_test_aws_security_token);
FAIL_IF(handle != NULL);
/*******************************
@@ -1881,7 +1880,7 @@ test_s3r_open(void)
/* anonymous
*/
- handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL, NULL);
FAIL_IF(handle == NULL);
JSVERIFY(6464, H5FD_s3comms_s3r_get_filesize(handle), "did not get expected filesize")
JSVERIFY(SUCCEED, H5FD_s3comms_s3r_close(handle), "unable to close file")
@@ -1889,9 +1888,9 @@ test_s3r_open(void)
/* using authentication on anonymously-accessible file?
*/
- handle =
- H5FD_s3comms_s3r_open(url_raven, (const char *)s3_test_aws_region,
- (const char *)s3_test_aws_access_key_id, (const unsigned char *)signing_key);
+ handle = H5FD_s3comms_s3r_open(
+ url_raven, (const char *)s3_test_aws_region, (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key, (const char *)s3_test_aws_security_token);
FAIL_IF(handle == NULL);
JSVERIFY(6464, H5FD_s3comms_s3r_get_filesize(handle), NULL)
JSVERIFY(SUCCEED, H5FD_s3comms_s3r_close(handle), "unable to close file")
@@ -1899,9 +1898,9 @@ test_s3r_open(void)
/* authenticating
*/
- handle =
- H5FD_s3comms_s3r_open(url_shakespeare, (const char *)s3_test_aws_region,
- (const char *)s3_test_aws_access_key_id, (const unsigned char *)signing_key);
+ handle = H5FD_s3comms_s3r_open(
+ url_shakespeare, (const char *)s3_test_aws_region, (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key, (const char *)s3_test_aws_security_token);
FAIL_IF(handle == NULL);
JSVERIFY(5458199, H5FD_s3comms_s3r_get_filesize(handle), NULL)
JSVERIFY(SUCCEED, H5FD_s3comms_s3r_close(handle), "unable to close file")
@@ -1987,7 +1986,7 @@ test_s3r_read(void)
/* open file
*/
- handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL, NULL);
FAIL_IF(handle == NULL)
JSVERIFY(6464, H5FD_s3comms_s3r_get_filesize(handle), NULL)