summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-06-28 04:36:12 (GMT)
committerGitHub <noreply@github.com>2023-06-28 04:36:12 (GMT)
commitf5ca9237a296f6deefb633b6fb1d61daea4b4f6e (patch)
tree1c1777f6377a450edd0e675921c51e2a8394c7c0 /testpar
parent7d1fdb2d277530eec6d1c8ff937634e7028892aa (diff)
downloadhdf5-f5ca9237a296f6deefb633b6fb1d61daea4b4f6e.zip
hdf5-f5ca9237a296f6deefb633b6fb1d61daea4b4f6e.tar.gz
hdf5-f5ca9237a296f6deefb633b6fb1d61daea4b4f6e.tar.bz2
Fix assertion failure when attempting to use IOC VFD directly (#3187)
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 10a4dd2..04d8762 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
*/