1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.ctest.sh
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-393
# It tests bufr_compare with a blacklist with rank
# ---------------------------------------------------------
cd ${data_dir}/bufr
label="bufr_ecc-393_test"
tempRules=temp.${label}.filter
tempOut=temp.${label}.bufr
tempText=temp.${label}.txt
tempRef=temp.${label}.ref
BufrFile=aaen_55.bufr
cat > $tempRules <<EOF
set unpack=1;
set #3#channelQualityFlagsForAtovs=1;
set #5#channelQualityFlagsForAtovs=2;
set pack=1;
write;
EOF
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile
# There are two differences. So this should fail
set +e
${tools_dir}/bufr_compare $tempOut $BufrFile
status=$?
set -e
[ $status -eq 1 ]
# Blacklist all the channelQualityFlagsForAtovs keys
${tools_dir}/bufr_compare -b channelQualityFlagsForAtovs $tempOut $BufrFile
# Blacklist both the channelQualityFlagsForAtovs keys individually
${tools_dir}/bufr_compare -b '#3#channelQualityFlagsForAtovs,#5#channelQualityFlagsForAtovs' $tempOut $BufrFile
# Blacklist only one of the channelQualityFlagsForAtovs keys. Will fail
set +e
${tools_dir}/bufr_compare -b '#5#channelQualityFlagsForAtovs' $tempOut $BufrFile >$tempText
status=$?
set -e
[ $status -eq 1 ]
cat > $tempRef <<EOF
== 1 == DIFFERENCE == long [#3#channelQualityFlagsForAtovs]: [1] != [0]
EOF
diff $tempRef $tempText
# Clean
rm -rf $tempOut $tempRules $tempRef $tempText
|