diff options
author | David Young <dyoung@hdfgroup.org> | 2020-04-28 15:27:55 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-04-28 15:27:55 (GMT) |
commit | a5ca065b7c3805d3408d0af725648d71ac9dcb4c (patch) | |
tree | 062f05750a675adb05f33ad34df5fb691266ec42 /test | |
parent | 17a1789b856ba1b832362def84ff566de4d992c4 (diff) | |
download | hdf5-a5ca065b7c3805d3408d0af725648d71ac9dcb4c.zip hdf5-a5ca065b7c3805d3408d0af725648d71ac9dcb4c.tar.gz hdf5-a5ca065b7c3805d3408d0af725648d71ac9dcb4c.tar.bz2 |
Add a rudimentary zoo test to the VFD SWMR test script.
Briefly describe the variable-length test with a comment.
Diffstat (limited to 'test')
-rw-r--r-- | test/testvfdswmr.sh.in | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index da90bb8..925f3e2 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -118,7 +118,7 @@ if [ $rc -ne 0 ] ; then exit 0 fi -all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob" +all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo" tests=${all_tests} if [ $# -gt 0 ]; then @@ -529,6 +529,9 @@ do done done +# +# Test variable-length strings, expecting errors. +# for ty in null oob; do if [ ${ty} = null ]; then @@ -584,6 +587,57 @@ for ty in null oob; do rm -f vfd_swmr_vlstr_reader.*.{out,rc} done +# +# Make sure that a "zoo"---the variety of HDF5 object types---can be +# read and written by VFD SWMR. +# +if [ ${do_zoo:-no} = yes ]; then + [ -e ./fifo ] && rm -f ./fifo + mkfifo -m 0600 ./fifo + rm -f ./shared_tick_num + echo launch vfd_swmr_zoo_writer + STDIN_PATH="./fifo" catch_out_err_and_rc vfd_swmr_zoo_writer \ + ../vfd_swmr_zoo_writer -q & + pid_writer=$! + + STDOUT_PATH="./fifo" catch_out_err_and_rc vfd_swmr_zoo_reader \ + ../vfd_swmr_zoo_reader -q -W & + pid_reader=$! + + # Wait for the reader to finish before signalling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + kill -USR1 $(cat vfd_swmr_zoo_writer.pid) + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_zoo_reader.rc) -ne 0 ]; then + echo reader had error + nsofterrors=$((nsofterrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_zoo_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Check for error and exit if one occured + if test $nerrors -ne 0 ; then + echo "VFD SWMR tests failed with $nerrors errors." + echo "(Writer and reader output preserved)" + exit 1 + fi + + # Clean up output files + rm -f ./fifo + rm -f vfd_swmr_zoo_writer.{out,rc} + rm -f vfd_swmr_zoo_reader.*.{out,rc} +fi + + ############################################################################### ## Report and exit ############################################################################### |