-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_builds.sh
executable file
·92 lines (80 loc) · 2.11 KB
/
test_builds.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
TESTBUILDSLOG="log_test_builds.txt"
TESTARCHIVELOG="log_test_archive_list.txt"
# warn the user - this is not for general use
warn_the_user()
{
echo ""
cat <<EOF
WARNING!
Do not run these tests unless you know what you are doing! All they will do
is build a lot of code and then tear it back down.
EOF
echo "Press ctrl-c to stop. Otherwise starting the (long) set of tests in..."
for i in {10..1}
do
echo "$i"
sleep 1
done
}
init_logs()
{
DAT=`date -u +%s`
echo "Initializing logs at $DAT"
echo "Date is $DAT" >& $TESTARCHIVELOG
echo "Date is $DAT" >& $TESTBUILDSLOG
}
teardown()
{
echo "START TEARDOWN------------------------------------------------------" \
| tee -a $TESTARCHIVELOG
echo " Before teardown; Archive contents:" | tee -a $TESTARCHIVELOG
ls archive >> $TESTARCHIVELOG
./clean_support.sh -e -f | tee -a $TESTARCHIVELOG
echo " After teardown; Archive contents:" | tee -a $TESTARCHIVELOG
echo "FINISH TEARDOWN-----------------------------------------------------" \
| tee -a $TESTARCHIVELOG
}
test()
{
PYTHIAV=$1
ROOTV=$2
HTTPFLAG=""
DEBUGFLAG=""
if [[ $# > 2 ]]; then
HTTPFLAG=$3
fi
if [[ $# > 3 ]]; then
DEBUGFLAG=$3
fi
echo "START TEST----------------------------------------------------------" \
| tee -a $TESTBUILDSLOG
echo "Build command is: ./build_support.sh -p $PYTHIAV -r $ROOTV $HTTPFLAG" \
| tee -a $TESTBUILDSLOG
./build_support.sh -p $PYTHIAV -r $ROOTV $HTTPFLAG \
| tee -a $TESTBUILDSLOG
if [[ $? != 0 ]]; then
echo " "
echo " "
echo " "
echo "The build failed! There was an ERROR = $?!"
teardown
echo " "
echo "Exiting after error!"
exit 1
fi
echo "FINISH TEST---------------------------------------------------------" \
| tee -a $TESTBUILDSLOG
}
warn_the_user
init_logs
test 6 v5-34-24 -s
teardown
test 6 v5-34-24 -s -d
teardown
test 8 v5-34-24 -s
teardown
echo " "
echo " "
DAT=`date -u +%s`
echo "Done at $DAT"