2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
2017-03-09 08:01:10 +08:00
|
|
|
|
2017-06-29 03:51:01 +08:00
|
|
|
if test "x$SETX" != x ; then set -x ; fi
|
2015-05-17 05:46:39 +08:00
|
|
|
set -e
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
quiet=0
|
|
|
|
leakcheck=0
|
|
|
|
timing=0
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
# Figure our dst server; if none, then just stop
|
|
|
|
DTS=`${execdir}/findtestserver dap2 dts`
|
2014-10-05 05:59:16 +08:00
|
|
|
if test "x$DTS" = "x" ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
echo "WARNING: Cannot locate test server for dts"
|
2012-06-23 05:54:52 +08:00
|
|
|
exit
|
|
|
|
fi
|
2012-04-23 04:34:21 +08:00
|
|
|
|
2012-01-30 02:56:29 +08:00
|
|
|
PARAMS="[log]"
|
|
|
|
#PARAMS="${PARAMS}[show=fetch]"
|
|
|
|
|
2014-01-23 01:41:59 +08:00
|
|
|
# Determine If we're on OSX or Linux
|
|
|
|
|
|
|
|
myplatform=`uname -a | cut -d" " -f 1`
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
#OCLOGFILE=/dev/null
|
|
|
|
OCLOGFILE="" ; export OCLOGFILE
|
|
|
|
|
|
|
|
# Capture arguments
|
|
|
|
srcdir="$1"
|
|
|
|
builddir="$2"
|
2017-06-29 03:51:01 +08:00
|
|
|
#ignored mode="$3"
|
2010-06-03 21:24:43 +08:00
|
|
|
if test "x$4" = "x" ; then cache=1 ; else cache=0; fi
|
|
|
|
longtests="$5"
|
|
|
|
|
|
|
|
if test "x$timing" = "x1" ; then leakcheck=0; fi
|
|
|
|
|
2011-11-14 12:20:19 +08:00
|
|
|
# get the list of test files
|
2013-04-18 02:58:37 +08:00
|
|
|
# Currently C2 fails because server is not responding
|
2013-11-16 06:41:17 +08:00
|
|
|
#WHICHTESTS="S1 C1 C2 CB"
|
2014-01-20 04:01:50 +08:00
|
|
|
WHICHTESTS="S1 C1 CB"
|
|
|
|
|
2011-11-14 12:20:19 +08:00
|
|
|
if test -n "$longtests"; then
|
2012-08-16 05:13:44 +08:00
|
|
|
WHICHTESTS="${WHICHTESTS} L1 LC1 LC2"
|
2011-11-14 12:20:19 +08:00
|
|
|
fi
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
#locate the testdata and expected directory
|
|
|
|
if test "$cache" = 0 ; then
|
2012-01-30 02:56:29 +08:00
|
|
|
# No cache means no cache, including prefetch
|
|
|
|
CACHE="[noprefetch]"
|
2010-06-03 21:24:43 +08:00
|
|
|
expected3="${srcdir}/nocacheremote3"
|
|
|
|
expected4="${srcdir}/nocacheremote4"
|
|
|
|
else
|
2012-01-30 02:56:29 +08:00
|
|
|
CACHE="[cache][prefetch]"
|
2010-06-03 21:24:43 +08:00
|
|
|
expected3="${srcdir}/expectremote3"
|
|
|
|
expected4="${srcdir}/expectremote4"
|
|
|
|
fi
|
|
|
|
|
2012-01-30 02:56:29 +08:00
|
|
|
PARAMS="${PARAMS}${CACHE}"
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
##################################################
|
|
|
|
# Remote test info
|
|
|
|
##################################################
|
|
|
|
|
|
|
|
# For special testing
|
2012-06-23 05:54:52 +08:00
|
|
|
REMOTEURLX="$DTS"
|
2010-11-14 07:24:28 +08:00
|
|
|
REMOTETESTSX="test.03"
|
|
|
|
|
2012-06-23 05:54:52 +08:00
|
|
|
REMOTEURLXC="$DTS"
|
2010-11-14 07:24:28 +08:00
|
|
|
REMOTETESTSXC="test.03;1;s0,s1"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
# These shorter tests are always run
|
2012-06-23 05:54:52 +08:00
|
|
|
REMOTEURLS1="$DTS"
|
2011-11-14 12:20:19 +08:00
|
|
|
REMOTETESTSS1="\
|
2012-11-22 07:57:42 +08:00
|
|
|
test.01 test.02 test.04 test.05 test.07a test.07 \
|
2011-11-14 12:20:19 +08:00
|
|
|
test.21 \
|
2010-06-03 21:24:43 +08:00
|
|
|
test.50 test.53 test.55 test.56 test.57 \
|
|
|
|
test.66 test.67 test.68 test.69"
|
|
|
|
|
2011-11-14 12:20:19 +08:00
|
|
|
# Server is failing on some tests ; investigate why
|
|
|
|
S1FAIL="test.06a test.22 test.23 test.31"
|
2012-11-22 07:57:42 +08:00
|
|
|
# This fails because of the duplicate name problem and the way thredds dap handles grids"
|
|
|
|
S2FAIL="test.06"
|
2011-11-14 12:20:19 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# These longer tests are optional
|
|
|
|
REMOTEURLL1="$REMOTEURLS1"
|
|
|
|
REMOTETESTSL1="\
|
|
|
|
test.03 \
|
|
|
|
b31 b31a D1 Drifters EOSDB \
|
|
|
|
ingrid nestedDAS NestedSeq NestedSeq2 OverideExample \
|
|
|
|
SimpleDrdsExample test.an1 \
|
|
|
|
test.dfp1 test.gr1 \
|
|
|
|
test.gr2 test.gr3 test.gr4 test.gr5 \
|
|
|
|
test.sds1 test.sds2 test.sds3 \
|
|
|
|
test.sds4 test.sds5 \
|
|
|
|
test.vs1 test.vs2 test.vs3 test.vs4 test.vs5 \
|
|
|
|
whoi"
|
|
|
|
|
|
|
|
# Anything larger than about 100k will not be in the distribution
|
2011-11-14 12:20:19 +08:00
|
|
|
TOOBIGL1="parserBug0001 test.satimage Sat_Images test.32"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
# Following contain %XX escapes which I cannot handle yet
|
|
|
|
ESCAPEDFAIL="test.dfr1 test.dfr2 test.dfr3 test.GridFile test.PointFile test.SwathFile test.sds6 test.sds7"
|
|
|
|
|
|
|
|
# Following tests are to check constraint handling
|
2012-06-23 05:54:52 +08:00
|
|
|
REMOTEURLC1="$DTS"
|
2010-06-03 21:24:43 +08:00
|
|
|
REMOTETESTSC1="\
|
|
|
|
test.01;1;f64 \
|
|
|
|
test.02;1;b[1:2:10] \
|
|
|
|
test.03;1;i32[0:1][1:2][0:2] \
|
|
|
|
test.04;1;types.i32 \
|
|
|
|
test.05;1;types.floats.f32 \
|
|
|
|
test.07;1;person.age \
|
|
|
|
test.07;3;person \
|
2010-11-14 07:24:28 +08:00
|
|
|
test.07;4;types.f32"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2012-11-22 07:57:42 +08:00
|
|
|
# See S2FAIL above
|
|
|
|
SR1FAIL="test.06;1;ThreeD"
|
|
|
|
|
2010-10-15 06:34:52 +08:00
|
|
|
# Following tests are to check selection handling
|
|
|
|
REMOTEURLC2="http://oceanwatch.pfeg.noaa.gov/opendap/GLOBEC"
|
|
|
|
REMOTETESTSC2="\
|
|
|
|
GLOBEC_cetaceans;1;number&number>6 \
|
2010-12-04 06:01:21 +08:00
|
|
|
GLOBEC_cetaceans;2;lat,lon&lat>42.0&lat<=42.5\
|
|
|
|
"
|
|
|
|
|
2012-02-04 05:31:50 +08:00
|
|
|
# C3 is too slow for testing. It has nested sequences.
|
|
|
|
#We need to think about better optimizations
|
2010-12-04 06:01:21 +08:00
|
|
|
REMOTEURLC3="http://dapper.pmel.noaa.gov/dapper/argo"
|
|
|
|
REMOTETESTSC3="\
|
|
|
|
argo_all.cdp;1;&location.LATITUDE<1&location.LATITUDE>-1\
|
2010-10-15 06:34:52 +08:00
|
|
|
"
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# Constrained long tests
|
2012-06-23 05:54:52 +08:00
|
|
|
REMOTEURLLC1="$DTS"
|
2010-06-03 21:24:43 +08:00
|
|
|
REMOTETESTSLC1="\
|
|
|
|
test.03;2;s1"
|
|
|
|
|
2012-08-16 05:13:44 +08:00
|
|
|
REMOTEURLLC2="http://ferret.pmel.noaa.gov/geoide/dodsC/PSDgriddedData/ncep.reanalysis.dailyavgs/surface"
|
|
|
|
REMOTETESTSLC2="slp_aggregated;1;slp.slp[23255:23316][29:29][88:88]"
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# Unknown problem: test.07;2;&age>2
|
|
|
|
IGNORE="test.07.2"
|
|
|
|
|
2013-11-16 06:41:17 +08:00
|
|
|
# Columbia hack test
|
|
|
|
REMOTEURLCB="http://iridl.ldeo.columbia.edu/SOURCES/.Models/.NMME/.NASA-GMAO/.MONTHLY/.sst"
|
|
|
|
REMOTETESTSCB="dods"
|
|
|
|
|
2010-12-04 06:01:21 +08:00
|
|
|
# Known to fail
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
XFAILTESTS3=""
|
2012-06-13 06:04:40 +08:00
|
|
|
# For now, remove some tests from windows platform.
|
2012-07-18 04:13:17 +08:00
|
|
|
if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
|
2012-11-22 07:57:42 +08:00
|
|
|
XFAILTESTS3="$XFAILTESTS3 test.67"
|
2012-06-13 06:04:40 +08:00
|
|
|
fi
|
|
|
|
|
2010-12-04 06:01:21 +08:00
|
|
|
XFAILTESTS4="$XFAILTESTS3"
|
|
|
|
|
|
|
|
# Server is down at the moment
|
|
|
|
SVCFAILTESTS3="GLOBEC_cetaceans.1 GLOBEC_cetaceans.2"
|
|
|
|
SVCFAILTESTS4="$SVCFAILTESTS3"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
# Misc tests not currently used
|
2011-01-21 05:45:29 +08:00
|
|
|
REMOTEURL0="http://test.opendap.org/opendap/netcdf/examples"
|
2010-06-03 21:24:43 +08:00
|
|
|
REMOTETESTS0="\
|
|
|
|
cami_0000-09-01_64x128_L26_c030918.nc \
|
|
|
|
ECMWF_ERA-40_subset.nc \
|
|
|
|
sresa1b_ncar_ccsm3_0_run1_200001.nc \
|
|
|
|
tos_O1_2001-2002.nc
|
|
|
|
123bears.nc \
|
|
|
|
ber-2002-10-01.nc \
|
|
|
|
ceopL2AIRS2-2.nc \
|
|
|
|
ceopL2AIRS2.nc \
|
|
|
|
data.nc \
|
|
|
|
fnoc1.nc \
|
|
|
|
in1.nc \
|
|
|
|
in_2.nc \
|
|
|
|
in.nc \
|
|
|
|
in_no_three_double_dmn.nc \
|
|
|
|
in_v.nc \
|
|
|
|
saco1.nc \
|
|
|
|
testfile.nc \
|
|
|
|
text.nc \
|
|
|
|
"
|
|
|
|
|
2017-06-29 03:51:01 +08:00
|
|
|
TITLE="DAP to netCDF-3 translation"
|
|
|
|
EXPECTED="$expected3"
|
|
|
|
PARAMS="${PARAMS}[netcdf3]"
|
|
|
|
XFAILTESTS="$XFAILTESTS3"
|
|
|
|
SVCFAILTESTS="$SVCFAILTESTS3"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2017-11-26 22:00:17 +08:00
|
|
|
RESULTSDIR="./results_tst_remote"
|
2010-06-03 21:24:43 +08:00
|
|
|
# Locate some tools
|
|
|
|
if test "x$leakcheck" = x1 ; then
|
|
|
|
VALGRIND="valgrind -q --error-exitcode=2 --leak-check=full"
|
|
|
|
fi
|
|
|
|
if test "x$timing" = "x1" ; then TIMECMD="time"; else TIMECMD=""; fi
|
|
|
|
|
|
|
|
rm -fr ${RESULTSDIR}
|
|
|
|
mkdir "${RESULTSDIR}"
|
|
|
|
|
|
|
|
passcount=0
|
|
|
|
xfailcount=0
|
2010-12-04 06:01:21 +08:00
|
|
|
svcfailcount=0
|
2010-06-03 21:24:43 +08:00
|
|
|
failcount=0
|
|
|
|
|
|
|
|
echo "*** Testing $TITLE "
|
|
|
|
echo " Client Parameters: ${PARAMS}"
|
|
|
|
if test "$cache" = 0; then
|
|
|
|
echo " Caching: off"
|
|
|
|
else
|
|
|
|
echo " Caching: on"
|
|
|
|
fi
|
|
|
|
echo " Note: The remote tests may be slow or even fail if the server is overloaded"
|
|
|
|
|
|
|
|
status=0
|
|
|
|
|
|
|
|
for i in $WHICHTESTS ; do
|
|
|
|
constrained=0
|
|
|
|
case "$i" in
|
|
|
|
S1) TESTURL="$REMOTEURLS1" ; TESTSET="$REMOTETESTSS1" ;;
|
|
|
|
S2) TESTURL="$REMOTEURLS2" ; TESTSET="$REMOTETESTSS2" ;;
|
|
|
|
L1) TESTURL="$REMOTEURLL1" ; TESTSET="$REMOTETESTSL1" ;;
|
|
|
|
L2) TESTURL="$REMOTEURLL2" ; TESTSET="$REMOTETESTSL2" ;;
|
2010-10-15 06:34:52 +08:00
|
|
|
C1) TESTURL="$REMOTEURLC1" ; TESTSET="$REMOTETESTSC1" ; constrained=1 ;;
|
|
|
|
C2) TESTURL="$REMOTEURLC2" ; TESTSET="$REMOTETESTSC2" ; constrained=1 ;ncconstrained=0 ;;
|
2010-12-04 06:01:21 +08:00
|
|
|
C3) TESTURL="$REMOTEURLC3" ; TESTSET="$REMOTETESTSC3" ; constrained=1 ;ncconstrained=0 ;;
|
2010-10-15 06:34:52 +08:00
|
|
|
LC1) TESTURL="$REMOTEURLLC1" ; TESTSET="$REMOTETESTSLC1" ; constrained=1 ;;
|
2012-08-16 05:13:44 +08:00
|
|
|
LC2) TESTURL="$REMOTEURLLC2" ; TESTSET="$REMOTETESTSLC2" ; constrained=1 ;;
|
2010-10-15 06:34:52 +08:00
|
|
|
X) TESTURL="$REMOTEURLX" ; TESTSET="$REMOTETESTSX" ; constrained=0 ;;
|
2010-11-14 07:24:28 +08:00
|
|
|
XC) TESTURL="$REMOTEURLXC" ; TESTSET="$REMOTETESTSXC" ; constrained=1 ;;
|
2012-01-30 13:43:29 +08:00
|
|
|
*) echo "Unknown which test: $i" ;;
|
2010-06-03 21:24:43 +08:00
|
|
|
esac
|
|
|
|
|
2015-05-17 05:46:39 +08:00
|
|
|
rm -f ./.dodsrc ./.ocrc ./.daprc
|
2010-06-03 21:24:43 +08:00
|
|
|
cd ${RESULTSDIR}
|
2010-07-20 02:06:09 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
for t in ${TESTSET} ; do
|
2016-04-07 09:51:40 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# see if we are using constraints
|
2014-01-23 00:45:54 +08:00
|
|
|
#index=`expr index "${t}" ";"`
|
2014-01-23 01:41:59 +08:00
|
|
|
|
2014-01-23 00:45:54 +08:00
|
|
|
#echo index: $index
|
2014-01-23 01:41:59 +08:00
|
|
|
if [ "$myplatform" = "Darwin" ]; then
|
2015-05-17 05:46:39 +08:00
|
|
|
index=`echo "${t}" | sed -n "s/;.*//p" | wc -c`
|
2014-01-23 01:41:59 +08:00
|
|
|
if (( $index == 0 )) ; then
|
|
|
|
constrained=0
|
|
|
|
else
|
|
|
|
constrained=1
|
|
|
|
fi
|
2014-01-20 04:01:50 +08:00
|
|
|
else
|
2015-05-17 05:46:39 +08:00
|
|
|
if index=`expr index "${t}" ";"` ; then ignore=1; fi # avoid set -e
|
2014-01-23 01:41:59 +08:00
|
|
|
if test "x$index" = "x0" ; then
|
|
|
|
constrained=0
|
|
|
|
else
|
|
|
|
constrained=1
|
|
|
|
fi
|
2014-01-20 04:01:50 +08:00
|
|
|
fi
|
2014-01-23 01:41:59 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
if test "x$constrained" = "x0" ; then # No constraint
|
|
|
|
testname=$t
|
|
|
|
ce=
|
|
|
|
else # Constrained
|
2014-01-23 00:45:54 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
testname=`echo $t | cut -d ';' -f1`
|
|
|
|
testno=`echo $t | cut -d ';' -f2`
|
|
|
|
ce=`echo $t | cut -d ';' -f3-`
|
|
|
|
fi
|
|
|
|
if test "x$constrained" = "x0" ; then
|
|
|
|
name="${testname}"
|
|
|
|
url="${PARAMS}${TESTURL}/$testname"
|
|
|
|
else
|
|
|
|
name="${testname}.${testno}"
|
2010-10-15 06:34:52 +08:00
|
|
|
url="${PARAMS}${TESTURL}/$testname?${ce}"
|
2010-06-03 21:24:43 +08:00
|
|
|
fi
|
|
|
|
if test "x$quiet" = "x0" ; then echo "*** Testing: ${name}"; fi
|
|
|
|
if test "x$quiet" = "x0" ; then echo "*** URL: ${url}"; fi
|
|
|
|
|
|
|
|
# determine if this is an xfailtest
|
|
|
|
isxfail=0
|
|
|
|
for x in ${XFAILTESTS} ; do
|
|
|
|
if test "x${name}" = "x${x}" ; then isxfail=1; fi
|
|
|
|
done
|
2010-12-04 06:01:21 +08:00
|
|
|
|
|
|
|
# determine if this is a down server test
|
|
|
|
issvcfail=0
|
|
|
|
for x in ${SVCFAILTESTS} ; do
|
|
|
|
if test "x${name}" = "x${x}" ; then issvcfail=1; fi
|
|
|
|
done
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
status=0
|
|
|
|
|
2016-04-07 09:51:40 +08:00
|
|
|
echo "command = ${TIMECMD} ${VALGRIND} ${NCDUMP} ${url} \> ${name}.dmp"
|
2010-06-03 21:24:43 +08:00
|
|
|
if ${TIMECMD} ${VALGRIND} ${NCDUMP} "${url}" > ${name}.dmp ; then status=$status; else status=1; fi
|
|
|
|
# compare with expected
|
|
|
|
if diff -w ${EXPECTED}/${name}.dmp ${name}.dmp
|
|
|
|
then status=$status; else status=1; fi
|
|
|
|
if test "x$status" = "x1" ; then
|
|
|
|
if test "x$isxfail" = "x1" ; then status=2; fi # xfail
|
2010-12-04 06:01:21 +08:00
|
|
|
if test "x$issvcfail" = "x1" ; then status=3; fi # svcfail
|
2010-06-03 21:24:43 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
case "$status" in
|
|
|
|
0)
|
|
|
|
passcount=`expr $passcount + 1`
|
|
|
|
if test "x$quiet" = "x" ; then echo "*** SUCCEED: ${name}"; fi
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
failcount=`expr $failcount + 1`
|
|
|
|
echo "*** FAIL: ${name}"
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
xfailcount=`expr $xfailcount + 1`
|
2012-07-18 04:13:17 +08:00
|
|
|
echo "*** XFAIL : ${name}"
|
2010-06-03 21:24:43 +08:00
|
|
|
;;
|
2010-12-04 06:01:21 +08:00
|
|
|
3)
|
|
|
|
svcfailcount=`expr $svcfailcount + 1`
|
2012-07-18 04:13:17 +08:00
|
|
|
echo "*** SVCFAIL : ${name}"
|
2010-12-04 06:01:21 +08:00
|
|
|
;;
|
2010-06-03 21:24:43 +08:00
|
|
|
esac
|
|
|
|
|
|
|
|
done
|
2010-07-20 02:06:09 +08:00
|
|
|
|
|
|
|
rm -f ./.dodsrc
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
done
|
|
|
|
|
2017-11-26 22:00:17 +08:00
|
|
|
rm -fr ${RESULTSDIR}
|
2010-12-04 06:01:21 +08:00
|
|
|
totalcount=`expr $passcount + $failcount + $xfailcount + $svcfailcount`
|
|
|
|
okcount=`expr $passcount + $xfailcount + $svcfailcount`
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
echo "*** PASSED: ${okcount}/${totalcount} ; ${xfailcount} expected failures ; ${failcount} unexpected failures"
|
2010-12-04 06:01:21 +08:00
|
|
|
if test "$svcfailcount" -gt 0 ; then
|
|
|
|
echo " ${svcfailcount} failures from unavailable server"
|
|
|
|
fi
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
# Ignore failures for now
|
|
|
|
#failcount=0
|
|
|
|
if test "$failcount" -gt 0 ; then
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|