diff --git a/tests/bufr_indexing.sh b/tests/bufr_indexing.sh index a3030d46c..297f71bba 100755 --- a/tests/bufr_indexing.sh +++ b/tests/bufr_indexing.sh @@ -12,6 +12,7 @@ label="bufr_indexing_test" tempIndex=temp.$label.$$.idx +tempBufr=temp.$label.$$.bufr tempOut=temp.$label.$$.out tempRef=temp.$label.$$.ref @@ -41,5 +42,17 @@ ${tools_dir}/bufr_index_build -k mars.ident -o $tempIndex $infile |\ grep -q "mars.ident = { 01001, 01003, 01007 }" +# ------------------ +# Error conditions +# ------------------ +echo BUFR > $tempBufr +set +e +${tools_dir}/bufr_index_build $tempBufr > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "End of resource reached" $tempOut + + # Clean up -rm -f $tempIndex $tempOut $tempRef +rm -f $tempIndex $tempOut $tempRef $tempBufr diff --git a/tests/codes_export_resource.sh b/tests/codes_export_resource.sh index fddb45c45..13623c8a3 100755 --- a/tests/codes_export_resource.sh +++ b/tests/codes_export_resource.sh @@ -67,6 +67,12 @@ status=$? set -e [ $status -eq 1 ] +set +e +${tools_dir}/codes_export_resource -s GRIB2 / +status=$? +set -e +[ $status -eq 1 ] + # Clean up rm -f $temp diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh index 58980f85d..69d1031bc 100755 --- a/tests/grib_indexing.sh +++ b/tests/grib_indexing.sh @@ -153,6 +153,18 @@ ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null ${tools_dir}/grib_dump $tempIndex1 >/dev/null +# ------------------ +# Error conditions +# ------------------ +echo GRIB > $tempGribFile1 +set +e +${tools_dir}/grib_index_build $tempGribFile1 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "End of resource reached" $tempOut + + # Clean up rm -f $tempOut $tempRef rm -f $tempIndex $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2