-
Notifications
You must be signed in to change notification settings - Fork 0
/
unittest
executable file
·2105 lines (1701 loc) · 95.1 KB
/
unittest
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
## Ce script a pour but d'implementer des tests unitaires pour 'splitobs'
## Pour les executer, il suffit de faire la commande
## ./unittest
## On peut choisir le programme de test avec la commande
## export SPLITOBS="Chemin vers un programme splitobs"
set -e
## cd /users/dor/arma/erv/data/ords/programs/bgck.clipobs
if [ $# -eq 1 ]; then
TESTS2RUN=$1
elif [ $# -eq 0 ]; then
TESTS2RUN=all
else
TESTS2RUN=error
fi
if [ "${TESTS2RUN}" != burp -a "${TESTS2RUN}" != rdb -a "${TESTS2RUN}" != all ]; then
echo "L'argument au script $0 ne peut etre que 'burp', 'rdb' ou 'all'"
exit 1
fi
VERSION=${VERSION:-$(git describe --dirty)}
SPLITOBS=${SPLITOBS:-${PWD}/splitobs_${ORDENV_PLAT}}
INPUTS=${INPUTS:-/home/sanl000/data/ppp5/UnitTests/midas/splitobs/v001/inputs}
REFERENCE=${REFERENCE:-/home/sanl000/data/ppp5/UnitTests/midas/splitobs/v001/results}
GRIDS=${GRIDS:-/home/sanl000/data/ppp5/UnitTests/midas/splitobs/grids}
CMDA_UTILS_SSM_DOMAIN=eccc/cmd/cmda/utils/20230531
RPN_UTILS_SSM_DOMAIN=eccc/mrd/rpn/utils/20230531
RPN_LIBS_SSM_DOMAIN=eccc/mrd/rpn/libs/20230531
PY39_SSM_DOMAIN=eccc/cmd/cmds/env/python/py39_2022.05.24_rhel-8-icelake-64
DIFF_METHOD_FOR_BURP_FILES=${DIFF_METHOD_FOR_BURP_FILES:-liburp}
DIFF_METHOD_FOR_SQL_FILES=${DIFF_METHOD_FOR_SQL_FILES:-SQL}
check_subdomains_tool=${PWD}/check_latlon_in_subdomain.py
WORKDIR=${WORKDIR:-${PWD}/work}
export AFSISIO=${AFSISIO:-/home/smco502}
export CMCCONST=${CMCCONST:-/home/smco502/datafiles/constants}
echo "Using SPLITOBS=${SPLITOBS}"
#SPLITOBS="time ${SPLITOBS}"
[ -d "${WORKDIR}" ] && rm -rf ${WORKDIR}
mkdir -p ${WORKDIR}
cd ${WORKDIR}
echo "Working directory is ${WORKDIR}"
liburp=${liburp:-$(which liburp 2>/dev/null || (. ssmuse-sh -d ${CMDA_UTILS_SSM_DOMAIN} 1>/dev/null && which liburp))}
editbrp=${editbrp:-$(which editbrp 2>/dev/null || (. ssmuse-sh -d ${RPN_UTILS_SSM_DOMAIN} 1>/dev/null && which editbrp))}
reflex=${reflex:-$(which reflex 2>/dev/null || (. ssmuse-sh -d ${RPN_UTILS_SSM_DOMAIN} 1>/dev/null && which reflex))}
burpdiff=${burpdiff:-$(which burpdiff 2>/dev/null || (. ssmuse-sh -d ${CMDA_UTILS_SSM_DOMAIN} 1>/dev/null && which burpdiff))}
burp2rdb=${burp2rdb:-$(which burp2rdb 2>/dev/null || (. ssmuse-sh -d ${CMDA_UTILS_SSM_DOMAIN} 1>/dev/null && which burp2rdb))}
rdbgen=${rdbgen:-$(which rdbgen 2>/dev/null || (. ssmuse-sh -d ${CMDA_UTILS_SSM_DOMAIN} 1>/dev/null && which rdbgen))}
sqlite3=${sqlite3:-$(. ssmuse-sh -p ${PY39_SSM_DOMAIN} 1>/dev/null && which sqlite3)}
fstcomp=${fstcomp:-$(which fstcomp 2>/dev/null || (. ssmuse-sh -d ${RPN_UTILS_SSM_DOMAIN} 1>/dev/null && which fstcomp))}
editbrp=${editbrp:-$(which editbrp 2>/dev/null || (. ssmuse-sh -d ${RPN_UTILS_SSM_DOMAIN} 1>/dev/null && which editbrp))}
unittest () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "unittest() begins"
if [ "${TESTS2RUN}" = burp -o "${TESTS2RUN}" = all ]; then
test_burp_maximum_unit_number || return 1
test_burp_regional_standard || return 1
test_burp_regional_with_imax_imin_jmax_jmin || return 1
test_robustness_for_mrbcvt || return 1
## The clipping should not change the result since we are using a global grid as clipping domain
test_burp_identity || return 1
test_burp_subdomains || return 1
test_burp_latbands || return 1
test_burp_round_robin || return 1
test_burp_cherrypick_roundrobin || return 1
test_burp_cherrypick_subdomains || return 1
fi
if [ "${TESTS2RUN}" = rdb -o "${TESTS2RUN}" = all ]; then
test_rdb_obsdb || return 1
test_rdb_avhrr || return 1
test_rdb_resume_schema_SAR || return 1
test_rdb_resume_schema_AL || return 1
test_rdb_index || return 1
test_rdb_resume || return 1
test_rdb_round_robin || return 1
test_rdb_cherrypick_roundrobin || return 1
test_rdb_regional_standard || return 1
test_rdb_regional_global_with_imax_imin_jmax_jmin || return 1
## The clipping should not change the result since we are using a global grid as clipping domain
test_rdb_identity || return 1
fi
test_check_result || return 1
test_find_family || return 1
echo "unittest() ends"
return 0
test_ascii_regional_standard || return 1
test_ascii_regional_global_with_imax_imin_jmax_jmin || return 1
test_burp_vertical_clipping || return 1
test_rdb_vertical_clipping || return 1
test_ascii_vertical_clipping || return 1
test_burp_horizontal_vertical || return 1
test_rdb_horizontal_vertical || return 1
test_ascii_horizontal_vertical || return 1
echo "unittest() ends"
} ## End of function 'unittest'
assert() {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
thisunittest=$1
shift
if "$@"; then
## echo "assert(): assertion passed for test ${thisunittest}"
printf "\033[0m\033[01;32massert(): assertion passed for test ${thisunittest}\n\033[0m"
else
errstr="assert(): assertion failed for test ${thisunittest}: $@"
printf "\033[0m\033[01;31m${errstr}\n\033[0m" >&2
return 1
## die "assert(): assertion failed for test ${thisunittest}: " "$@"
fi
## debug "assert(): finished with test ${thisunittest}"
} ## End of function 'assert'
## Utilitaires pour imprimer des messages
say() {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
__say_status=${2:-0}
echo "$1"
return ${__say_status}
}
paddedPrint() {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
if [ $# -ne 2 ]; then
echo "paddedPrint: This function accepts only and only 2 arguments" >&2
echo " '${*}' was given" >&2
return 1
fi
__paddedPrint_numberOfDigits__=${1}
__paddedPrint_number__=${2}
__paddedPrint_format__=$(printf "%%0%dd" ${__paddedPrint_numberOfDigits__})
printf "${__paddedPrint_format__}" ${__paddedPrint_number__}
unset __paddedPrint_numberOfDigits___ __paddedPrint_number__ __paddedPrint_format__
} ## End of function 'paddedPrint'
test_run () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
# test 1
status=0
run 1 2 3 4 5 2> /dev/null || status=1 ## On teste le nombre d'arguments
assert "run test1" [ "${status}" -eq 1 ]
# test 2
status=0
run 1 2 3 4 5 6 7 2> /dev/null || status=1 ## On teste le nombre d'arguments
assert "run test2" [ "${status}" -eq 1 ]
# test3
if [ -n "${CACHEDIR}" ]; then
OLD_CACHEDIR=${CACHEDIR}
unset CACHEDIR
fi
status=0
run 1 2 3 4 5 6 2> /dev/null || status=1 ## On teste si la variable CACHEDIR n'est pas settee
assert "run test3" [ "${status}" -eq 1 ]
if [ -n "${OLD_CACHEDIR}" ]; then
CACHEDIR=${OLD_CACHEDIR}
unset OLD_CACHEDIR
fi
[ "${status}" -ne 0 ] && return 1
echo "test_run() ended"
} ## End of function 'test_run'
test_check_result () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_check_result() begins"
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua diff 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP diff (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua cmp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP cmp (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua liburp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP liburp (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua liburp-noresume 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP liburp-noresume (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua burp-SQL 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP burp-SQL (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua SQL 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP SQL (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_ua SQL-ignore_id_obs 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP SQL-ignore_id_obs (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_pr diff 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP diff (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_pr cmp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP cmp (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_pr liburp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP liburp (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_pr liburp-noresume 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP liburp-noresume (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/burp/2011070112_ua ${REFERENCE}/burp/2011070112_pr burp-SQL 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP burp-SQL (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/rdb/2011070112_ua ${REFERENCE}/rdb/2011070112_pr SQL 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP SQL (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${REFERENCE}/rdb/2011070112_ua ${REFERENCE}/rdb/2011070112_pr SQL-ignore_id_obs 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result BURP SQL-ignore_id_obs (status=${status})" [ "${status}" -eq 1 ] || return 1
status=0
check_result ${GRIDS}/reggrid ${GRIDS}/reggrid fstcomp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result fstcomp (status=${status})" [ "${status}" -eq 0 ] || return 1
status=0
check_result ${GRIDS}/reggrid ${GRIDS}/glbgrid fstcomp 1>> check_result.listing 2>&1 || status=$?
assert "test_check_result fstcomp (status=${status})" [ "${status}" -eq 1 ] || return 1
echo "test_check_result() ends"
} ## End of function 'test_check_result'
test_burp_regional_standard () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_burp_regional_standard() begins"
for fam in ua4d ua ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do ## ua4d.resume
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam} -burpout 2011070112_${fam} -fstin ${GRIDS}/reggrid -nomvar P0 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_regional_standard fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam} 2011070112_${fam} ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_regional_standard fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}
done
echo "test_burp_regional_standard() ends"
} ## End of function 'test_burp_regional_standard'
test_burp_regional_with_imax_imin_jmax_jmin () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_burp_regional_with_imax_imin_jmax_jmin() begins"
## La grille 'regglbgrid' est la meme que 'reggrid' mais avec une extension de 2 points de grille pour chaque direction.
for fam in ua ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam} -burpout 2011070112_${fam} -fstin ${GRIDS}/regglbgrid -nomvar ME -min_i 12 -max_i 991 -min_j 8 -max_j 1019 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_regional_global_with_imax_imin_jmax_jmin fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam} 2011070112_${fam} ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_regional_global_with_imax_imin_jmax_jmin fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}
done
echo "test_burp_regional_with_imax_imin_jmax_jmin() ends"
} ## End of function 'test_burp_regional_with_imax_imin_jmax_jmin'
test_burp_identity () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_burp_identity() begins"
for fam in ua4d ua ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam} -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -min_i 1 -max_i =1025 -min_j =0 -max_j 800 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_identity fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
if [ "${fam}" = ua4d ]; then
check_result ${REFERENCE}/burp/2011070112_${fam}.identity 2011070112_${fam} ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
else
check_result ${INPUTS}/burp/2011070112_${fam} 2011070112_${fam} ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
fi
assert "test_burp_identity fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam} 2011070112_${fam}.num_headers
done
echo "test_burp_identity() ends"
} ## End of function 'test_burp_identity'
test_rdb_identity () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_identity() begins"
for fam in ai ua sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do
status=0
program_status=0
${SPLITOBS} -rdbin ${INPUTS}/rdb/2011070112_${fam} -rdbout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -min_i 1 -max_i =1025 -min_j =0 -max_j 800 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_identity fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${INPUTS}/rdb/2011070112_${fam} 2011070112_${fam} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_identity fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}
done
echo "test_rdb_identity() ends"
} ## End of function 'test_rdb_identity'
test_robustness_for_mrbcvt () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_robustness_for_mrbcvt() begins"
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/mrbcvt_problem/banco.bgckalt.2011073100_ai.UJIHOCRA -burpout 2011073100_ai -fstin ${GRIDS}/glbgrid -nomvar P0 1>> check_result.listing 2>&1 || program_status=$?
assert "test_robustness_for_mrbcvt program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${INPUTS}/mrbcvt_problem/banco.bgckalt.2011073100_ai.UJIHOCRA 2011073100_ai ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_robustness_for_mrbcvt check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011073100_ai
echo "test_robustness_for_mrbcvt() ends"
} ## End of function 'test_robustness_for_mrbcvt'
test_rdb_regional_standard () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_regional_standard() begins"
for fam in ua ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do
rm -f 2011070112_${fam}
typ=$(find_family ${fam} || return 1)
echo "Running ${rdbgen} -f 2011070112_${fam} -type ${typ}" 1>> check_result.listing 2>&1
${rdbgen} -f 2011070112_${fam} -type ${typ} 1>> check_result.listing 2>&1 || return 1
## add some column to database because some have been added since the reference has been created
sqlite_add_column ${fam} ${INPUTS}/rdb/2011070112_${fam} 2011070112_${fam}_input
status=0
program_status=0
${SPLITOBS} -rdbin 2011070112_${fam}_input -rdbout 2011070112_${fam} -fstin ${GRIDS}/reggrid -nomvar P0 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_regional_standard fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
## add some column to UA database because some have been added since the reference has been created
sqlite_add_column ${fam} ${REFERENCE}/rdb/2011070112_${fam} 2011070112_${fam}_output
check_status=0
check_result 2011070112_${fam}_output 2011070112_${fam} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_regional_standard fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam} 2011070112_${fam}_input 2011070112_${fam}_output
done
echo "test_rdb_regional_standard() ends"
} ## End of function 'test_rdb_regional_standard'
test_rdb_regional_global_with_imax_imin_jmax_jmin () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_regional_global_with_imax_imin_jmax_jmin() begins"
for fam in ua ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi; do
rm -f 2011070112_${fam}
typ=$(find_family ${fam} || return 1)
echo "Running ${rdbgen} -f 2011070112_${fam} -type ${typ}" 1>> check_result.listing 2>&1
${rdbgen} -f 2011070112_${fam} -type ${typ} 1>> check_result.listing 2>&1 || return 1
## add some column to UA database because some have been added since the reference has been created
sqlite_add_column ${fam} ${INPUTS}/rdb/2011070112_${fam} 2011070112_${fam}_input
status=0
program_status=0
${SPLITOBS} -rdbin 2011070112_${fam}_input -rdbout 2011070112_${fam} -fstin ${GRIDS}/regglbgrid -fstin ${GRIDS}/regglbgrid -nomvar ME -min_i 12 -max_i 991 -min_j 8 -max_j 1019 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_regional_global_with_imax_imin_jmax_jmin fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
## add some column to UA database because some have been added since the reference has been created
sqlite_add_column ${fam} ${REFERENCE}/rdb/2011070112_${fam} 2011070112_${fam}_output
check_status=0
check_result 2011070112_${fam}_output 2011070112_${fam} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_regional_global_with_imax_imin_jmax_jmin fam=${fam} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam} 2011070112_${fam}_input 2011070112_${fam}_output
done
echo "test_rdb_regional_global_with_imax_imin_jmax_jmin() ends"
} ## End of function 'test_rdb_regional_global_with_imax_imin_jmax_jmin'
test_rdb_round_robin () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_round_robin() begins"
test_rdb_round_robin_ndigits=4
test_rdb_round_robin_npex=3
test_rdb_round_robin_npey=4
for fam in ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi ua; do
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_round_robin_npex} -npey ${test_rdb_round_robin_npey} -ndigits ${test_rdb_round_robin_ndigits} -obsin ${INPUTS}/rdb/2011070112_${fam} -obsout 2011070112_${fam} 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_round_robin fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
rdbsplit ${INPUTS}/rdb/2011070112_${fam} 2011070112_${fam}_output ${test_rdb_round_robin_npex} ${test_rdb_round_robin_npey} ${test_rdb_round_robin_ndigits} 1>> check_result.listing 2>&1
procx=1
while [ "${procx}" -le "${test_rdb_round_robin_npex}" ]; do
procy=1
while [ "${procy}" -le "${test_rdb_round_robin_npey}" ]; do
procx_str=$(paddedPrint ${test_rdb_round_robin_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_round_robin_ndigits} ${procy})
check_status=0
check_result 2011070112_${fam}_output_${procx_str}_${procy_str} 2011070112_${fam}_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_round_robin fam=${fam} procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_*
done
unset test_rdb_round_robin_npex test_rdb_round_robin_npey test_rdb_round_robin_ndigits test_rdb_round_robin_number_of_process
echo "test_rdb_round_robin() ends"
} ## End of function 'test_rdb_round_robin'
test_rdb_cherrypick_roundrobin () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_cherrypick_roundrobin() begins"
test_rdb_cherrypick_roundrobin_ndigits=4
test_rdb_cherrypick_roundrobin_npex=3
test_rdb_cherrypick_roundrobin_npey=4
for fam in ai sw sf pr sc ro to_amsua to_amsub csr ssmis airs iasi ua; do
filein=2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_cherrypick_roundrobin_npex} -npey ${test_rdb_cherrypick_roundrobin_npey} \
-ndigits ${test_rdb_cherrypick_roundrobin_ndigits} -obsin ${INPUTS}/rdb/${filein} \
-obsout ${filein} 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_cherrypick_roundrobin fam=${fam} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
procx=1
while [ "${procx}" -le "${test_rdb_cherrypick_roundrobin_npex}" ]; do
procy=1
while [ "${procy}" -le "${test_rdb_cherrypick_roundrobin_npey}" ]; do
${SPLITOBS} -round-robin -npex ${test_rdb_cherrypick_roundrobin_npex} -npey ${test_rdb_cherrypick_roundrobin_npey} \
-ndigits ${test_rdb_cherrypick_roundrobin_ndigits} -obsin ${INPUTS}/rdb/${filein} \
-obsout ${filein}_cherrypick -x ${procx} -y ${procy} 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_cherrypick_roundrobin fam=${fam} procx=${procx} procy=${procy} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
nfiles=$(ls -1 ${filein}_cherrypick* | wc -l)
assert "test_rdb_cherrypick_roundrobin fam=${fam} procx=${procx} procy=${procy} nfiles=${nfiles}" [ "${nfiles}" -eq 1 ] || status=$?
procx_str=$(paddedPrint ${test_rdb_cherrypick_roundrobin_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_cherrypick_roundrobin_ndigits} ${procy})
check_status=0
check_result ${filein}_${procx_str}_${procy_str} ${filein}_cherrypick_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_cherrypick_roundrobin fam=${fam} procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
rm ${filein}_cherrypick_${procx_str}_${procy_str}
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_*
done
unset test_rdb_cherrypick_roundrobin_npex test_rdb_cherrypick_roundrobin_npey test_rdb_cherrypick_roundrobin_ndigits procx procy
echo "test_rdb_cherrypick_roundrobin() ends"
} ## End of function 'test_rdb_cherrypick_roundrobin'
test_rdb_index () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_index() begins"
test_rdb_index_ndigits=4
test_rdb_index_npex=1
test_rdb_index_npey=22
procx=${test_rdb_index_npex}
procy=${test_rdb_index_npey}
status=0
program_status=0
${SPLITOBS} -round-robin -x ${procx} -y ${procy} -npex ${test_rdb_index_npex} -npey ${test_rdb_index_npey} -ndigits ${test_rdb_index_ndigits} -obsin ${INPUTS}/rdb/obsal -obsout obsal 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_index splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
procx_str=$(paddedPrint ${test_rdb_index_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_index_ndigits} ${procy})
fileout=obsal_${procx_str}_${procy_str}
check_status=0
check_result ${REFERENCE}/rdb/obsal_${procx_str}_${procy_str}_v2 ${fileout} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_dropindex fileout=${fileout} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm ${fileout}
unset fileout test_rdb_index_ndigits test_rdb_index_npex test_rdb_index_npey procx procy
echo "test_rdb_index() ends"
} ## End of function 'test_rdb_index'
test_rdb_resume () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_resume() begins"
test_rdb_resume_ndigits=4
test_rdb_resume_npex=3
test_rdb_resume_npey=4
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_resume_npex} -npey ${test_rdb_resume_npey} -ndigits ${test_rdb_resume_ndigits} -obsin ${INPUTS}/rdb/airs-resume.rdb -obsout airs 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
rdbsplit_resume ${INPUTS}/rdb/airs-resume.rdb airs_reference ${test_rdb_resume_npex} ${test_rdb_resume_npey} ${test_rdb_resume_ndigits} 1>> check_result.listing 2>&1
procx=1
while [ "${procx}" -le "${test_rdb_resume_npex}" ]; do
procy=1
while [ "${procy}" -le "${test_rdb_resume_npey}" ]; do
procx_str=$(paddedPrint ${test_rdb_resume_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_resume_ndigits} ${procy})
check_status=0
check_result airs_reference_${procx_str}_${procy_str} airs_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_resume splitting procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm airs_*
unset test_rdb_resume_npex test_rdb_resume_npey test_rdb_resume_ndigits test_rdb_resume_number_of_process
status=0
program_status=0
${SPLITOBS} -rdbin ${INPUTS}/rdb/airs-resume.rdb -rdbout airs_clipped -fstin ${GRIDS}/glbgrid -nomvar P0 -min_i 1 -max_i =1025 -min_j =0 -max_j 800 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume clipping program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${INPUTS}/rdb/airs-resume.rdb airs_clipped ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_resume clipping check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm airs_clipped
echo "test_rdb_resume() ends"
} ## End of function 'test_rdb_resume'
test_rdb_resume_schema_SAR () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_resume_schema_SAR() begins"
test_rdb_resume_ndigits=4
test_rdb_resume_npex=3
test_rdb_resume_npey=4
procx=$(paddedPrint ${test_rdb_resume_ndigits} ${test_rdb_resume_npex})
procy=$(paddedPrint ${test_rdb_resume_ndigits} ${test_rdb_resume_npey})
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_resume_npex} -npey ${test_rdb_resume_npey} -x ${test_rdb_resume_npex} -y ${test_rdb_resume_npey} -ndigits ${test_rdb_resume_ndigits} -obsin ${INPUTS}/rdb/sarwinds.db -obsout sarwinds 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume_schema_SAR splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
assert "test_rdb_resume_schema_SAR splitting procx=${procx} procy=${procy} 'select date' (status=${check_status})" \
[ "$(echo 'select date from resume;' | sqlite3 sarwinds_${procx}_${procy})" = 2016080100 ] || status=1
assert "test_rdb_resume_schema_SAR splitting procx=${procx} procy=${procy} 'rdb4_schema table definition' (status=${check_status})" \
[ -n "$(echo '.schema' | sqlite3 sarwinds_${procx}_${procy} | grep -i 'CREATE TABLE rdb4_schema( schema varchar(9) );')" ] || status=1
assert "test_rdb_resume_schema_SAR splitting procx=${procx} procy=${procy} 'select * in rdb4_schema' (status=${check_status})" \
[ "$(echo 'select * from rdb4_schema;' | sqlite3 sarwinds_${procx}_${procy})" = sf ] || status=1
assert "test_rdb_resume_schema_SAR splitting procx=${procx} procy=${procy} 'select time' (status=${check_status})" \
[ "$(echo 'select time from resume;' | sqlite3 sarwinds_${procx}_${procy})" = 0 ] || status=1
assert "test_rdb_resume_schema_SAR splitting procx=${procx} procy=${procy} 'resume table definition' (status=${check_status})" \
[ -n "$(echo '.schema' | sqlite3 sarwinds_${procx}_${procy} | grep -i 'CREATE TABLE resume(date integer , time integer , run varchar(9));')" ] || status=1
[ "${status}" -ne 0 ] && return 1
rm sarwinds_${procx}_${procy}
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_resume_npex} -npey ${test_rdb_resume_npey} -ndigits ${test_rdb_resume_ndigits} -obsin ${INPUTS}/rdb/sarwinds.db -obsout sarwinds 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume_schema_AL splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
procx=1
while [ "${procx}" -le "${test_rdb_resume_npex}" ]; do
procy=1
while [ "${procy}" -le "${test_rdb_resume_npey}" ]; do
procx_str=$(paddedPrint ${test_rdb_resume_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_resume_ndigits} ${procy})
check_status=0
check_result ${REFERENCE}/rdb/sarwinds/sarwinds_${procx_str}_${procy_str} sarwinds_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_resume_schema_SAR splitting procx=${procx_str} procy=${procy_str} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm sarwinds_*_*
echo "test_rdb_resume_schema_SAR() ends"
} ## End of function 'test_rdb_resume_schema_SAR'
test_rdb_resume_schema_AL () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_resume_schema_AL() begins"
test_rdb_resume_ndigits=4
test_rdb_resume_npex=3
test_rdb_resume_npey=4
procx=$(paddedPrint ${test_rdb_resume_ndigits} ${test_rdb_resume_npex})
procy=$(paddedPrint ${test_rdb_resume_ndigits} ${test_rdb_resume_npey})
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_resume_npex} -npey ${test_rdb_resume_npey} -x ${test_rdb_resume_npex} -y ${test_rdb_resume_npey} -ndigits ${test_rdb_resume_ndigits} -obsin ${INPUTS}/rdb/obsal_derialt -obsout obsal_derialt 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume_schema_AL splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
assert "test_rdb_resume_schema_AL splitting procx=${procx} procy=${procy} 'select date' (status=${check_status})" \
[ "$(echo 'select date from resume;' | sqlite3 obsal_derialt_${procx}_${procy})" = 20151001 ] || status=1
assert "test_rdb_resume splitting procx=${procx} procy=${procy} 'rdb4_schema table definition' (status=${check_status})" \
[ -n "$(echo '.schema' | sqlite3 obsal_derialt_${procx}_${procy} | grep 'CREATE TABLE rdb4_schema( schema varchar(9) );')" ] || status=1
assert "test_rdb_resume_schema_AL splitting procx=${procx} procy=${procy} 'select time' (status=${check_status})" \
[ "$(echo 'select time from resume;' | sqlite3 obsal_derialt_${procx}_${procy})" = 21000000 ] || status=1
assert "test_rdb_resume_schema_AL splitting procx=${procx} procy=${procy} 'resume table definition' (status=${check_status})" \
[ -n "$(echo '.schema' | sqlite3 obsal_derialt_${procx}_${procy} | grep 'CREATE TABLE resume(date integer , time integer , run varchar(9));')" ] || status=1
[ "${status}" -ne 0 ] && return 1
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_resume_npex} -npey ${test_rdb_resume_npey} -x ${test_rdb_resume_npex} -y ${test_rdb_resume_npey} -ndigits ${test_rdb_resume_ndigits} -obsin ${INPUTS}/rdb/obsal_bgckalt -obsout obsal_bgckalt 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_resume_schema_AL splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/rdb/obsal_bgckalt_${procx}_${procy}_v2 obsal_bgckalt_${procx}_${procy} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_resume_schema_AL splitting procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm obsal_derialt_${procx}_${procy} obsal_bgckalt_${procx}_${procy}
echo "test_rdb_resume_schema_AL() ends"
} ## End of function 'test_rdb_resume_schema_AL'
test_rdb_obsdb () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_obsdb() begins"
test_rdb_obsdb_ndigits=4
test_rdb_obsdb_npex=1
test_rdb_obsdb_npey=3
procx=$(paddedPrint ${test_rdb_obsdb_ndigits} 1)
procy=$(paddedPrint ${test_rdb_obsdb_ndigits} 3)
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_obsdb_npex} -npey ${test_rdb_obsdb_npey} -x ${test_rdb_obsdb_npex} -y ${test_rdb_obsdb_npey} -ndigits ${test_rdb_obsdb_ndigits} \
-obsin ${INPUTS}/rdb/obsdb/obsatms-v2 -obsout obsatms -split-on-key id_report 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_obsdb splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
check_status=0
check_result ${REFERENCE}/rdb/obsdb/obsatms_${procx}_${procy} obsatms_${procx}_${procy} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_obsdb splitting procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=1
[ "${status}" -ne 0 ] && return 1
rm obsatms_${procx}_${procy}
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_obsdb_npex} -npey ${test_rdb_obsdb_npey} -ndigits ${test_rdb_obsdb_ndigits} \
-obsin ${INPUTS}/rdb/obsdb/obsatms-v2 -obsout obsatms -split-on-key id_report 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_obsdb splitting all program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
procx=1
procy=1
while [ "${procx}" -le "${test_rdb_obsdb_npex}" ]; do
while [ "${procy}" -le "${test_rdb_obsdb_npey}" ]; do
procx_str=$(paddedPrint ${test_rdb_obsdb_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_obsdb_ndigits} ${procy})
check_status=0
check_result ${REFERENCE}/rdb/obsdb/obsatms_${procx_str}_${procy_str} obsatms_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_obsdb splitting procx=${procx_str} procy=${procy_str} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm obsatms_*_*
echo "test_rdb_obsdb() ends"
} ## End of function 'test_rdb_obsdb'
test_rdb_avhrr () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_rdb_avhrr() begins"
test_rdb_avhrr_ndigits=4
test_rdb_avhrr_npex=1
test_rdb_avhrr_npey=4
procx=$(paddedPrint ${test_rdb_avhrr_ndigits} ${test_rdb_avhrr_npex})
procy=$(paddedPrint ${test_rdb_avhrr_ndigits} ${test_rdb_avhrr_npey})
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_avhrr_npex} -npey ${test_rdb_avhrr_npey} -x ${test_rdb_avhrr_npex} -y ${test_rdb_avhrr_npey} -ndigits ${test_rdb_avhrr_ndigits} -obsin ${INPUTS}/rdb/avhrr/obsiasi -obsout obsiasi 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_avhrr splitting program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
assert "test_rdb_avhrr splitting procx=${procx} procy=${procy} 'schema'" \
[ -n "$(echo '.schema' | sqlite3 obsiasi_${procx}_${procy} | grep -i 'CREATE TABLE avhrr')" ] || status=1
check_status=0
check_result ${REFERENCE}/rdb/avhrr/obsiasi_${procx}_${procy} obsiasi_${procx}_${procy} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_avhrr splitting procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=1
[ "${status}" -ne 0 ] && return 1
rm obsiasi_${procx}_${procy}
status=0
program_status=0
${SPLITOBS} -round-robin -npex ${test_rdb_avhrr_npex} -npey ${test_rdb_avhrr_npey} -ndigits ${test_rdb_avhrr_ndigits} -obsin ${INPUTS}/rdb/avhrr/obsiasi -obsout obsiasi 1>> check_result.listing 2>&1 || program_status=$?
assert "test_rdb_avhrr splitting all program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
procx=1
procy=1
while [ "${procx}" -le "${test_rdb_avhrr_npex}" ]; do
while [ "${procy}" -le "${test_rdb_avhrr_npey}" ]; do
procx_str=$(paddedPrint ${test_rdb_avhrr_ndigits} ${procx})
procy_str=$(paddedPrint ${test_rdb_avhrr_ndigits} ${procy})
check_status=0
check_result ${REFERENCE}/rdb/avhrr/obsiasi_${procx_str}_${procy_str} obsiasi_${procx_str}_${procy_str} ${DIFF_METHOD_FOR_SQL_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_rdb_avhrr splitting procx=${procx} procy=${procy} check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
let procy=procy+1
done
let procx=procx+1
done
[ "${status}" -ne 0 ] && return 1
rm obsiasi_*_*
echo "test_rdb_avhrr() ends"
} ## End of function 'test_rdb_avhrr'
test_burp_subdomains () {
set -e
[ -n "${SET_MX}" ] && ${SET_MX}
echo "test_burp_subdomains() begins"
### Tests pour les AMSUB
fam=to_amsub
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam}.2_enrgs -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 1 -npey 2 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam}.2_enrgs program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${INPUTS}/burp/2011070112_${fam}.2_enrgs 2011070112_${fam}_0001_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam}.2_enrgs check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm -f 2011070112_${fam}_0001_0001 2011070112_${fam}_0001_0002
### Tests pour les UA
fam=ua
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam}.north_south -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 1 -npey 2 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} north-south program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.north 2011070112_${fam}_0001_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} north check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.south 2011070112_${fam}_0001_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} south check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0001_0001 2011070112_${fam}_0001_0002
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam}.east_west -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 2 -npey 1 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} east-west program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.east 2011070112_${fam}_0001_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} east check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.west 2011070112_${fam}_0002_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} west check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0001_0001 2011070112_${fam}_0002_0001
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam}.world -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 2 -npey 2 -verbose 3 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} world program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
assert "test_burp_subdomains fam=${fam} east file is not there (that is OK)" [ ! -f 2011070112_${fam}_0001_0001 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.west 2011070112_${fam}_0002_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} west check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.north 2011070112_${fam}_0002_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} north check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.south 2011070112_${fam}_0002_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} south check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0002_0001 2011070112_${fam}_0002_0002 2011070112_${fam}_0001_0002
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam}.world-res -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 2 -npey 2 -verbose 3 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} world-res program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
assert "test_burp_subdomains fam=${fam} east-res file is not there (that is OK)" [ ! -f 2011070112_${fam}_0001_0001 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.west-res 2011070112_${fam}_0002_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} west-res check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.north-res 2011070112_${fam}_0002_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} north-res check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}.south-res 2011070112_${fam}_0002_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} south-res check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0002_0001 2011070112_${fam}_0002_0002 2011070112_${fam}_0001_0002
### Tests pour les UA4D
fam=ua4d.82099
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam} -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 1 -npey 2 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} north-south program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}_0001_0001 2011070112_${fam}_0001_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} north check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
assert "test_burp_subdomains fam=${fam} south check_result (status=${check_status})" [ ! -f 2011070112_${fam}_0001_0002 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0001_0001
### Tests pour les UA4D
fam=ua4d
rm -f 2011070112_${fam}
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/2011070112_${fam} -burpout 2011070112_${fam} -fstin ${GRIDS}/glbgrid -nomvar P0 -npex 1 -npey 2 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains fam=${fam} north-south program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}_0001_0002 2011070112_${fam}_0001_0002 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} north check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
check_status=0
check_result ${REFERENCE}/burp/2011070112_${fam}_0001_0001 2011070112_${fam}_0001_0001 ${DIFF_METHOD_FOR_BURP_FILES} 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains fam=${fam} south check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
[ "${status}" -ne 0 ] && return 1
rm 2011070112_${fam}_0001_0001 2011070112_${fam}_0001_0002
npex=1
npey=16
for fam in ai.EU3859.201102011524 ua.stnid.85586 ua ua4d ai sw sf pr sc ro to_amsub to_amsua csr ssmis airs iasi; do
for filein in 2011020118_${fam} 2011070112_${fam}; do
if [ ! -f ${INPUTS}/burp/${filein} ]; then
continue
fi
rm -f ${filein}*
status=0
program_status=0
${SPLITOBS} -burpin ${INPUTS}/burp/${filein} -burpout ${filein} -fstin ${GRIDS}/glbgrid \
-nomvar P0 -npex ${npex} -npey ${npey} 1>> check_result.listing 2>&1 || program_status=$?
assert "test_burp_subdomains filein=${filein} program execution (status=${program_status})" [ "${program_status}" -eq 0 ] || status=$?
for file in ${filein}_0001_[0-9][0-9][0-9][0-9]; do
${editbrp} -s ${file} -d ${filein} -n -i 0 1>> check_result.listing 2>&1
done
check_status=0
if [[ "${fam}" = ua4d* ]]; then
echo ${burpdiff} ${INPUTS}/${filein} ${PWD}/${filein} -oreste || check_status=$?
tty -s && read
else
check_result ${INPUTS}/burp/${filein} ${filein} burp-SQL 1>> check_result.listing 2>&1 || check_status=$?
assert "test_burp_subdomains filein=${filein} recomposition check_result (status=${check_status})" [ "${check_status}" -eq 0 ] || status=$?
fi