forked from corosync/corosync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autobuild.sh
executable file
·112 lines (94 loc) · 2.04 KB
/
autobuild.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh
#
# This script is called by buildbot to test
# corosync. It is run continously to help catch regressions.
#
# ENVIRONMENT variables that affect it's behaviour:
#
# TEST_NODES - the hostnames of the nodes to be tested
# TARGET - this is used by mock so look in /etc/mock for
# possible options.
#
LOG="echo CTS: "
# required packages
which mock >/dev/null 2>&1
if [ $? -ne 0 ]
then
$LOG 'please install mock (yum install mock).'
exit 1
fi
MOCK=/usr/bin/mock
git clean -xfd
set -e
$LOG 'running autogen ...'
./autogen.sh
$LOG 'running configure ...'
./configure --enable-testagents --enable-watchdog --enable-monitoring
$LOG 'building source rpm'
rm -f *.src.rpm
make srpm
SRPM=$(ls *src.rpm)
if [ ! -f $SRPM ]
then
$LOG no source rpm to build from!
exit 1
fi
if [ -z "$TARGET" ]
then
TARGET=fedora-16-x86_64
fi
case $TARGET in
fedora-15-x86_64)
EXTRA_WITH=" --with systemd"
;;
fedora-16-x86_64)
EXTRA_WITH=" --with systemd"
;;
fedora-17-x86_64)
EXTRA_WITH=" --with systemd"
;;
*)
esac
RPM_DIR=/var/lib/mock/$TARGET/result
rm -f $RPM_DIR/corosync*.rpm
$LOG "running mock rebuild ($SRPM)"
$MOCK -v -r $TARGET --no-clean --rebuild $SRPM --with testagents --with watchdog --with monitoring $EXTRA_WITH
if [ -z "$TEST_NODES" ]
then
$LOG no test nodes, exiting without running cts.
exit 0
else
# start the VMs, or leave them running?
true
fi
RPM_LIST=
for r in $RPM_DIR/corosync*.rpm
do
case $r in
*src.rpm)
;;
*-devel-*)
;;
*)
RPM_LIST="$RPM_LIST $r"
;;
esac
done
$LOG installing $RPM_LIST
$LOG onto the test nodes $TEST_NODES
# load and install rpm(s) onto the nodes
for n in $TEST_NODES
do
$LOG "Installing onto $n"
sudo ssh $n "rm -rf /tmp/corosync*.rpm"
sudo ssh $n "rm -f /etc/corosync/corosync.conf.*"
sudo scp $RPM_LIST $n:/tmp/
sudo ssh $n "rpm --nodeps --force -Uvf /tmp/corosync*.rpm"
done
$LOG 'running CTS ...'
CTS_LOG=$(pwd)/cts.log
rm -f $CTS_LOG
pushd cts
# needs sudo to read /var/log/messages
sudo -n ./corolab.py --nodes "$TEST_NODES" --outputfile $CTS_LOG $CTS_ARGS
popd