From 45e9c8a38ac10b89cf004e689cbe5d8ba107e638 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 14 Oct 2024 17:05:47 +0100 Subject: [PATCH] Testing: GRIB2 product def templates --- tests/grib2_templates.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/grib2_templates.sh b/tests/grib2_templates.sh index bb295b73a..800a5aca9 100755 --- a/tests/grib2_templates.sh +++ b/tests/grib2_templates.sh @@ -8,7 +8,6 @@ # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # . ./include.ctest.sh -set -u label="grib2_templates_test" @@ -32,6 +31,25 @@ awk '$1 !~ /#/ && $1 < 65000 {print $1}' $latest_codetable_file | while read pdt fi done +rm -f $tempText +pdtns=$( awk '!/^#/ && $1 < 65000 {print $1}' $latest_codetable_file ) +for p in $pdtns; do + $tools_dir/grib_set -s tablesVersion=$latestOfficial,productDefinitionTemplateNumber=$p $sample2 $temp + $tools_dir/grib_dump -O -p section_4 $temp >> $tempText + # Expect the grep to fail and not find 'unknown' in the dump output + set +e + grep -q -i unknown $tempText + status=$? + set -e + if [ $status -ne 1 ]; then + echo "GRIB2 PDTN $p produced a dump with unknown!" + grep -i unknown $tempText + exit 1 + fi +done +rm -f $tempText + + # ECC-1746 # ------------- $tools_dir/grib_set -s tablesVersion=31,productDefinitionTemplateNumber=34 $sample2 $temp