-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrontest_aq_gnu.sh
executable file
·69 lines (67 loc) · 1.77 KB
/
crontest_aq_gnu.sh
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
#!/bin/bash -l
if [ -z $AQ_JEDI_CRO ] ; then
if [ -f $HOME/loadaq_crontest_gnu.sh ] ; then
source $HOME/loadaq_crontest_gnu.sh
echo "AQ CRONTAB TEST: loaded execution environment"
else
echo "AQ CRONTAB TEST: execution environment not loaded"
exit 1
fi
fi
if [ -z $AQ_JEDI_CRO ] ; then
echo "AQ CRONTAB TEST: execution environment not set"
exit 1
fi
\rm -fr $AQ_JEDI_CRO/*
\rm -fr $AQ_JEDI_BLD/*
\rm -fr $AQ_JEDI_DIR/*
cd $AQ_JEDI_SRC
git pull > $AQ_JEDI_CRO/git_output.out 2>&1
\rm -fr bundle/*
git checkout -- bundle/CMakeLists.txt >> $AQ_JEDI_CRO/git_output.out 2>&1
git status >> $AQ_JEDI_CRO/git_output.out 2>&1
./install_aq.ksh > $AQ_JEDI_CRO/install_output.out 2>&1
install_ret=$?
if [ $install_ret = 0 ] ; then
cd $AQ_JEDI_BLD/aq
if [ $AQ_JEDI_SUBMIT = slurm ] ; then
rm -f HPC_JOB HPC_OUT
cat > HPC_JOB <<EOF
#!/bin/bash
#SBATCH -J aq-gnu-crontest
#Number of nodes
#SBATCH -N 1
#SBATCH -p debug
#SBATCH --ntasks-per-node=36
#SBATCH -o HPC_GNU_OUT
#SBATCH -e HPC_GNU_OUT
source $HOME/loadaq_crontest_gnu.sh
cd $AQ_JEDI_BLD/aq
ctest --output-on-failure > $AQ_JEDI_CRO/ctest_output.out 2>&1
EOF
sbatch HPC_JOB
g_ret=-99
while [ $g_ret -ne 0 ] ; do
grep 'tests passed' $AQ_JEDI_CRO/ctest_output.out > /dev/null 2>&1
g_ret=$?
sleep 5
done
ret_st=`grep 'tests passed' $AQ_JEDI_CRO/ctest_output.out | awk '{print $4}'`
else
ctest --output-on-failure > $AQ_JEDI_CRO/ctest_output.out 2>&1
ret_st=$?
fi
if [ $ret_st -ne 0 ] ; then
status=Failed
message="Failed on ctest"
else
status=Succeeded
message="OK"
fi
else
status=Failed
message="Failed on install"
fi
mailx -s "AQ GNU automatic testing $status at `date`" $1 <<EOF
$message
EOF