From 8c40dab59eaef1dea92df91a9d877edf3ce565d0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 19 Aug 2019 16:35:55 -0700 Subject: Untangle #ifdef mess in ROS3 code. --- configure.ac | 5 + java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java | 2 +- src/H5FDros3.c | 111 +------ src/H5FDros3.h | 42 +-- src/H5FDs3comms.c | 336 +-------------------- src/H5FDs3comms.h | 83 ++--- src/Makefile.am | 10 +- test/ros3.c | 151 ++------- test/s3comms.c | 76 +---- test/vfd.c | 68 +---- tools/lib/h5tools_utils.c | 18 +- tools/lib/h5tools_utils.h | 3 + tools/libtest/h5tools_test_utils.c | 36 +-- 13 files changed, 154 insertions(+), 787 deletions(-) diff --git a/configure.ac b/configure.ac index 7f1f0dd..e119e0a 100644 --- a/configure.ac +++ b/configure.ac @@ -2877,6 +2877,11 @@ else ROS3_VFD=no fi + +## Read-only S3 files are not built if not required. +AM_CONDITIONAL([ROS3_VFD_CONDITIONAL], [test "X$ROS3_VFD" = "Xyes"]) + + ## ---------------------------------------------------------------------- ## Is libhdfs (Hadoop Distributed File System) present? ## It might be specified with the `--with-libhdfs' command-line switch. diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java index 6b086c3..881aad3 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java @@ -71,7 +71,7 @@ public class H5FD_ros3_fapl_t implements Serializable { * @param key "secret key" or "access key" for authenticating request */ public H5FD_ros3_fapl_t (String region, String id, String key) { - this.version = 1; /* must equal H5FD__CURR_ROS3_FAPL_T_VERSION */ + this.version = 1; /* must equal H5FD_CURR_ROS3_FAPL_T_VERSION */ /* as found in H5FDros3.h */ this.aws_region = region; this.secret_id = id; diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 18f1f91..a369ca2 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -34,6 +34,8 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5FDs3comms.h" /* S3 Communications */ +#ifdef H5_HAVE_ROS3_VFD + /* toggle function call prints: 1 turns on */ #define ROS3_DEBUG 0 @@ -119,8 +121,6 @@ static unsigned long long ros3_stats_boundaries[ROS3_STATS_BIN_COUNT]; * * Programmer: Jacob Smith * - * Changes: None - * ***************************************************************************/ typedef struct { unsigned long long count; @@ -190,8 +190,6 @@ typedef struct { * * Programmer: Jacob Smith * - * Changes: None. - * ***************************************************************************/ typedef struct H5FD_ros3_t { H5FD_t pub; @@ -215,9 +213,7 @@ typedef struct H5FD_ros3_t { * */ #define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#ifdef H5_HAVE_ROS3_VFD #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) -#endif /* H5_HAVE_ROS3_VFD */ /* Prototypes */ static herr_t H5FD_ros3_term(void); @@ -279,10 +275,8 @@ static const H5FD_class_t H5FD_ros3_g = { H5FD_FLMAP_DICHOTOMY /* fl_map */ }; -#ifdef H5_HAVE_ROS3_VFD /* Declare a free list to manage the H5FD_ros3_t struct */ H5FL_DEFINE_STATIC(H5FD_ros3_t); -#endif /* H5_HAVE_ROS3_VFD */ /*------------------------------------------------------------------------- @@ -292,8 +286,7 @@ H5FL_DEFINE_STATIC(H5FD_ros3_t); * * Return: Non-negative on success/Negative on failure * - * Changes: Rename as appropriate for ros3 vfd. - * Jacob Smith 2017 + * Programmer: Jacob Smith 2017 * *------------------------------------------------------------------------- */ @@ -324,11 +317,7 @@ done: * Return: Success: The driver ID for the ros3 driver. * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * - * Changes: Rename as appropriate for ros3 vfd. - * Jacob Smith 2017 + * Programmer: Jacob Smith 2017 * *------------------------------------------------------------------------- */ @@ -372,11 +361,7 @@ done: * * Returns: SUCCEED (Can't fail) * - * Programmer: Quincey Koziol - * Friday, Jan 30, 2004 - * - * Changes: Rename as appropriate for ros3 vfd. - * Jacob Smith 2017 + * Programmer: Jacob Smith 2017 * *--------------------------------------------------------------------------- */ @@ -464,10 +449,6 @@ done: * Programmer: Jacob Smith * 9/10/17 * - * Changes: Add checks for authenticate flag requring populated - * `aws_region` and `secret_id` strings. - * -- Jacob Smith 2017-11-01 - * *------------------------------------------------------------------------- */ static herr_t @@ -479,7 +460,7 @@ H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa) HDassert(fa != NULL); - if ( fa->version != H5FD__CURR_ROS3_FAPL_T_VERSION ) { + if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version"); } @@ -704,8 +685,6 @@ H5FD_ros3_fapl_free(void *_fa) * Programmer: Jacob Smith * 2017-12-08 * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t @@ -774,12 +753,8 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD - static H5FD_t * H5FD_ros3_open( const char *url, @@ -904,22 +879,6 @@ done: } /* end H5FD_ros3_open() */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -static H5FD_t * -H5FD_ros3_open( - const char H5_ATTR_UNUSED *url, - unsigned H5_ATTR_UNUSED flags, - hid_t H5_ATTR_UNUSED fapl_id, - haddr_t H5_ATTR_UNUSED maxaddr) -{ - H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_ros3_open() */ - -#endif /* H5_HAVE_ROS3_VFD */ - #if ROS3_STATS /*---------------------------------------------------------------------------- @@ -974,8 +933,6 @@ H5FD_ros3_open( * * Programmer: Jacob Smith * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t @@ -1228,12 +1185,8 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD - static herr_t H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file) { @@ -1277,18 +1230,6 @@ done: } /* end H5FD_ros3_close() */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -static herr_t -H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file) -{ - herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_ros3_close() */ - -#endif /* H5_HAVE_ROS3_VFD */ - /*------------------------------------------------------------------------- * @@ -1318,17 +1259,8 @@ H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file) * Programmer: Jacob Smith * 2017-11-06 * - * Changes: - * - * + Change from strcmp-like return values (-1, 0, 1) to instead return - * binary equivalence (0) or inequality (-1). - * + Replace "if still equal then check this" waterfall with GOTO jumps. - * Jacob Smith 2018-05-17 - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD - static int H5FD_ros3_cmp( const H5FD_t *_f1, @@ -1463,20 +1395,6 @@ done: } /* H5FD_ros3_cmp() */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -static int -H5FD_ros3_cmp( - const H5FD_t H5_ATTR_UNUSED *_f1, - const H5FD_t H5_ATTR_UNUSED *_f2) -{ - int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_ros3_cmp() */ - -#endif /* H5_HAVE_ROS3_VFD */ - /*------------------------------------------------------------------------- * Function: H5FD_ros3_query @@ -1536,8 +1454,6 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ static haddr_t @@ -1572,8 +1488,6 @@ H5FD_ros3_get_eoa(const H5FD_t *_file, * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1646,8 +1560,6 @@ H5FD_ros3_get_eof(const H5FD_t *_file, * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1696,8 +1608,6 @@ done: * Programmer: Jacob Smith * 2017-11-?? * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1792,8 +1702,6 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1839,8 +1747,6 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1884,8 +1790,6 @@ done: * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1914,8 +1818,6 @@ H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1926,4 +1828,5 @@ H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file) } /* end H5FD_ros3_unlock() */ +#endif /* H5_HAVE_ROS3_VFD */ diff --git a/src/H5FDros3.h b/src/H5FDros3.h index 7dfc95b..250c7cc 100644 --- a/src/H5FDros3.h +++ b/src/H5FDros3.h @@ -21,11 +21,13 @@ #ifndef H5FDros3_H #define H5FDros3_H -#define H5FD_ROS3 (H5FD_ros3_init()) +#ifdef H5_HAVE_ROS3_VFD +#define H5FD_ROS3 (H5FD_ros3_init()) +#else +#define H5FD_ROS3 (H5I_INVALID_HID) +#endif /* H5_HAVE_ROS3_VFD */ -#ifdef __cplusplus -extern "C" { -#endif +#ifdef H5_HAVE_ROS3_VFD /**************************************************************************** * @@ -46,7 +48,7 @@ extern "C" { * to the above calls must have a recognized version number, or an error * will be flagged. * - * This field should be set to H5FD__CURR_ROS3_FAPL_T_VERSION. + * This field should be set to H5FD_CURR_ROS3_FAPL_T_VERSION. * * `authenticate` (hbool_t) * @@ -67,31 +69,27 @@ extern "C" { * * String: "Secret Access Key" associated with the ID and resource. * - * - * - * Programmer: John Mainzer - * - * Changes: - * - * - Add documentation of fields (except `version`) - * --- Jacob Smith 2017-12-04 - * ****************************************************************************/ -#define H5FD__CURR_ROS3_FAPL_T_VERSION 1 +#define H5FD_CURR_ROS3_FAPL_T_VERSION 1 -#define H5FD__ROS3_MAX_REGION_LEN 32 -#define H5FD__ROS3_MAX_SECRET_ID_LEN 128 -#define H5FD__ROS3_MAX_SECRET_KEY_LEN 128 +#define H5FD_ROS3_MAX_REGION_LEN 32 +#define H5FD_ROS3_MAX_SECRET_ID_LEN 128 +#define H5FD_ROS3_MAX_SECRET_KEY_LEN 128 typedef struct H5FD_ros3_fapl_t { int32_t version; hbool_t authenticate; - char aws_region[H5FD__ROS3_MAX_REGION_LEN + 1]; - char secret_id[H5FD__ROS3_MAX_SECRET_ID_LEN + 1]; - char secret_key[H5FD__ROS3_MAX_SECRET_KEY_LEN + 1]; + char aws_region[H5FD_ROS3_MAX_REGION_LEN + 1]; + char secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN + 1]; + char secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN + 1]; } H5FD_ros3_fapl_t; + +#ifdef __cplusplus +extern "C" { +#endif + H5_DLL hid_t H5FD_ros3_init(void); H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa_out); H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa); @@ -100,6 +98,8 @@ H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa); } #endif +#endif /* H5_HAVE_ROS3_VFD */ + #endif /* ifndef H5FDros3_H */ diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 42b281f..f8b4417 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -47,12 +47,12 @@ /* Local Macros */ /****************/ +#ifdef H5_HAVE_ROS3_VFD + /* toggle debugging (enable with 1) */ #define S3COMMS_DEBUG 0 -#ifdef H5_HAVE_ROS3_VFD - /* manipulate verbosity of CURL output * operates separately from S3COMMS_DEBUG * @@ -67,7 +67,6 @@ */ #define S3COMMS_MAX_RANGE_STRING_SIZE 128 -#endif /* H5_HAVE_ROS3_VFD */ /******************/ /* Local Typedefs */ @@ -137,8 +136,6 @@ herr_t H5FD_s3comms_s3r_getsize(s3r_t *handle); * Programmer: Jacob Smith * 2017-08-17 * - * Changes: None. - * *---------------------------------------------------------------------------- */ size_t @@ -217,14 +214,6 @@ curlwritecallback(char *ptr, * Programmer: Jacob Smith * 2017-09-22 * - * Changes: - * - * - Change return value to herr_t - * - Change list pointer to pointer-to-pointer-to-node - * - Change to use singly-linked list (from twin doubly-linked lists) - * with modification to hrb_node_t - * --- Jake Smith 2017-01-17 - * *---------------------------------------------------------------------------- */ herr_t @@ -635,19 +624,6 @@ done: * Programmer: Jacob Smith * 2017-07-21 * - * Changes: - * - * - Conditional free() of `hrb_node_t` pointer properties based on - * `which_free` property. - * --- Jacob Smith 2017-08-08 - * - * - Integrate with HDF5. - * - Returns herr_t instead of nothing. - * --- Jacob Smith 2017-09-21 - * - * - Change argument to from *buf to **buf, to null pointer within call - * --- Jacob Smith 2017-20-05 - * *---------------------------------------------------------------------------- */ herr_t @@ -709,25 +685,6 @@ done: * Programmer: Jacob Smith * 2017-07-21 * - * Changes: - * - * - Update struct membership for newer 'generic' `hrb_t` format. - * --- Jacob Smith, 2017-07-24 - * - * - Rename from `hrb_new()` to `hrb_request()` - * --- Jacob Smith, 2017-07-25 - * - * - Integrate with HDF5. - * - Rename from 'hrb_request()` to `H5FD_s3comms_hrb_init_request()`. - * - Remove `host` from input parameters. - * - Host, as with all other fields, must now be added through the - * add-field functions. - * - Add `version` (HTTP version string, e.g. "HTTP/1.1") to parameters. - * --- Jacob Smith 2017-09-20 - * - * - Update to use linked-list `hrb_node_t` headers in structure. - * --- Jacob Smith 2017-10-05 - * *---------------------------------------------------------------------------- */ hrb_t * @@ -842,64 +799,10 @@ done: } /* end H5FD_s3comms_hrb_init_request() */ - /**************************************************************************** * S3R FUNCTIONS ****************************************************************************/ -#ifndef H5_HAVE_ROS3_VFD -/* No-op, auto-fail, unused-variable implementations if ROS3 is not enabled */ - -herr_t -H5FD_s3comms_s3r_close(s3r_t H5_ATTR_UNUSED *handle) -{ - herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_s3comms_s3r_close() */ - -size_t -H5FD_s3comms_s3r_get_filesize(s3r_t H5_ATTR_UNUSED *handle) -{ - size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_s3comms_s3r_get_filesize() */ - -herr_t -H5FD_s3comms_s3r_getsize(s3r_t H5_ATTR_UNUSED *handle) -{ - herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_s3comms_s3r_getsize() */ - -s3r_t * -H5FD_s3comms_s3r_open( - const char H5_ATTR_UNUSED *url, - const char H5_ATTR_UNUSED *region, - const char H5_ATTR_UNUSED *id, - const unsigned char H5_ATTR_UNUSED *signing_key) -{ - s3r_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_s3comms_s3r_open() */ - -herr_t -H5FD_s3comms_s3r_read( - s3r_t H5_ATTR_UNUSED *handle, - haddr_t H5_ATTR_UNUSED offset, - size_t H5_ATTR_UNUSED len, - void H5_ATTR_UNUSED *dest) -{ - herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_s3comms_s3r_read() */ - -#else - /*---------------------------------------------------------------------------- * @@ -920,20 +823,6 @@ H5FD_s3comms_s3r_read( * Programmer: Jacob Smith * 2017-08-31 * - * Changes: - * - * - Remove all messiness related to the now-gone "setopt" utility - * as it no longer exists in the handle. - * - Return type to `void`. - * --- Jacob Smith 2017-09-01 - * - * - Incorporate into HDF environment. - * - Rename from `s3r_close()` to `H5FD_s3comms_s3r_close()`. - * --- Jacob Smith 2017-10-06 - * - * - Change separate host, resource, port info to `parsed_url_t` struct ptr. - * --- Jacob Smith 2017-11-01 - * *---------------------------------------------------------------------------- */ herr_t @@ -995,8 +884,6 @@ done: * * Programmer: Jacob Smith 2017-01-14 * - * Changes: None - * *---------------------------------------------------------------------------- */ size_t @@ -1044,44 +931,24 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle) * Programmer: Jacob Smith * 2017-08-23 * - * Changes: - * - * - Update to revised `s3r_t` format and life cycle. - * --- Jacob Smith 2017-09-01 - * - * - Conditional change to static header buffer and structure. - * --- Jacob Smith 2017-09-05 - * - * - Incorporate into HDF environment. - * - Rename from `s3r_getsize()` to `H5FD_s3comms_s3r_getsize()`. - * --- Jacob Smith 2017-10-06 - * *---------------------------------------------------------------------------- */ herr_t H5FD_s3comms_s3r_getsize(s3r_t *handle) { -#ifdef H5_HAVE_ROS3_VFD uintmax_t content_length = 0; CURL *curlh = NULL; char *end = NULL; char *headerresponse = NULL; - herr_t ret_value = SUCCEED; struct s3r_datastruct sds = { S3COMMS_CALLBACK_DATASTRUCT_MAGIC, NULL, 0 }; char *start = NULL; -#else - herr_t ret_value = FAIL; -#endif /* H5_HAVE_ROS3_VFD */ - - + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT -#ifdef H5_HAVE_ROS3_VFD - #if S3COMMS_DEBUG HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n"); #endif @@ -1238,8 +1105,6 @@ done: H5MM_xfree(headerresponse); sds.magic += 1; /* set to bad magic */ -#endif /* H5_HAVE_ROS3_VFD */ - FUNC_LEAVE_NOAPI(ret_value); } /* H5FD_s3comms_s3r_getsize */ @@ -1282,20 +1147,6 @@ done: * Programmer: Jacob Smith * 2017-09-01 * - * Changes: - * - * - Incorporate into HDF environment. - * - Rename from `s3r_open()` to `H5FD_s3comms_s3r_open()`. - * --- Jacob Smith 2017-10-06 - * - * - Remove port number from signature. - * - Name (`url`) must be complete url with http scheme and optional port - * number in string. - * - e.g., "http://bucket.aws.com:9000/myfile.dat?query=param" - * - Internal storage of host, resource, and port information moved into - * `parsed_url_t` struct pointer. - * --- Jacob Smith 2017-11-01 - * *---------------------------------------------------------------------------- */ s3r_t * @@ -1304,20 +1155,14 @@ H5FD_s3comms_s3r_open(const char *url, const char *id, const unsigned char *signing_key) { -#ifdef H5_HAVE_ROS3_VFD size_t tmplen = 0; CURL *curlh = NULL; s3r_t *handle = NULL; parsed_url_t *purl = NULL; -#endif s3r_t *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT -#ifdef H5_HAVE_ROS3_VFD - #if S3COMMS_DEBUG HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n"); #endif @@ -1492,11 +1337,9 @@ H5FD_s3comms_s3r_open(const char *url, HDmemcpy(handle->httpverb, "GET", 4); ret_value = handle; -#endif /* H5_HAVE_ROS3_VFD */ done: if (ret_value == NULL) { -#ifdef H5_HAVE_ROS3_VFD if (curlh != NULL) { curl_easy_cleanup(curlh); } @@ -1513,7 +1356,6 @@ done: } H5MM_xfree(handle); } -#endif /* H5_HAVE_ROS3_VFD */ } FUNC_LEAVE_NOAPI(ret_value) @@ -1560,29 +1402,6 @@ done: * Programmer: Jacob Smith * 2017-08-22 * - * Changes: - * - * - Revise structure to prevent unnecessary hrb_t element creation. - * - Rename tmprstr -> rangebytesstr to reflect purpose. - * - Insert needed `free()`s, particularly for `sds`. - * --- Jacob Smith 2017-08-23 - * - * - Revise heavily to accept buffer, range as parameters. - * - Utilize modified s3r_t format. - * --- Jacob Smith 2017-08-31 - * - * - Incorporate into HDF library. - * - Rename from `s3r_read()` to `H5FD_s3comms_s3r_read()`. - * - Return `herr_t` succeed/fail instead of S3code. - * - Update to use revised `hrb_t` and `hrb_node_t` structures. - * --- Jacob Smith 2017-10-06 - * - * - Update to use `parsed_url_t *purl` in handle. - * --- Jacob Smith 2017-11-01 - * - * - Better define behavior upon read past EOF - * --- Jacob Smith 2017-01-19 - * *---------------------------------------------------------------------------- */ herr_t @@ -1591,7 +1410,6 @@ H5FD_s3comms_s3r_read(s3r_t *handle, size_t len, void *dest) { -#ifdef H5_HAVE_ROS3_VFD CURL *curlh = NULL; CURLcode p_status = CURLE_OK; struct curl_slist *curlheaders = NULL; @@ -1604,16 +1422,9 @@ H5FD_s3comms_s3r_read(s3r_t *handle, /* return value of HDsnprintf */ struct s3r_datastruct *sds = NULL; herr_t ret_value = SUCCEED; -#else - herr_t ret_value = FAIL; -#endif /* H5_HAVE_ROS3_VFD */ - - FUNC_ENTER_NOAPI_NOINIT -#ifdef H5_HAVE_ROS3_VFD - #if S3COMMS_DEBUG HDfprintf(stdout, "called H5FD_s3comms_s3r_read.\n"); #endif @@ -2105,12 +1916,9 @@ done: } } -#endif /* H5_HAVE_ROS3_VFD */ - FUNC_LEAVE_NOAPI(ret_value); } /* H5FD_s3comms_s3r_read */ -#endif /* H5_HAVE_ROS3_VFD */ /**************************************************************************** * MISCELLANEOUS FUNCTIONS @@ -2133,8 +1941,6 @@ done: * Programmer: Jacob Smith * 2017-07-12 * - * Changes: None. - * *---------------------------------------------------------------------------- */ struct tm * @@ -2192,8 +1998,6 @@ gmnow(void) * Programmer: Jacob Smith * 2017-10-04 * - * Changes: None. - * *---------------------------------------------------------------------------- */ herr_t @@ -2362,20 +2166,6 @@ done: * Programmer: Jacob Smith * 2017-07-12 * - * Changes: - * - * - Integrate into HDF. - * - Rename from hex() to H5FD_s3comms_bytes_to_hex. - * - Change return type from `void` to `herr_t`. - * --- Jacob Smtih 2017-09-14 - * - * - Add bool parameter `lowercase` to configure upper/lowercase output - * of a-f hex characters. - * --- Jacob Smith 2017-09-19 - * - * - Change bool type to `hbool_t` - * --- Jacob Smtih 2017-10-11 - * *---------------------------------------------------------------------------- */ herr_t @@ -2438,8 +2228,6 @@ done: * Programmer: Jacob Smith * 2017-11-01 * - * Changes: None. - * *---------------------------------------------------------------------------- */ herr_t @@ -2494,22 +2282,8 @@ H5FD_s3comms_free_purl(parsed_url_t *purl) * Programmer: Jacob Smith * 2017-07-?? * - * Changes: - * - * - Integrate with HDF5. - * - Rename from `HMAC_SHA256` to `H5FD_s3comms_HMAC_SHA256`. - * - Rename output parameter from `md` to `dest`. - * - Return `herr_t` type instead of `void`. - * - Call `H5FD_s3comms_bytes_to_hex` to generate hex cleartext for output. - * --- Jacob Smith 2017-09-19 - * - * - Use static char array instead of malloc'ing `md` - * --- Jacob Smith 2017-10-10 - * *---------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD - herr_t H5FD_s3comms_HMAC_SHA256( const unsigned char *key, @@ -2556,23 +2330,6 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5FD_s3comms_HMAC_SHA256 */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -herr_t -H5FD_s3comms_HMAC_SHA256( - const unsigned char H5_ATTR_UNUSED *key, - size_t H5_ATTR_UNUSED key_len, - const char H5_ATTR_UNUSED *msg, - size_t H5_ATTR_UNUSED msg_len, - char H5_ATTR_UNUSED *dest) -{ - herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_s3comms_HMAC_SHA256() */ - -#endif /* H5_HAVE_ROS3_VFD */ - /*----------------------------------------------------------------------------- * @@ -2621,8 +2378,6 @@ H5FD_s3comms_HMAC_SHA256( * Programmer: Jacob Smith * 2018-02-27 * - * Changes: None - * *----------------------------------------------------------------------------- */ static herr_t @@ -2781,8 +2536,6 @@ done: * Programmer: Jacob Smith * 2018-02-27 * - * Changes: None - * *---------------------------------------------------------------------------- */ herr_t @@ -2903,8 +2656,6 @@ done: * Programmer: Jacob Smith * 2017-09-18 * - * Changes: None. - * *---------------------------------------------------------------------------- */ herr_t @@ -2968,8 +2719,6 @@ done: * Programmer: Jacob Smith * 2017-10-30 * - * Changes: None. - * *---------------------------------------------------------------------------- */ herr_t @@ -3242,12 +2991,6 @@ done: * * Programmer: Jacob Smith * - * Changes: - * - * - Integrate into HDF. - * - Rename from `hexutf8` to `H5FD_s3comms_percent_encode_char`. - * --- Jacob Smith 2017-09-15 - * *---------------------------------------------------------------------------- */ herr_t @@ -3421,19 +3164,8 @@ done: * Programmer: Jacob Smith * 2017-07-13 * - * Changes: - * - * - Integrate into HDF5. - * - Return herr_t type. - * --- Jacob Smith 2017-09-18 - * - * - NULL check and fail of input parameters. - * --- Jacob Smith 2017-10-10 - * *---------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD - herr_t H5FD_s3comms_signing_key( unsigned char *md, @@ -3526,22 +3258,6 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD_s3comms_signing_key() */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -herr_t -H5FD_s3comms_signing_key( - unsigned char H5_ATTR_UNUSED *md, - const char H5_ATTR_UNUSED *secret, - const char H5_ATTR_UNUSED *region, - const char H5_ATTR_UNUSED *iso8601now) -{ - herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOERR; - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_s3comms_signing_key() */ - -#endif /* H5_HAVE_ROS3_VFD */ - /*---------------------------------------------------------------------------- * @@ -3577,20 +3293,8 @@ H5FD_s3comms_signing_key( * Programmer: Jacob Smith * 2017-07-?? * - * Changes: - * - * - Integrate with HDF5. - * - Rename from `tostringtosign` to `H5FD_s3comms_tostringtosign`. - * - Return `herr_t` instead of characters written. - * - Use HDF-friendly bytes-to-hex function (`H5FD_s3comms_bytes_to_hex`) - * instead of general-purpose, deprecated `hex()`. - * - Adjust casts to openssl's `SHA256`. - * - Input strings are now `const`. - * --- Jacob Smith 2017-09-19 - * *---------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD herr_t H5FD_s3comms_tostringtosign( char *dest, @@ -3681,22 +3385,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5ros3_tostringtosign() */ -#else /* H5_HAVE_ROS3_VFD not defined */ - -herr_t -H5FD_s3comms_tostringtosign( - char H5_ATTR_UNUSED *dest, - const char H5_ATTR_UNUSED *req, - const char H5_ATTR_UNUSED *now, - const char H5_ATTR_UNUSED *region) -{ - herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ros3_tostringtosign() */ - -#endif /* H5_HAVE_ROS3_VFD */ - /*---------------------------------------------------------------------------- * @@ -3725,13 +3413,6 @@ H5FD_s3comms_tostringtosign( * Programmer: Jacob Smith * 2017-09-18 * - * Changes: - * - * - Rename from `trim()` to `H5FD_s3comms_trim()`. - * - Incorporate into HDF5. - * - Returns `herr_t` type. - * --- Jacob Smith 2017-??-?? - * *---------------------------------------------------------------------------- */ herr_t @@ -3826,16 +3507,6 @@ done: * Programmer: Jacob Smith * 2017-07-?? * - * Changes: - * - * - Integrate to HDF environment. - * - Rename from `uriencode` to `H5FD_s3comms_uriencode`. - * - Change return from characters written to herr_t; - * move to i/o parameter `n_written`. - * - No longer append null-terminator to string; - * programmer may append or not as appropriate upon return. - * --- Jacob Smith 2017-09-15 - * *---------------------------------------------------------------------------- */ herr_t @@ -3915,4 +3586,5 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_s3comms_uriencode */ +#endif /* H5_HAVE_ROS3_VFD */ diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h index 16f6a8b..94fae7e 100644 --- a/src/H5FDs3comms.h +++ b/src/H5FDs3comms.h @@ -52,18 +52,15 @@ * *****************************************************************************/ -#include -#include -#include -#include -#include +#include "H5private.h" /* Generic Functions */ #ifdef H5_HAVE_ROS3_VFD + +/* Necessary S3 headers */ #include #include #include #include -#endif /* ifdef H5_HAVE_ROS3_VFD */ /***************** * PUBLIC MACROS * @@ -99,9 +96,6 @@ * It is left to the programmer to check return value of * ISO8601NOW (should equal ISO8601_SIZE - 1). * - * Programmer: Jacob Smith - * 2017-07-?? - * *--------------------------------------------------------------------------- */ #define ISO8601NOW(dest, now_gm) \ @@ -121,9 +115,6 @@ strftime((dest), ISO8601_SIZE, "%Y%m%dT%H%M%SZ", (now_gm)) * It is left to the programmer to check return value of * RFC7231NOW (should equal RFC7231_SIZE - 1). * - * Programmer: Jacob Smith - * 2017-07-?? - * *--------------------------------------------------------------------------- */ #define RFC7231NOW(dest, now_gm) \ @@ -169,11 +160,6 @@ strftime((dest), RFC7231_SIZE, "%a, %d %b %Y %H:%M:%S GMT", (now_gm)) * `region` should be relevant AWS region, i.e. "us-east-1". * `service` should be "s3". * - * Programmer: Jacob Smith - * 2017-09-19 - * - * Changes: None. - * *--------------------------------------------------------------------------- */ #define S3COMMS_FORMAT_CREDENTIAL(dest, access, iso8601_date, region, service) \ @@ -266,16 +252,6 @@ HDsnprintf((dest), S3COMMS_MAX_CREDENTIAL_SIZE, * Pointers to next node in the list, or NULL sentinel as end of list. * Next node must have a greater `lowername` as determined by strcmp(). * - * - * - * Programmer: Jacob Smith - * 2017-09-22 - * - * Changes: - * - * - Change from twin doubly-linked lists to singly-linked list. - * --- Jake Smith 2017-01-17 - * *---------------------------------------------------------------------------- */ typedef struct hrb_node_t { @@ -353,10 +329,6 @@ typedef struct hrb_node_t { * * Pointer to HTTP version string, e.g., "HTTP/1.1". * - * - * - * Programmer: Jacob Smith - * *---------------------------------------------------------------------------- */ typedef struct { @@ -421,10 +393,6 @@ typedef struct { * Single string of all query parameters in url (if any). * "arg1=value1&arg2=value2" * - * - * - * Programmer: Jacob Smith - * *---------------------------------------------------------------------------- */ typedef struct { @@ -514,15 +482,10 @@ typedef struct { * * Requred to authenticate. * - * - * - * Programmer: Jacob Smith - * *---------------------------------------------------------------------------- */ typedef struct { unsigned long magic; -#ifdef H5_HAVE_ROS3_VFD CURL *curlhandle; size_t filesize; char *httpverb; @@ -530,15 +493,19 @@ typedef struct { char *region; char *secret_id; unsigned char *signing_key; -#endif /* ifdef H5_HAVE_ROS3_VFD */ } s3r_t; + #define S3COMMS_S3R_MAGIC 0x44d8d79 +#ifdef __cplusplus +extern "C" { +#endif + /******************************************* * DECLARATION OF HTTP FIELD LIST ROUTINES * *******************************************/ -herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L, +H5_DLL herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value); @@ -546,9 +513,9 @@ herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L, * DECLARATION OF HTTP REQUEST BUFFER ROUTINES * ***********************************************/ -herr_t H5FD_s3comms_hrb_destroy(hrb_t **buf); +H5_DLL herr_t H5FD_s3comms_hrb_destroy(hrb_t **buf); -hrb_t * H5FD_s3comms_hrb_init_request(const char *verb, +H5_DLL hrb_t * H5FD_s3comms_hrb_init_request(const char *verb, const char *resource, const char *host); @@ -576,7 +543,7 @@ H5_DLL herr_t H5FD_s3comms_s3r_read(s3r_t *handle, H5_DLL struct tm * gmnow(void); -herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, +H5_DLL herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int cr_size, char *signed_headers_dest, int sh_size, @@ -587,27 +554,27 @@ H5_DLL herr_t H5FD_s3comms_bytes_to_hex(char *dest, size_t msg_len, hbool_t lowercase); -herr_t H5FD_s3comms_free_purl(parsed_url_t *purl); +H5_DLL herr_t H5FD_s3comms_free_purl(parsed_url_t *purl); -herr_t H5FD_s3comms_HMAC_SHA256(const unsigned char *key, +H5_DLL herr_t H5FD_s3comms_HMAC_SHA256(const unsigned char *key, size_t key_len, const char *msg, size_t msg_len, char *dest); -herr_t H5FD_s3comms_load_aws_profile(const char *name, +H5_DLL herr_t H5FD_s3comms_load_aws_profile(const char *name, char *key_id_out, char *secret_access_key_out, char *aws_region_out); -herr_t H5FD_s3comms_nlowercase(char *dest, +H5_DLL herr_t H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len); -herr_t H5FD_s3comms_parse_url(const char *str, +H5_DLL herr_t H5FD_s3comms_parse_url(const char *str, parsed_url_t **purl); -herr_t H5FD_s3comms_percent_encode_char(char *repr, +H5_DLL herr_t H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr_len); @@ -616,7 +583,7 @@ H5_DLL herr_t H5FD_s3comms_signing_key(unsigned char *md, const char *region, const char *iso8601now); -herr_t H5FD_s3comms_tostringtosign(char *dest, +H5_DLL herr_t H5FD_s3comms_tostringtosign(char *dest, const char *req_str, const char *now, const char *region); @@ -626,10 +593,12 @@ H5_DLL herr_t H5FD_s3comms_trim(char *dest, size_t s_len, size_t *n_written); -H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, - const char *s, - size_t s_len, - hbool_t encode_slash, - size_t *n_written); +H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, + hbool_t encode_slash, size_t *n_written); + +#ifdef __cplusplus +} +#endif +#endif /* H5_HAVE_ROS3_VFD */ diff --git a/src/Makefile.am b/src/Makefile.am index 1e1273c..ccee69b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,9 +62,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Fsfile.c H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ H5FAint.c H5FAstat.c H5FAtest.c \ - H5FD.c H5FDcore.c \ - H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c H5FDs3comms.c \ - H5FDmulti.c H5FDros3.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \ + H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c \ + H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \ H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \ H5FSstat.c H5FStest.c \ H5G.c H5Gbtree2.c H5Gcache.c \ @@ -134,6 +133,11 @@ if DIRECT_VFD_CONDITIONAL libhdf5_la_SOURCES += H5FDdirect.c endif +# Only compile the read-only S3 VFD if necessary +if ROS3_VFD_CONDITIONAL + libhdf5_la_SOURCES += H5FDros3.c H5FDs3comms.c +endif + # Public headers include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5version.h \ H5Apublic.h H5ACpublic.h \ diff --git a/test/ros3.c b/test/ros3.c index 7a12a8d..73b6ac2 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -30,10 +30,9 @@ #include "H5FDros3.h" /* this file driver's utilities */ #include "H5FDs3comms.h" /* for loading of credentials */ - +#ifdef H5_HAVE_ROS3_VFD /* only include the testing macros if needed */ -#ifdef H5_HAVE_ROS3_VFD /***************************************************************************** * @@ -371,14 +370,10 @@ if (strcmp((actual), (expected)) != 0) { \ #endif /* ifdef/else JSVERIFY_EXP_ACT */ -#endif /* H5_HAVE_ROS3_VFD */ - /******************************** * OTHER MACROS AND DEFINITIONS * ********************************/ -#ifdef H5_HAVE_ROS3_VFD - #define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) #define S3_TEST_PROFILE_NAME "ros3_vfd_test" @@ -408,16 +403,15 @@ static char s3_test_aws_access_key_id[64]; static char s3_test_aws_secret_access_key[128]; H5FD_ros3_fapl_t restricted_access_fa = { - H5FD__CURR_ROS3_FAPL_T_VERSION, /* fapl version */ + H5FD_CURR_ROS3_FAPL_T_VERSION, /* fapl version */ TRUE, /* authenticate */ "", /* aws region */ "", /* access key id */ ""}; /* secret access key */ H5FD_ros3_fapl_t anonymous_fa = { - H5FD__CURR_ROS3_FAPL_T_VERSION, + H5FD_CURR_ROS3_FAPL_T_VERSION, FALSE, "", "", "" }; -#endif /* H5_HAVE_ROS3_VFD */ /*--------------------------------------------------------------------------- @@ -437,21 +431,11 @@ H5FD_ros3_fapl_t anonymous_fa = { * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *--------------------------------------------------------------------------- */ static int test_fapl_config_validation(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 fapl configuration validation"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3_VFD defined */ /********************* * test-local macros * @@ -483,7 +467,7 @@ test_fapl_config_validation(void) struct testcase cases_arr[] = { { "non-authenticating config allows empties.\n", SUCCEED, - { H5FD__CURR_ROS3_FAPL_T_VERSION, /* version */ + { H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */ FALSE, /* authenticate */ "", /* aws_region */ "", /* secret_id */ @@ -492,7 +476,7 @@ test_fapl_config_validation(void) }, { "authenticating config asks for populated strings.\n", FAIL, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, TRUE, "", "", @@ -501,7 +485,7 @@ test_fapl_config_validation(void) }, { "populated strings; key is the empty string?\n", SUCCEED, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, TRUE, "region", "me", @@ -510,7 +494,7 @@ test_fapl_config_validation(void) }, { "id cannot be empty.\n", FAIL, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, TRUE, "", "me", @@ -519,7 +503,7 @@ test_fapl_config_validation(void) }, { "region cannot be empty.\n", FAIL, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, TRUE, "where", "", @@ -528,7 +512,7 @@ test_fapl_config_validation(void) }, { "all strings populated.\n", SUCCEED, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, TRUE, "where", "who", @@ -547,7 +531,7 @@ test_fapl_config_validation(void) { "non-authenticating config cares not for (de)population" "of strings.\n", SUCCEED, - { H5FD__CURR_ROS3_FAPL_T_VERSION, + { H5FD_CURR_ROS3_FAPL_T_VERSION, FALSE, "someregion", "someid", @@ -603,7 +587,7 @@ test_fapl_config_validation(void) H5Pget_fapl_ros3(fapl_id, &fa_fetch), "unable to get fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa_fetch.version, "invalid version number" ) JSVERIFY( config.version, @@ -646,8 +630,6 @@ error: } H5E_END_TRY; } return 1; -#endif /* H5_HAVE_ROS3_VFD */ - } /* test_fapl_config_validation */ @@ -670,23 +652,11 @@ error: * Programmer: John Mainzer * 7/12/17 * - * Changes: Test only fapl and flags. - * Jacob Smith 2017 - * *------------------------------------------------------------------------- */ static int test_ros3_fapl(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 fapl "); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3 defined */ - /************************ * test-local variables * ************************/ @@ -695,7 +665,7 @@ test_ros3_fapl(void) hid_t driver_id = -1; /* ID for this VFD */ unsigned long driver_flags = 0; /* VFD feature flags */ H5FD_ros3_fapl_t ros3_fa_0 = { - H5FD__CURR_ROS3_FAPL_T_VERSION, /* version */ + H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */ FALSE, /* authenticate */ "", /* aws_region */ "", /* secret_id */ @@ -737,7 +707,6 @@ error: } H5E_END_TRY; return 1; -#endif /* H5_HAVE_ROS3_VFD */ } /* test_ros3_fapl() */ @@ -763,14 +732,6 @@ error: static int test_vfd_open(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 VFD-level open"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3_VFD defined */ /********************* * test-local macros * @@ -967,8 +928,6 @@ error: #undef FAPL_H5P_DEFAULT #undef FAPL_ROS3_ANON -#endif /* H5_HAVE_ROS3_VFD */ - } /* test_vfd_open */ @@ -993,14 +952,6 @@ error: static int test_eof_eoa(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 eof/eoa gets and sets"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3_VFD defined */ /********************* * test-local macros * @@ -1119,7 +1070,6 @@ error: } return 1; -#endif /* H5_HAVE_ROS3_VFD */ } /* test_eof_eoa */ @@ -1141,15 +1091,6 @@ error: static int test_H5FDread_without_eoa_set_fails(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 VFD read-eoa temporal coupling library limitation "); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3_VFD defined */ - char buffer[256]; unsigned int i = 0; H5FD_t *file_shakespeare = NULL; @@ -1237,8 +1178,6 @@ error: return 1; -#endif /* H5_HAVE_ROS3_VFD */ - } /* test_H5FDread_without_eoa_set_fails */ @@ -1262,14 +1201,6 @@ error: static int test_read(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 VFD read/range-gets"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /* H5_HAVE_ROS3_VFD defined */ /********************* * test-local macros * @@ -1451,8 +1382,6 @@ error: return 1; -#endif /* H5_HAVE_ROS3_VFD */ - } /* test_read */ @@ -1478,15 +1407,6 @@ error: static int test_noops_and_autofails(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 VFD always-fail and no-op routines"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else - /********************* * test-local macros * *********************/ @@ -1606,8 +1526,6 @@ error: return 1; -#endif /* H5_HAVE_ROS3_VFD */ - } /* test_noops_and_autofails*/ @@ -1632,14 +1550,6 @@ error: static int test_cmp(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("ROS3 cmp (comparison)"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else /********************* * test-local macros * @@ -1750,7 +1660,6 @@ error: } return 1; -#endif /* H5_HAVE_ROS3_VFD */ } /* test_cmp */ @@ -1776,15 +1685,6 @@ error: static int test_H5F_integration(void) { -#ifndef H5_HAVE_ROS3_VFD - TESTING("S3 file access through HD5F library (H5F API)"); - SKIPPED(); - puts(" ROS3 VFD not enabled"); - fflush(stdout); - return 0; - -#else - /********************* * test-local macros * *********************/ @@ -1883,11 +1783,10 @@ HDprintf("\nerror!"); fflush(stdout); (void)H5Fclose(file); return 1; -#endif /* H5_HAVE_ROS3_VFD */ } /* test_H5F_integration */ - +#endif /* H5_HAVE_ROS3_VFD */ /*------------------------------------------------------------------------- @@ -1907,10 +1806,15 @@ HDprintf("\nerror!"); fflush(stdout); int main(void) { +#ifdef H5_HAVE_ROS3_VFD int nerrors = 0; + const char *bucket_url_env = NULL; + +#endif /* H5_HAVE_ROS3_VFD */ + + HDprintf("Testing ros3 VFD functionality.\n"); #ifdef H5_HAVE_ROS3_VFD - const char *bucket_url_env = NULL; /************************ * initialize test urls * @@ -1987,15 +1891,14 @@ main(void) s3_test_credentials_loaded = 1; HDstrncpy(restricted_access_fa.aws_region, (const char *)s3_test_aws_region, - H5FD__ROS3_MAX_REGION_LEN); + H5FD_ROS3_MAX_REGION_LEN); HDstrncpy(restricted_access_fa.secret_id, (const char *)s3_test_aws_access_key_id, - H5FD__ROS3_MAX_SECRET_ID_LEN); + H5FD_ROS3_MAX_SECRET_ID_LEN); HDstrncpy(restricted_access_fa.secret_key, (const char *)s3_test_aws_secret_access_key, - H5FD__ROS3_MAX_SECRET_KEY_LEN); + H5FD_ROS3_MAX_SECRET_KEY_LEN); } -#endif /* H5_HAVE_ROS3_VFD */ /****************** * commence tests * @@ -2003,8 +1906,6 @@ main(void) h5_reset(); - HDprintf("Testing ros3 VFD functionality.\n"); - nerrors += test_fapl_config_validation(); nerrors += test_ros3_fapl(); nerrors += test_vfd_open(); @@ -2025,6 +1926,12 @@ main(void) } return nerrors; /* 0 if no errors, 1 if any errors */ -} /* main() */ +#else + HDprintf("SKIPPED - read-only S3 VFD not built\n"); + return EXIT_SUCCESS; + +#endif /* H5_HAVE_ROS3_VFD */ + +} /* main() */ diff --git a/test/s3comms.c b/test/s3comms.c index 7bc9961..9453b75 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -23,6 +23,8 @@ #include "H5FDs3comms.h" #include "H5MMprivate.h" /* memory management */ +#ifdef H5_HAVE_ROS3_VFD + /***************************************************************************** * * FILE-LOCAL TESTING MACROS @@ -361,8 +363,6 @@ if (strcmp((actual), (expected)) != 0) { \ #endif /* ifdef/else JSVERIFY_EXP_ACT */ -#ifdef H5_HAVE_ROS3_VFD - #define S3_TEST_PROFILE_NAME "ros3_vfd_test" #define S3_TEST_RESOURCE_TEXT_RESTRICTED "t8.shakespeare.txt" @@ -384,8 +384,6 @@ static char s3_test_aws_secret_access_key[128] = ""; static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = ""; static hbool_t s3_test_bucket_defined = FALSE; -#endif /* H5_HAVE_ROS3_VFD */ - /*--------------------------------------------------------------------------- * @@ -1163,7 +1161,6 @@ test_HMAC_SHA256(void) * test-local structures * *************************/ -#ifdef H5_HAVE_ROS3_VFD struct testcase { herr_t ret; /* SUCCEED/FAIL expected from call */ const unsigned char key[SHA256_DIGEST_LENGTH]; @@ -1211,16 +1208,9 @@ test_HMAC_SHA256(void) char *dest = NULL; int i = 0; int n_cases = 3; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("HMAC_SHA256"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else for (i = 0; i < n_cases; i++) { if (cases[i].dest_size == 0) { dest = NULL; @@ -1272,7 +1262,6 @@ test_HMAC_SHA256(void) error: free(dest); return -1; -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_HMAC_SHA256() */ @@ -1706,7 +1695,6 @@ error: static herr_t test_s3r_get_filesize(void) { -#ifdef H5_HAVE_ROS3_VFD /************************ * test-local variables * @@ -1714,16 +1702,9 @@ test_s3r_get_filesize(void) char url_raven[S3_TEST_MAX_URL_SIZE]; s3r_t *handle = NULL; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("s3r_get_filesize"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else /* setup -- compose url to target resource */ if (FALSE == s3_test_bucket_defined) { @@ -1759,7 +1740,6 @@ error: (void)H5FD_s3comms_s3r_close(handle); return -1; -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_s3r_get_filesize() */ @@ -1776,7 +1756,6 @@ error: static herr_t test_s3r_open(void) { -#ifdef H5_HAVE_ROS3_VFD /************************ * test-local variables * @@ -1792,16 +1771,9 @@ test_s3r_open(void) s3r_t *handle = NULL; hbool_t curl_ready = FALSE; parsed_url_t *purl = NULL; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("s3r_open"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else if (s3_test_credentials_loaded == 0) { SKIPPED(); puts(" s3 credentials are not loaded"); @@ -2000,7 +1972,6 @@ error: curl_global_cleanup(); return -1; -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_s3r_open() */ @@ -2029,7 +2000,6 @@ error: static herr_t test_s3r_read(void) { -#ifdef H5_HAVE_ROS3_VFD #define S3COMMS_TEST_BUFFER_SIZE 256 @@ -2042,16 +2012,9 @@ test_s3r_read(void) s3r_t *handle = NULL; hbool_t curl_ready = FALSE; unsigned int i = 0; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("test_s3r_read"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else /* * initial setup */ @@ -2226,7 +2189,6 @@ error: return -1; #undef S3COMMS_TEST_BUFFER_SIZE -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_s3r_read() */ @@ -2249,7 +2211,6 @@ error: static herr_t test_signing_key(void) { -#ifdef H5_HAVE_ROS3_VFD /************************* * test-local structures * *************************/ @@ -2279,16 +2240,9 @@ test_signing_key(void) int i = 0; unsigned char *key = NULL; int ncases = 1; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("signing_key"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else for (i = 0; i < ncases; i++) { key = (unsigned char *)HDmalloc(sizeof(unsigned char) * \ SHA256_DIGEST_LENGTH); @@ -2365,7 +2319,6 @@ error: } return -1; -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_signing_key() */ @@ -2394,7 +2347,6 @@ error: static herr_t test_tostringtosign(void) { -#ifdef H5_HAVE_ROS3_VFD /************************ * test-local variables * ************************/ @@ -2403,16 +2355,9 @@ test_tostringtosign(void) const char iso8601now[] = "20130524T000000Z"; const char region[] = "us-east-1"; char s2s[512]; -#endif /* H5_HAVE_ROS3_VFD */ TESTING("s3comms tostringtosign"); -#ifndef H5_HAVE_ROS3_VFD - SKIPPED(); - puts(" ROS3 VFD is not enabled"); - fflush(stdout); - return 0; -#else JSVERIFY( SUCCEED, H5FD_s3comms_tostringtosign(s2s, canonreq, iso8601now, region), "unable to create string to sign" ) @@ -2437,7 +2382,6 @@ test_tostringtosign(void) error : return -1; -#endif /* H5_HAVE_ROS3_VFD */ } /* end test_tostringtosign() */ @@ -2679,6 +2623,7 @@ error: } /* end test_uriencode() */ +#endif /* H5_HAVE_ROS3_VFD */ @@ -2702,13 +2647,14 @@ error: int main(void) { - int nerrors = 0; #ifdef H5_HAVE_ROS3_VFD + int nerrors = 0; const char *bucket_url_env = NULL; -#endif /* H5_HAVE_ROS3_VFD */ h5_reset(); +#endif /* H5_HAVE_ROS3_VFD */ + HDprintf("Testing S3Communications functionality.\n"); #ifdef H5_HAVE_ROS3_VFD @@ -2744,8 +2690,6 @@ main(void) s3_test_bucket_defined = TRUE; } -#endif /* H5_HAVE_ROS3_VFD */ - /* tests ordered rougly by dependence */ nerrors += test_macro_format_credential() < 0 ? 1 : 0; nerrors += test_trim() < 0 ? 1 : 0; @@ -2774,5 +2718,13 @@ main(void) HDprintf("All S3comms tests passed.\n"); return 0; + +#else + + HDprintf("SKIPPED - read-only S3 VFD not built\n"); + return EXIT_SUCCESS; + +#endif /* H5_HAVE_ROS3_VFD */ + } /* end main() */ diff --git a/test/vfd.c b/test/vfd.c index 2b15430..68fe0bd 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -58,7 +58,7 @@ const char *FILENAME[] = { "stdio_file", /*7*/ "windows_file", /*8*/ "new_multi_file_v16",/*9*/ - "ro_s3_file6", /*10*/ + "ro_s3_file", /*10*/ NULL }; @@ -1940,6 +1940,7 @@ error: static herr_t test_ros3(void) { +#ifdef H5_HAVE_ROS3_VFD hid_t fid = -1; /* file ID */ hid_t fapl_id = -1; /* file access property list ID */ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ @@ -1951,14 +1952,20 @@ test_ros3(void) H5FD_ros3_fapl_t test_ros3_fa; H5FD_ros3_fapl_t ros3_fa_0 = { - /* version = */ H5FD__CURR_ROS3_FAPL_T_VERSION, + /* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION, /* authenticate = */ FALSE, /* aws_region = */ "", /* secret_id = */ "", /* secret_key = */ "plugh", }; +#endif /*H5_HAVE_ROS3_VFD */ - TESTING("ROS3 file driver"); + TESTING("Read-only S3 file driver"); + +#ifndef H5_HAVE_ROS3_VFD + SKIPPED(); + return 0; +#else /* H5_HAVE_ROS3_VFD */ /* Set property list and file name for ROS3 driver. */ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -1988,61 +1995,13 @@ test_ros3(void) if (H5FDdriver_query(driver_id, &driver_flags) < 0) TEST_ERROR; - if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) + TEST_ERROR /* Check for extra flags not accounted for above */ if(driver_flags != (H5FD_FEAT_DATA_SIEVE)) TEST_ERROR - /* can't create analogs of the following tests until the - * ROS3 driver is up and running in a minimal fashion. - * Comment them out until we get to them. - */ -#if 0 - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) - TEST_ERROR; - - /* Retrieve the access property list... */ - if((fapl_id_out = H5Fget_access_plist(fid)) < 0) - TEST_ERROR; - - /* Check that the driver is correct */ - if(H5FD_ROS3 != H5Pget_driver(fapl_id_out)) - TEST_ERROR; - - /* ...and close the property list */ - if(H5Pclose(fapl_id_out) < 0) - TEST_ERROR; - - /* Check that we can get an operating-system-specific handle from - * the library. - */ - if(H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0) - TEST_ERROR; - if(os_file_handle == NULL) - FAIL_PUTS_ERROR("NULL os-specific vfd/file handle was returned from H5Fget_vfd_handle"); - - - /* There is no garantee the size of metadata in file is constant. - * Just try to check if it's reasonable. - * - * Currently it should be around 2 KB. - */ - if(H5Fget_filesize(fid, &file_size) < 0) - TEST_ERROR; - if(file_size < 1 * KB || file_size > 4 * KB) - FAIL_PUTS_ERROR("suspicious file size obtained from H5Fget_filesize"); - - /* Close and delete the file */ - if(H5Fclose(fid) < 0) - TEST_ERROR; - h5_delete_test_file(FILENAME[0], fapl_id); - - /* Close the fapl */ - if(H5Pclose(fapl_id) < 0) - TEST_ERROR; -#endif - PASSED(); return 0; @@ -2053,10 +2012,9 @@ error: H5Fclose(fid); } H5E_END_TRY; return -1; +#endif /* H5_HAVE_ROS3_VFD */ } /* end test_ros3() */ - - /*------------------------------------------------------------------------- * Function: main * diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index e140fff..47ce690 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -1129,17 +1129,13 @@ done: * Programmer: Jacob Smith * 2017-11-13 * - * Changes: None. - * *---------------------------------------------------------------------------- */ +#ifdef H5_HAVE_ROS3_VFD int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) { -#ifndef H5_HAVE_ROS3_VFD - return 0; -#else int show_progress = 0; /* set to 1 for debugging */ int ret_value = 1; /* 1 for success, 0 for failure */ /* e.g.? if (!populate()) { then failed } */ @@ -1159,7 +1155,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, if (show_progress) { HDprintf(" preset fapl with default values\n"); } - fa->version = H5FD__CURR_ROS3_FAPL_T_VERSION; + fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION; fa->authenticate = FALSE; *(fa->aws_region) = '\0'; *(fa->secret_id) = '\0'; @@ -1196,7 +1192,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, if (*values[0] != '\0' && *values[1] != '\0') { - if (HDstrlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN) { + if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { if (show_progress) { HDprintf(" ERROR: aws_region value too long\n"); } @@ -1210,7 +1206,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, } - if (HDstrlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN) { + if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { if (show_progress) { HDprintf(" ERROR: secret_id value too long\n"); } @@ -1224,7 +1220,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, HDprintf(" secret_id set\n"); } - if (HDstrlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN) { + if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { if (show_progress) { HDprintf(" ERROR: secret_key value too long\n"); } @@ -1259,9 +1255,9 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, done: return ret_value; -#endif /* H5_HAVE_ROS3_VFD */ } /* h5tools_populate_ros3_fapl */ +#endif /* H5_HAVE_ROS3_VFD */ /*----------------------------------------------------------------------------- @@ -1329,5 +1325,3 @@ done: } /* h5tools_set_configured_fapl() */ - - diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 1c6ba2a..0fa5250 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -182,8 +182,11 @@ H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void); H5TOOLS_DLL int h5tools_set_configured_fapl(hid_t fapl_id, const char vfd_name[], void *fapl_t_ptr); +#ifdef H5_HAVE_ROS3_VFD H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values); +#endif /* H5_HAVE_ROS3_VFD */ + #ifdef __cplusplus } #endif diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index 8d489e4..b4d66e0 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -653,7 +653,7 @@ test_populate_ros3_fa(void) show_progress = TRUE; #endif /* H5TOOLS_UTILS_TEST_DEBUG */ - HDassert(bad_version != H5FD__CURR_ROS3_FAPL_T_VERSION); + HDassert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION); /********* * TESTS * @@ -679,7 +679,7 @@ test_populate_ros3_fa(void) JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, NULL), "NULL values pointer yields \"default\" fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -697,7 +697,7 @@ test_populate_ros3_fa(void) JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values), "empty values yields \"default\" fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -715,7 +715,7 @@ test_populate_ros3_fa(void) JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values), "four values" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( TRUE, fa.authenticate, NULL ) JSVERIFY_STR( "x", fa.aws_region, NULL ) JSVERIFY_STR( "y", fa.secret_id, NULL ) @@ -733,7 +733,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -751,7 +751,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -771,11 +771,11 @@ test_populate_ros3_fa(void) if (show_progress) { HDprintf("region overflow\n"); } - HDassert(HDstrlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN); + HDassert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -793,7 +793,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -811,7 +811,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -839,11 +839,11 @@ test_populate_ros3_fa(void) if (show_progress) { HDprintf("id overflow\n"); } - HDassert(HDstrlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN); + HDassert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "x", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -861,7 +861,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -879,7 +879,7 @@ test_populate_ros3_fa(void) JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( TRUE, fa.authenticate, NULL ) JSVERIFY_STR( "x", fa.aws_region, NULL ) JSVERIFY_STR( "y", fa.secret_id, NULL ) @@ -897,7 +897,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -915,7 +915,7 @@ test_populate_ros3_fa(void) JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "", fa.aws_region, NULL ) JSVERIFY_STR( "", fa.secret_id, NULL ) @@ -943,11 +943,11 @@ test_populate_ros3_fa(void) if (show_progress) { HDprintf("key overflow\n"); } - HDassert(HDstrlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN); + HDassert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl" ) - JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) + JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL ) JSVERIFY( FALSE, fa.authenticate, NULL ) JSVERIFY_STR( "x", fa.aws_region, NULL ) JSVERIFY_STR( "y", fa.secret_id, NULL ) -- cgit v0.12