From f282126c1f548eeb32fc2bce68bca6d792fdda99 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 2 Dec 2020 12:53:24 +0000 Subject: [PATCH] ECC-1173: test to ensure new key names are unique --- tests/bufr_wmo_tables.sh | 52 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/tests/bufr_wmo_tables.sh b/tests/bufr_wmo_tables.sh index 3e7915fe9..dd907852c 100755 --- a/tests/bufr_wmo_tables.sh +++ b/tests/bufr_wmo_tables.sh @@ -15,10 +15,12 @@ label="bufr_wmo_tables_test" # Define tmp bufr file fTmp=${label}".tmp.bufr" +fRules=${label}".tmp.filt" +fDump=${label}".tmp.dump" -#============================================== +# -------------------------------- # Testing latest WMO tables -#============================================== +# -------------------------------- bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` REDIRECT=/dev/null @@ -66,5 +68,49 @@ ${tools_dir}/bufr_get -s masterTablesVersionNumber=$latest_wmo_version,unpack=1 -p scanLevelQualityFlags \ $input +# --------------- +# Duplicate keys +# --------------- +# New keys appeared in v35. Ensure we added a digit suffix to make them unique e.g. +# 015063 = attenuatedBackscatter +# 015073 = attenuatedBackscatter1 +cat > $fRules < $fDump +grep -q "attenuatedBackscatter=MISSING" $fDump +grep -q "attenuatedBackscatter1=MISSING" $fDump +grep -q "particleBackscatterCoefficient=MISSING" $fDump +grep -q "particleBackscatterCoefficient1=MISSING" $fDump +grep -q "particleExtinctionCoefficient=MISSING" $fDump +grep -q "particleExtinctionCoefficient1=MISSING" $fDump +grep -q "particleLidarRatio=MISSING" $fDump +grep -q "particleLidarRatio1=MISSING" $fDump +grep -q "uncertaintyInLidarRatio=MISSING" $fDump +grep -q "uncertaintyInLidarRatio1=MISSING" $fDump +grep -q "particleDepolarizationRatio=MISSING" $fDump +grep -q "particleDepolarizationRatio1=MISSING" $fDump +grep -q "scalingVectorMultiplyingTheAPrioriVectorInOrderToDefineTheRetrievedVector=MISSING" $fDump +set +e +# The old name should not be there +grep -q "scalingVectorMultiplyingTheAPrioriCoVectorInOrderToDefineTheRetrievedCoVector" $fDump +status=$? +set -e +[ $status -eq 1 ] -rm -f $fTmp + +rm -f $fTmp $fRules $fDump