Skip to content

Commit

Permalink
Merge pull request #2631 from DennisHeimbigner/distcheck.dmh
Browse files Browse the repository at this point in the history
Fix a distcheck failure with nczarr_test/run_interop.sh
  • Loading branch information
WardF committed Feb 17, 2023
2 parents bb81ab3 + 6a8d5b9 commit 0034e31
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 37 deletions.
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ This file contains a high-level description of this package's evolution. Release

## 4.9.2 - TBD


* Fix 'make distcheck' error in run_interop.sh. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????).
* Update `nc-config` to remove inclusion from automatically-detected `nf-config` and `ncxx-config` files, as the wrong files could be included in the output. This is in support of [GitHub #2274](https://github.com/Unidata/netcdf-c/issues/2274).
* [Bug Fix] Update H5FDhttp.[ch] to work with HDF5 version 1.14.0. See [Github #2615](https://github.com/Unidata/netcdf-c/pull/2615).
* Update H5FDhttp.[ch] to work with HDF5 version 1.14.0. See [Github #2615](https://github.com/Unidata/netcdf-c/pull/2615).

## 4.9.1 - February 2, 2023

Expand Down
2 changes: 1 addition & 1 deletion libhdf5/H5FDhttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "H5Ipublic.h"

#if H5_VERSION_GE(1,14,0)
#define H5_VFD_HTTP ((H5FD_class_value_t)(H5_VFD_MAX - 2))
#define H5_VFD_HTTP ((H5FD_class_value_t)(514))
#define H5FD_HTTP (H5FDperform_init(H5FD_http_init))
#else
#define H5FD_HTTP (H5FD_http_init())
Expand Down
3 changes: 2 additions & 1 deletion nczarr_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ ref_string.cdl ref_string_nczarr.baseline ref_string_zarr.baseline ref_scalar.cd
ref_nulls_nczarr.baseline ref_nulls_zarr.baseline ref_nulls.cdl

# Interoperability files
EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl
EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl \
ref_zarr_test_data.cdl.gz

CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp_ngc.c ref_zarr_test_data.cdl tst_*.nc.zip ref_quotes.zip ref_power_901_constants.zip

Expand Down
72 changes: 40 additions & 32 deletions nczarr_test/run_interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ UB="${NCZARR_S3_TEST_BUCKET}"

testcasefile() {
zext=file
ref=$1
base=$1
mode=$2
metaonly=$3
if test "x$metaonly" = xmetaonly ; then flags="-h"; fi
fileargs ${execdir}/$ref "mode=$mode,$zext"
rm -f tmp_${ref}_${zext}.cdl
${NCDUMP} $flags $fileurl > tmp_${ref}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl
fileargs ${builddir}/ref_$base "mode=$mode,$zext"
rm -f tmp_${base}_${zext}.cdl
${NCDUMP} $flags $fileurl > tmp_${base}_${zext}.cdl
diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}

testcasezip() {
zext=zip
ref=$1
base=$1
mode=$2
fileargs $ref "mode=$mode,$zext"
rm -f tmp_${ref}_${zext}.cdl
${NCDUMP} -h $flags $fileurl > tmp_${ref}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl
fileargs ${builddir}/ref_$base "mode=$mode,$zext"
rm -f tmp_${base}_${zext}.cdl
${NCDUMP} -h $flags $fileurl > tmp_${base}_${zext}.cdl
diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}

testcases3() {
zext=s3
zarr=$1
ref=$2
mode=$3
rm -f tmp_${zarr}_${zext}.cdl
url="https://${UH}/${UB}/${zarr}#mode=${mode},s3"
${NCDUMP} $url > tmp_${zarr}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${zarr}_${zext}.cdl
base=$1
mode=$2
rm -f tmp_${base}_${zext}.cdl
url="https://${UH}/${UB}/${base}.zarr#mode=${mode},s3"
${NCDUMP} $url > tmp_${base}_${zext}.cdl
# Find the proper ref file
diff -b ${builddir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}

testallcases() {
Expand All @@ -54,27 +54,35 @@ case "$zext" in
file)
# need to unpack
rm -fr ref_power_901_constants ref_power_901_constants.file
unzip ${srcdir}/ref_power_901_constants_orig.zip > /dev/null
mv ref_power_901_constants ref_power_901_constants.file
testcasefile ref_power_901_constants zarr metaonly; # test xarray as default
if ! test -f ${builddir}/ref_power_901_constants_orig.zip ; then
cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants_orig.zip
fi
unzip ${builddir}/ref_power_901_constants_orig.zip > /dev/null
mv ${builddir}/ref_power_901_constants ${builddir}/ref_power_901_constants.file
testcasefile power_901_constants zarr metaonly; # test xarray as default
;;
zip)
# Move into position
cp ${srcdir}/ref_power_901_constants_orig.zip ${execdir}/ref_power_901_constants.zip
cp ${srcdir}/ref_quotes_orig.zip ${execdir}/ref_quotes.zip
testcasezip ref_power_901_constants xarray metaonly
if ! test -f ${builddir}/ref_power_901_constants.zip ; then
cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants.zip
fi
if ! test -f ${builddir}/ref_quotes.zip ; then
cp -f ${srcdir}/ref_quotes_orig.zip ${builddir}/ref_quotes.zip
fi
testcasezip power_901_constants xarray metaonly
# Test large constant interoperability
testcasezip ref_quotes zarr metaonly
testcasezip quotes zarr metaonly
;;
s3)
# Read a test case created by netcdf-java zarr.
# Move into position
rm -f ${execdir}/ref_zarr_test_data.cdl
# Use gunzip because it always appears to be available
if ! test -f ${srcdir}/ref_zarr_test_data.cdl ; then
gunzip -c ${srcdir}/ref_zarr_test_data.cdl.gz > ${srcdir}/ref_zarr_test_data.cdl
rm -f ${builddir}/ref_zarr_test_data.cdl
if ! test -f ${builddir}/ref_zarr_test_data.cdl.gz ; then
cp -f ${srcdir}/ref_zarr_test_data.cdl.gz ${builddir}/ref_zarr_test_data.cdl.gz
fi
testcases3 zarr_test_data.zarr ref_zarr_test_data xarray
# Use gunzip because it always appears to be available
gunzip -c ${builddir}/ref_zarr_test_data.cdl.gz > ${builddir}/ref_zarr_test_data.cdl
testcases3 zarr_test_data xarray
;;
*) echo "unimplemented kind: $1" ; exit 1;;
esac
Expand All @@ -83,9 +91,9 @@ esac
testallcases file
if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testallcases zip; fi
if test "x$FEATURE_S3TESTS" = xyes ; then testallcases s3; fi
exit

# Cleanup
rm -fr ${execdir}/ref_power_901_constants.file
rm -f ${execdir}/ref_zarr_test_data.cdl
rm -fr ${builddir}/ref_power_901_constants_orig.zip
rm -fr ${builddir}/ref_zarr_test_data.cdl.gz

exit 0
5 changes: 4 additions & 1 deletion nczarr_test/s3util.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,17 @@ main(int argc, char** argv)

dumpoptions.nctype = NC_UBYTE; /* default */

while ((c = getopt(argc, argv, "df:k:p:t:T:u:v")) != EOF) {
while ((c = getopt(argc, argv, "df:hk:p:t:T:u:v")) != EOF) {
switch(c) {
case 'd':
dumpoptions.debug = 1;
break;
case 'f':
dumpoptions.filename = strdup(optarg);
break;
case 'h':
usage();
return 0;
case 'k': {
size_t len = strlen(optarg);
dumpoptions.key = (char*)malloc(len+1+1);
Expand Down

0 comments on commit 0034e31

Please sign in to comment.