summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-07-27 19:23:53 (GMT)
committerGitHub <noreply@github.com>2023-07-27 19:23:53 (GMT)
commitcb69bc279ce12d078d43f7aa70b2929d8df1c147 (patch)
treec3eb92d85e2bec72bdeaf5e2a5bd415a3237718f /testpar
parent2bb4c909c4c63cf87d10c494cd76d57092d45335 (diff)
downloadhdf5-cb69bc279ce12d078d43f7aa70b2929d8df1c147.zip
hdf5-cb69bc279ce12d078d43f7aa70b2929d8df1c147.tar.gz
hdf5-cb69bc279ce12d078d43f7aa70b2929d8df1c147.tar.bz2
Fix assertion failure when attempting to use IOC VFD directly (#3187) (#3288)
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'testpar')
-rw-r--r--testpar/CMakeTests.cmake1
-rw-r--r--testpar/t_subfiling_vfd.c41
2 files changed, 42 insertions, 0 deletions
diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake
index a77535c..dfdde59 100644
--- a/testpar/CMakeTests.cmake
+++ b/testpar/CMakeTests.cmake
@@ -99,6 +99,7 @@ set (test_par_CLEANFILES
MPItest.h5
ShapeSameTest.h5
test_subfiling_basic_create.h5
+ test_subfiling_only_ioc_fail.h5
test_subfiling_config_file.h5
test_subfiling_stripe_sizes.h5
test_subfiling_selection_strategies.h5
diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c
index 0841923..ba9ecf5 100644
--- a/testpar/t_subfiling_vfd.c
+++ b/testpar/t_subfiling_vfd.c
@@ -91,6 +91,7 @@ static hid_t create_subfiling_ioc_fapl(MPI_Comm comm, MPI_Info info, hbool_t cus
/* Test functions */
static void test_create_and_close(void);
+static void test_ioc_only_fail(void);
static void test_config_file(void);
static void test_stripe_sizes(void);
static void test_selection_strategies(void);
@@ -102,6 +103,7 @@ static void test_subfiling_h5fuse(void);
static test_func tests[] = {
test_create_and_close,
+ test_ioc_only_fail,
test_config_file,
test_stripe_sizes,
test_selection_strategies,
@@ -219,6 +221,45 @@ test_create_and_close(void)
#undef SUBF_FILENAME
/*
+ * A simple test that ensures file creation fails when
+ * attempting to use the IOC VFD by itself, without it
+ * being stacked under the Subfiling VFD. This is
+ * currently unsupported.
+ */
+#define SUBF_FILENAME "test_subfiling_only_ioc_fail.h5"
+static void
+test_ioc_only_fail(void)
+{
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+
+ curr_nerrors = nerrors;
+
+ if (MAINPROCESS)
+ TESTING_2("invalid use of IOC VFD by itself");
+
+ /* Setup a FAPL using only the IOC VFD */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl_id >= 0), "H5Pcreate succeeded");
+
+ VRFY((H5Pset_mpi_params(fapl_id, comm_g, info_g) >= 0), "H5Pset_mpi_params succeeded");
+
+ VRFY((H5Pset_fapl_ioc(fapl_id, NULL) >= 0), "H5Pset_fapl_ioc succeeded");
+
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fcreate(SUBF_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ }
+ H5E_END_TRY;
+ VRFY((file_id < 0), "H5Fcreate failed successfully");
+
+ VRFY((H5Pclose(fapl_id) >= 0), "FAPL close succeeded");
+
+ CHECK_PASSED();
+}
+#undef SUBF_FILENAME
+
+/*
* Test to check that Subfiling configuration file matches
* what is expected for a given configuration
*/