1 | #!/bin/sh |
---|
2 | # initialise user dependent variable |
---|
3 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
4 | MAIN_DIR=$(dirname $SETTE_DIR) |
---|
5 | export SETTE_TIMING='no' |
---|
6 | export NOT_USING_QCO='no' |
---|
7 | |
---|
8 | # Parse command-line arguments |
---|
9 | if [ $# -gt 0 ]; then |
---|
10 | while getopts t:x:cshTq option; do |
---|
11 | case $option in |
---|
12 | c) export SETTE_CLEAN_CONFIGS='yes' |
---|
13 | export SETTE_SYNC_CONFIGS='yes' |
---|
14 | echo "" |
---|
15 | echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation" |
---|
16 | echo "";; |
---|
17 | s) export SETTE_SYNC_CONFIGS='yes' |
---|
18 | echo "" |
---|
19 | echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration" |
---|
20 | echo "";; |
---|
21 | t) export SETTE_TEST_CONFIGS=($OPTARG) |
---|
22 | echo "" |
---|
23 | if [ ${#SETTE_TEST_CONFIGS[@]} -gt 1 ]; then |
---|
24 | echo "Configurations ${SETTE_TEST_CONFIGS[@]} will be tested if they are available" |
---|
25 | else |
---|
26 | echo "Configuration ${SETTE_TEST_CONFIGS[@]} will be tested if it is available" |
---|
27 | fi |
---|
28 | echo "" ;; |
---|
29 | x) export SETTE_TEST_TYPES=($OPTARG) |
---|
30 | ;; |
---|
31 | T) export SETTE_TIMING='yes' |
---|
32 | echo "" |
---|
33 | echo "ln_timing will be set to true" |
---|
34 | echo "";; |
---|
35 | q) export NOT_USING_QCO='yes' |
---|
36 | echo "" |
---|
37 | echo "key_qco and key_linssh will NOT be activated" |
---|
38 | echo "";; |
---|
39 | h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)' |
---|
40 | echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations' |
---|
41 | echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)' |
---|
42 | echo '-T to set ln_timing true for all non-AGRIF configurations' |
---|
43 | echo '-c to clean each configuration' |
---|
44 | echo '-q run without qco environment' |
---|
45 | echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; |
---|
46 | esac |
---|
47 | done |
---|
48 | shift $((OPTIND - 1)) |
---|
49 | fi |
---|
50 | |
---|
51 | . ./param.cfg |
---|
52 | |
---|
53 | if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then |
---|
54 | echo "" |
---|
55 | echo "Configurations $TEST_CONFIGS will be tested if they are available" |
---|
56 | echo "" |
---|
57 | fi |
---|
58 | echo "" |
---|
59 | echo "Carrying out the following tests: ${TEST_TYPES[@]}" |
---|
60 | echo "" |
---|
61 | |
---|
62 | # run sette on reference configuration |
---|
63 | . ./sette_reference-configurations.sh |
---|
64 | if [[ $? != 0 ]]; then |
---|
65 | echo "" |
---|
66 | echo "--------------------------------------------------------------" |
---|
67 | echo "./sette_cfg-ref.sh didn't finish properly, need investigations" |
---|
68 | echo "--------------------------------------------------------------" |
---|
69 | echo "" |
---|
70 | exit 42 |
---|
71 | fi |
---|
72 | |
---|
73 | # run sette on test cases |
---|
74 | . ./sette_test-cases.sh |
---|
75 | if [[ $? != 0 ]]; then |
---|
76 | echo "" |
---|
77 | echo "-----------------------------------------------------------------" |
---|
78 | echo "./sette_test-cases.sh didn't finish properly, need investigations" |
---|
79 | echo "-----------------------------------------------------------------" |
---|
80 | echo "" |
---|
81 | exit 42 |
---|
82 | fi |
---|
83 | |
---|
84 | # run sette report |
---|
85 | echo "" |
---|
86 | echo "-------------------------------------------------------------" |
---|
87 | echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" |
---|
88 | echo "-------------------------------------------------------------" |
---|
89 | echo "" |
---|
90 | NRUN=999 |
---|
91 | NIT=0 |
---|
92 | while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do |
---|
93 | nit=$((nit+1)) |
---|
94 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
95 | if [[ $NRUN -ne 0 ]]; then |
---|
96 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
97 | else |
---|
98 | printf "%-50s\n" " " |
---|
99 | . ./sette_rpt.sh |
---|
100 | exit |
---|
101 | fi |
---|
102 | sleep 10 |
---|
103 | done |
---|
104 | printf "\n" |
---|
105 | echo "" |
---|
106 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
107 | echo "" |
---|