#!/bin/sh # initialise user dependent variable SETTE_DIR=$(cd $(dirname "$0"); pwd) MAIN_DIR=$(dirname $SETTE_DIR) export SETTE_TIMING='no' export NOT_USING_QCO='no' # Parse command-line arguments if [ $# -gt 0 ]; then while getopts t:x:cshTq option; do case $option in c) export SETTE_CLEAN_CONFIGS='yes' export SETTE_SYNC_CONFIGS='yes' echo "" echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation" echo "";; s) export SETTE_SYNC_CONFIGS='yes' echo "" echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration" echo "";; t) export SETTE_TEST_CONFIGS=($OPTARG) echo "" if [ ${#SETTE_TEST_CONFIGS[@]} -gt 1 ]; then echo "Configurations ${SETTE_TEST_CONFIGS[@]} will be tested if they are available" else echo "Configuration ${SETTE_TEST_CONFIGS[@]} will be tested if it is available" fi echo "" ;; x) export SETTE_TEST_TYPES=($OPTARG) ;; T) export SETTE_TIMING='yes' echo "" echo "ln_timing will be set to true" echo "";; q) export NOT_USING_QCO='yes' echo "" echo "key_qco and key_linssh will NOT be activated" echo "";; h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)' echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations' echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)' echo '-T to set ln_timing true for all non-AGRIF configurations' echo '-c to clean each configuration' echo '-q run without qco environment' echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; esac done shift $((OPTIND - 1)) fi . ./param.cfg if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then echo "" echo "Configurations $TEST_CONFIGS will be tested if they are available" echo "" fi echo "" echo "Carrying out the following tests: ${TEST_TYPES[@]}" echo "" # run sette on reference configuration . ./sette_reference-configurations.sh if [[ $? != 0 ]]; then echo "" echo "--------------------------------------------------------------" echo "./sette_cfg-ref.sh didn't finish properly, need investigations" echo "--------------------------------------------------------------" echo "" exit 42 fi # run sette on test cases . ./sette_test-cases.sh if [[ $? != 0 ]]; then echo "" echo "-----------------------------------------------------------------" echo "./sette_test-cases.sh didn't finish properly, need investigations" echo "-----------------------------------------------------------------" echo "" exit 42 fi # run sette report echo "" echo "-------------------------------------------------------------" echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" echo "-------------------------------------------------------------" echo "" NRUN=999 NIT=0 while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do nit=$((nit+1)) NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) if [[ $NRUN -ne 0 ]]; then printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; else printf "%-50s\n" " " . ./sette_rpt.sh exit fi sleep 10 done printf "\n" echo "" echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" echo ""