2014-12-28 11:42:01 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-11-09 10:02:13 +08:00
|
|
|
#NOP=1
|
2014-12-28 11:42:01 +08:00
|
|
|
#NOS=1
|
|
|
|
#NOB=1
|
|
|
|
|
|
|
|
#SHOW=1
|
|
|
|
#DBG=1
|
|
|
|
#GDB=1
|
|
|
|
|
|
|
|
# if this is part of a distcheck action, then this script
|
|
|
|
# will be executed in a different directory
|
|
|
|
# than the one containing it; so capture the path to this script
|
|
|
|
# as the location of the source directory.
|
|
|
|
|
|
|
|
# capture the build directory
|
|
|
|
# Do a hack to remove e.g. c: for CYGWIN
|
2017-01-19 12:46:47 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
2014-12-28 11:42:01 +08:00
|
|
|
|
|
|
|
OCLOGFILE=stderr
|
|
|
|
if test "x$DBG" = x1 ; then
|
|
|
|
SHOW=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
URL="http://remotetest.unidata.ucar.edu/dts/test.03"
|
|
|
|
|
|
|
|
PREFIX="[log][show=fetch]"
|
|
|
|
SUFFIX="log&show=fetch"
|
|
|
|
BOTHP="[log][show=fetch]"
|
|
|
|
BOTHS="noprefetch&fetch=disk"
|
2017-11-09 10:02:13 +08:00
|
|
|
STRLEN="[maxstrlen=16]"
|
2014-12-28 11:42:01 +08:00
|
|
|
|
2014-12-28 14:41:59 +08:00
|
|
|
locreset () {
|
2017-11-26 22:00:17 +08:00
|
|
|
rm -f ./tmp_testurl ./errtmp_testurl
|
2014-12-28 11:42:01 +08:00
|
|
|
}
|
|
|
|
|
2014-12-28 14:41:59 +08:00
|
|
|
buildurl () {
|
2014-12-28 11:42:01 +08:00
|
|
|
front="$1"
|
|
|
|
back="$2"
|
|
|
|
url="${front}${URL}"
|
|
|
|
if test "x$back" != x ; then
|
|
|
|
url="${url}#${back}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
pass=1
|
|
|
|
|
|
|
|
if test "x$GDB" = x1 ; then
|
|
|
|
NCDUMP="gdb --args $NCDUMP"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Initialize
|
2014-12-28 14:41:59 +08:00
|
|
|
locreset
|
2014-12-28 11:42:01 +08:00
|
|
|
|
|
|
|
if test "x$NOP" != x1 ; then
|
|
|
|
echo "***Testing url prefix parameters"
|
|
|
|
buildurl $PREFIX ""
|
|
|
|
# Invoke ncdump to extract the URL
|
2018-04-24 03:38:18 +08:00
|
|
|
|
2014-12-28 11:42:01 +08:00
|
|
|
echo "command: ${NCDUMP} -h $url"
|
2018-03-08 03:50:03 +08:00
|
|
|
|
2017-11-26 22:00:17 +08:00
|
|
|
${NCDUMP} -h "$url" >./tmp_testurl 2> ./errtmp_testurl
|
2014-12-28 11:42:01 +08:00
|
|
|
if test "x${SHOW}" = x1 ; then cat ./tmp ; fi
|
2017-11-09 10:02:13 +08:00
|
|
|
|
|
|
|
# Test that maxstrlen works as alias for stringlength
|
|
|
|
echo "***Testing maxstrlen=stringlength alias"
|
|
|
|
buildurl $STRLEN ""
|
|
|
|
# Invoke ncdump to extract the URL
|
|
|
|
echo "command: ${NCDUMP} -h $url"
|
2018-03-08 03:50:03 +08:00
|
|
|
${NCDUMP} "$url" >./tmp_testurl 2> ./errtmp_testurl
|
2017-11-26 22:00:17 +08:00
|
|
|
if test "x${SHOW}" = x1 ; then cat ./tmp_testurl ; fi
|
2017-11-09 10:02:13 +08:00
|
|
|
# Look for the value of maxStrlen in output cdl
|
2018-03-08 03:50:03 +08:00
|
|
|
if ! fgrep -i "maxstrlen = 16" ./tmp_testurl ; then
|
2017-11-09 10:02:13 +08:00
|
|
|
echo "***Fail: maxStrlen not recognized"
|
2018-03-08 03:50:03 +08:00
|
|
|
fgrep -i "maxstrlen16 = 16" ./tmp_testurl > ./errtmp_testurl
|
2017-11-09 10:02:13 +08:00
|
|
|
fi
|
|
|
|
|
2018-05-19 10:28:51 +08:00
|
|
|
fi
|
2014-12-28 11:42:01 +08:00
|
|
|
|
2014-12-28 14:41:59 +08:00
|
|
|
locreset
|
2014-12-28 11:42:01 +08:00
|
|
|
if test "x$NOS" != x1 ; then
|
|
|
|
echo "***Testing url suffix parameters"
|
|
|
|
buildurl "" $SUFFIX
|
|
|
|
# Invoke ncdump to extract the URL
|
2017-11-26 22:00:17 +08:00
|
|
|
${NCDUMP} -h "$url" >./tmp_testurl 2> ./errtmp_testurl
|
|
|
|
if test "x${SHOW}" = x1 ; then cat ./tmp_testurl ; fi
|
2014-12-28 11:42:01 +08:00
|
|
|
fi
|
|
|
|
|
2014-12-28 14:41:59 +08:00
|
|
|
locreset
|
2018-05-19 10:28:51 +08:00
|
|
|
|
2014-12-28 11:42:01 +08:00
|
|
|
if test "x$NOB" != x1 ; then
|
|
|
|
echo "***Testing url prefix+suffix parameters"
|
|
|
|
buildurl $BOTHP $BOTHS
|
|
|
|
# Invoke ncdump to extract the URL
|
2017-11-26 22:00:17 +08:00
|
|
|
${NCDUMP} -h "$url" >./tmp_testurl 2> ./errtmp_testurl
|
|
|
|
if test "x${SHOW}" = x1 ; then cat ./tmp_testurl ; fi
|
2014-12-28 11:42:01 +08:00
|
|
|
fi
|
|
|
|
|
2014-12-28 14:41:59 +08:00
|
|
|
locreset
|
2014-12-28 11:42:01 +08:00
|
|
|
|
|
|
|
if test "x$pass" = x0 ; then
|
|
|
|
echo "***FAIL"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "***PASS"
|
|
|
|
exit 0
|