Version 1.7.22.
[libguestfs.git] / autobuild.sh
1 #!/bin/bash -
2
3 PROJECT=libguestfs
4 FEBOOTSTRAP_PATH=$HOME/d/febootstrap
5 MAILTO=libguestfs@redhat.com
6 HOSTNAME="$(hostname -s)"
7
8 #----------------------------------------------------------------------
9 # Helper functions.
10
11 failed ()
12 {
13     mail -s "$HOSTNAME $PROJECT FAILED $1 $gitsha" $MAILTO < local-log
14 }
15
16 ok ()
17 {
18     mail -s "$HOSTNAME $PROJECT success $gitsha" $MAILTO < local-log
19 }
20
21 #----------------------------------------------------------------------
22
23 set -e
24 set -x
25
26 # Make sure we build and test against latest febootstrap.
27 PATH=$FEBOOTSTRAP_PATH:$FEBOOTSTRAP_PATH/helper:$PATH
28
29 # Remove any old cache directories.
30 rm -rf /tmp/guestfs.* ||:
31
32 rm -f local-log
33 cat > local-log <<EOF
34
35 This is an automatic message generated by the builder on
36 $HOSTNAME for $PROJECT.  Log files from the build
37 follow below.
38
39 $(uname -a)
40 $(date)
41
42 -----
43
44 EOF
45 exec >> local-log 2>&1
46
47 # Pull from the public repo so that we don't need ssh-agent.
48 git pull --rebase git://git.annexia.org/git/libguestfs.git master
49 git clean -d -f
50
51 # The git version we are building.
52 gitsha=$(git log|head -1|awk '{print $2}')
53
54 # Do the configure step.
55 ./bootstrap ||:
56 ./autogen.sh --enable-gcc-warnings || {
57     failed "configure step"
58     exit 1
59 }
60
61 # Do the build step.
62 make || {
63     failed "build step"
64     exit 1
65 }
66
67 # Tests that are skipped (note that these tests should be fixed).
68 case "$HOSTNAME" in
69     builder-ubuntu)
70         # get_e2uuid: /dev/vdc: [no error message]
71         # get_e2label: /dev/vda1: [no error message]
72         # Diagnosis: either mkjournal is not writing a UUID or blkid is
73         # unable to pick it up.
74         export SKIP_TEST_GET_E2UUID=1
75         export SKIP_TEST_SET_E2UUID=1
76         export SKIP_TEST_SET_E2LABEL=1
77
78         # Avoids:
79         # device-mapper: ioctl: unable to remove open device temporary-cryptsetup-661
80         # device-mapper: remove ioctl failed: Device or resource busy
81         # guestfsd: error: Device lukstest is busy.
82         # Diagnosis: appears to be a bug in cryptsetup on Ubuntu.
83         # https://bugzilla.redhat.com/show_bug.cgi?id=527056
84         export SKIP_TEST_LUKS_SH=1
85         ;;
86 esac
87
88 # Run the tests.
89 make check || {
90     failed "tests"
91     exit 1
92 }
93
94 ok