ECC-1846: Make keys read-only

This commit is contained in:
shahramn 2024-06-21 13:51:03 +01:00
parent 807602d7d6
commit 0f3a74620a
2 changed files with 18 additions and 2 deletions

View File

@ -2,10 +2,10 @@
# See ECC-1846 # See ECC-1846
if (centre is "ecmf" or datasetForLocal is "era6") { if (centre is "ecmf" or datasetForLocal is "era6") {
concept_nofail modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; concept_nofail modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only;
if (!(modelName is "unknown")) { if (!(modelName is "unknown")) {
concept_nofail modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump; concept_nofail modelVersion(unknown, "modelVersionConcept_[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only;
# alias ls.model = modelName; # alias ls.model = modelName;
# alias mars.model = modelName; # alias mars.model = modelName;
} }

View File

@ -28,5 +28,21 @@ grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1"
${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib ${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown" grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown"
# Keys are read-only (may change this later)
set +e
${tools_dir}/grib_set -s modelName=AIFS $sample $tempGrib 2>$tempLog
status=$?
set -e
[ $status -ne 0 ]
grep -q "Value is read only" $tempLog
set +e
${tools_dir}/grib_set -s modelVersion=cy48r1 $sample $tempGrib 2>$tempLog
status=$?
set -e
[ $status -ne 0 ]
grep -q "Value is read only" $tempLog
# Clean up # Clean up
rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef