Skip to content

Commit

Permalink
ECC-1846: Make keys read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Jun 21, 2024
1 parent 807602d commit 0f3a746
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions definitions/grib2/local/ecmf/section4_extras.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# See ECC-1846
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")) {
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 mars.model = modelName;
}
Expand Down
16 changes: 16 additions & 0 deletions tests/grib_ecc-1846.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,21 @@ grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1"
${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib
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
rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef

0 comments on commit 0f3a746

Please sign in to comment.