]> git.ipfire.org Git - thirdparty/systemd.git/blob - semaphoreci/gcc-compilation.sh
Merge pull request #12221 from keszybz/test-cleanups
[thirdparty/systemd.git] / semaphoreci / gcc-compilation.sh
1 #!/bin/bash
2 set -ex
3
4 # keep this in sync with setup.sh
5 CONTAINER=${RELEASE:-buster}-${ARCH:-amd64}
6 AUTOPKGTESTDIR=${SEMAPHORE_CACHE_DIR:-/tmp}/autopkgtest
7 # semaphore cannot expose these, but useful for interactive/local runs
8 ARTIFACTS_DIR=/tmp/artifacts
9
10 # add current debian/ packaging
11 git fetch --depth=1 https://salsa.debian.org/systemd-team/systemd.git master
12 git checkout FETCH_HEAD debian
13
14 # craft changelog
15 UPSTREAM_VER=$(git describe | sed 's/^v//')
16 cat << EOF > debian/changelog.new
17 systemd (${UPSTREAM_VER}-0) UNRELEASED; urgency=low
18
19 * Automatic build for upstream test
20
21 -- systemd test <pkg-systemd-maintainers@lists.alioth.debian.org> $(date -R)
22
23 EOF
24 cat debian/changelog >> debian/changelog.new
25 mv debian/changelog.new debian/changelog
26
27 # clean out patches
28 rm -rf debian/patches
29 # disable autopkgtests which are not for upstream
30 sed -i '/# NOUPSTREAM/ q' debian/tests/control
31 # enable more unit tests
32 sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true /' debian/rules
33 # no orig tarball
34 echo '1.0' > debian/source/format
35
36 # build source package
37 dpkg-buildpackage -S -I -I$(basename "$SEMAPHORE_CACHE_DIR") -d -us -uc -nc
38
39 # now build the package and run the tests
40 rm -rf "$ARTIFACTS_DIR"
41 # autopkgtest exits with 2 for "some tests skipped", accept that
42 $AUTOPKGTESTDIR/runner/autopkgtest --apt-upgrade \
43 --env DEB_BUILD_OPTIONS=noudeb \
44 --env TEST_UPSTREAM=1 ../systemd_*.dsc \
45 -o "$ARTIFACTS_DIR" \
46 -- lxc -s $CONTAINER \
47 || [ $? -eq 2 ]