diff options
Diffstat (limited to 'test/testvfdswmr.sh.in')
-rw-r--r-- | test/testvfdswmr.sh.in | 316 |
1 files changed, 312 insertions, 4 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index c0b98fd..7ab324e 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/us/bin/env bash # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -75,6 +75,13 @@ DSETCHKS_FIFO_WRITER_TO_READER=fifo_dsetchks_writer_to_reader DSETCHKS_FIFO_READER_TO_WRITER=fifo_dsetchks_reader_to_writer ############################################################################### +## For gfail{1,2,3,4} test: definitions for fifo files to coordinate test runs +############################################################################### +# +GFAIL_FIFO_WRITER_TO_READER=fifo_group_writer_to_reader +GFAIL_FIFO_READER_TO_WRITER=fifo_group_reader_to_writer + +############################################################################### ## short hands and function definitions ############################################################################### # @@ -142,11 +149,16 @@ if [ $rc -ne 0 ] ; then fi all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo" -all_tests="${all_tests} groups groups_attrs groups_ops few_big many_small attrdset" +all_tests="${all_tests} groups groups_attrs groups_ops few_big many_small" -# For exhaustive run, add: os_groups_attrs, os_groups_ops, os_groups_seg, dsetops, dsetchks,independ_wr +# For exhaustive run, add: +# attrdset, dsetops, dsetops_ref, dsetchks +# os_groups_attrs, os_groups_ops, os_groups_seg, independ_wr, +# gfail_entry_length, gfail_checksum, gfail_page_size, gfail_index_space if [[ "$HDF5TestExpress" -eq 0 ]] ; then # exhaustive run - all_tests="${all_tests} os_groups_attrs os_groups_ops os_groups_seg dsetops dsetchks independ_wr" + all_tests="${all_tests} attrdset dsetops dsetops_ref dsetchks" + all_tests="${all_tests} os_groups_attrs os_groups_ops os_groups_seg independ_wr" + all_tests="${all_tests} gfail_entry_length gfail_checksum gfail_page_size gfail_index_space" fi tests=${all_tests} @@ -1340,6 +1352,70 @@ done ############################################################################### # +# "dsetops_ref" test (this is the dsetops test with options added for testing references) +# --test object (-O) and region (-R) references +# --test with raw data flush only +# --test without flush will result in error because the references are not there +# to continue further testing +# +# Only for exhaustive run +# +############################################################################### +# +# +# Loop with +for ref in "-O" "-R" "-O -R"; do + # Loop with different operations + for options in "-p -e 20 -t -g -q" "-g -m 5 -n 2 -s 10 -w 7 -q" "-k -m 10 -n 5 -r 5 -l 10 -q"; do + # + # + if [ ${do_dsetops_ref:-no} = no ]; then + continue + fi + # Clean up any existing fifo files from previous runs + if [ -e ./$DSETOPS_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$DSETOPS_FIFO_WRITER_TO_READER + fi + if [ -e ./$DSETOPS_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$DSETOPS_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_dsetops_writer dsetops, options $options $ref......may take some time...... + catch_out_err_and_rc vfd_swmr_dsetops_writer \ + ../vfd_swmr_dsetops_writer $options $ref & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_dsetops_reader \ + ../vfd_swmr_dsetops_reader $options $ref & + pid_reader=$! + + # Wait for the reader to finish before signaling 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 + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_dsetops_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_dsetops_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_dsetops_writer.{out,rc} + rm -f vfd_swmr_dsetops_reader.*.{out,rc} + done +done + +############################################################################### +# # "dsetchks" test # # Only for exhaustive run @@ -1427,6 +1503,238 @@ fi ############################################################################### +# +# "gfail_entry_length" test +# +# Only for exhaustive run +# +# Verify that the assertion failure for old and new entry length is fixed. +# (See issue #1 in Kent's documentation "Designed to Fail Tests and Issues". +# +############################################################################### +# +# +if [ ${do_gfail_entry_length:-no} = yes ]; then + # + # Clean up any existing fifo files from previous runs + if [ -e ./$GFAIL_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$GFAIL_FIFO_WRITER_TO_READER + fi + if [ -e ./$GFAIL_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$GFAIL_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_gfail_writer -q -m 10 -n 340000 + catch_out_err_and_rc vfd_swmr_gfail_entry_length_writer \ + ../vfd_swmr_gfail_writer -q -m 10 -n 340000 & + pid_writer=$! + + echo launch vfd_swmr_gfail_reader -m 10 -n 340000 + catch_out_err_and_rc vfd_swmr_gfail_entry_length_reader \ + ../vfd_swmr_gfail_reader -m 10 -n 340000 & + pid_reader=$! + + # Wait for the reader to finish before signaling 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 + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_gfail_entry_length_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_gfail_entry_length_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_gfail_entry_length_writer.{out,rc} + rm -f vfd_swmr_gfail_entry_length_reader.*.{out,rc} +fi + +############################################################################### +# +# "gfail_checksum" test +# +# Only for exhaustive run +# +# Verify that meaningful message about increasing max_lag is printed when +# incorrect metadata checksum error is enountered when loading the cache entry. +# +# Note that there will be messages from the error stack printed out for this test. +# This is expected. +# +# (See issue #2 in Kent's documentation "Designed to Fail Tests and Issues". +# +############################################################################### +# +# +if [ ${do_gfail_checksum:-no} = yes ]; then + # + # Clean up any existing fifo files from previous runs + if [ -e ./$GFAIL_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$GFAIL_FIFO_WRITER_TO_READER + fi + if [ -e ./$GFAIL_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$GFAIL_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_gfail_writer -q -n 420000 ......may take some time...... + catch_out_err_and_rc vfd_swmr_gfail_checksum_writer \ + ../vfd_swmr_gfail_writer -q -m 50 -t 10 -n 4000000 & + pid_writer=$! + + echo launch vfd_swmr_gfail_reader -n 420000 ......may take some time...... + catch_out_err_and_rc vfd_swmr_gfail_checksum_reader \ + ../vfd_swmr_gfail_reader -q -m 50 -t 10 -n 4000000 & + pid_reader=$! + + # Wait for the reader to finish before signaling 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 + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_gfail_checksum_reader.rc) -ne 0 ]; then + grep "suggest to increase the value of max_lag" vfd_swmr_gfail_checksum_reader.out >/dev/null 2>&1 + if test $? -ne 0; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_gfail_checksum_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_gfail_checksum_writer.{out,rc} + rm -f vfd_swmr_gfail_checksum_reader.*.{out,rc} +fi + +############################################################################### +# +# "gfail_page_size" test +# +# Only for exhaustive run +# +# Verify that the assertion failure is fixed when non-default page size is set. +# (See issue #3 in Kent's documentation "Designed to Fail Tests and Issues". +# +############################################################################### +# +# +if [ ${do_gfail_page_size:-no} = yes ]; then + # + # Clean up any existing fifo files from previous runs + if [ -e ./$GFAIL_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$GFAIL_FIFO_WRITER_TO_READER + fi + if [ -e ./$GFAIL_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$GFAIL_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_gfail_writer -q -m 10 -B 8192 -s 8192 -n 320000 + catch_out_err_and_rc vfd_swmr_gfail_page_size_writer \ + ../vfd_swmr_gfail_writer -q -m 10 -B 8192 -s 8192 -n 320000 & + pid_writer=$! + + echo launch vfd_swmr_gfail_reader -m 10 -B 8192 -s 8192 -n 320000 + catch_out_err_and_rc vfd_swmr_gfail_page_size_reader \ + ../vfd_swmr_gfail_reader -m 10 -B 8192 -s 8192 -n 320000 & + pid_reader=$! + + # Wait for the reader to finish before signaling 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 + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_gfail_page_size_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_gfail_page_size_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_gfail_page_size_writer.{out,rc} + rm -f vfd_swmr_gfail_page_size_reader.*.{out,rc} +fi + +############################################################################### +# +# "gfail_index_space" test +# +# Only for exhaustive run +# +# Verify that the failure is fixed when there is not enough space to copy the index. +# (See issue #4 in Kent's documentation "Designed to Fail Tests and Issues". +# +############################################################################### +# +# +if [ ${do_gfail_index_space:-no} = yes ]; then + # + # Clean up any existing fifo files from previous runs + if [ -e ./$GFAIL_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$GFAIL_FIFO_WRITER_TO_READER + fi + if [ -e ./$GFAIL_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$GFAIL_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_gfail_writer -q -m 50 -t 10 -n 1000000 ......may take some time...... + catch_out_err_and_rc vfd_swmr_gfail_index_space_writer \ + ../vfd_swmr_gfail_writer -q -m 50 -t 10 -n 1000000 & + pid_writer=$! + + echo launch vfd_swmr_gfail_reader -m 50 -t 10 -n 1000000 ......may take some time...... + catch_out_err_and_rc vfd_swmr_gfail_index_space_reader \ + ../vfd_swmr_gfail_reader -m 50 -t 10 -n 1000000 & + pid_reader=$! + + # Wait for the reader to finish before signaling 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 + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_gfail_index_space_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_gfail_index_space_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_gfail_index_space_writer.{out,rc} + rm -f vfd_swmr_gfail_index_space_reader.*.{out,rc} +fi + +############################################################################### ## Report and exit ############################################################################### cd .. |