2019-01-29 03:44:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
2019-03-01 10:01:09 +01:00
|
|
|
# keep this in sync with setup.sh
|
|
|
|
CONTAINER=${RELEASE:-buster}-${ARCH:-amd64}
|
|
|
|
AUTOPKGTESTDIR=${SEMAPHORE_CACHE_DIR:-/tmp}/autopkgtest
|
|
|
|
# semaphore cannot expose these, but useful for interactive/local runs
|
|
|
|
ARTIFACTS_DIR=/tmp/artifacts
|
|
|
|
|
|
|
|
# add current debian/ packaging
|
|
|
|
git fetch --depth=1 https://salsa.debian.org/systemd-team/systemd.git master
|
|
|
|
git checkout FETCH_HEAD debian
|
|
|
|
|
|
|
|
# craft changelog
|
|
|
|
UPSTREAM_VER=$(git describe | sed 's/^v//')
|
|
|
|
cat << EOF > debian/changelog.new
|
|
|
|
systemd (${UPSTREAM_VER}-0) UNRELEASED; urgency=low
|
|
|
|
|
|
|
|
* Automatic build for upstream test
|
|
|
|
|
|
|
|
-- systemd test <pkg-systemd-maintainers@lists.alioth.debian.org> $(date -R)
|
|
|
|
|
|
|
|
EOF
|
|
|
|
cat debian/changelog >> debian/changelog.new
|
|
|
|
mv debian/changelog.new debian/changelog
|
|
|
|
|
|
|
|
# clean out patches
|
|
|
|
rm -rf debian/patches
|
|
|
|
# disable autopkgtests which are not for upstream
|
|
|
|
sed -i '/# NOUPSTREAM/ q' debian/tests/control
|
|
|
|
# enable more unit tests
|
|
|
|
sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true /' debian/rules
|
|
|
|
# no orig tarball
|
|
|
|
echo '1.0' > debian/source/format
|
|
|
|
|
|
|
|
# build source package
|
|
|
|
dpkg-buildpackage -S -I -I$(basename "$SEMAPHORE_CACHE_DIR") -d -us -uc -nc
|
|
|
|
|
|
|
|
# now build the package and run the tests
|
|
|
|
rm -rf "$ARTIFACTS_DIR"
|
|
|
|
# autopkgtest exits with 2 for "some tests skipped", accept that
|
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 14:10:42 +02:00
|
|
|
$AUTOPKGTESTDIR/runner/autopkgtest --apt-upgrade \
|
|
|
|
--env DEB_BUILD_OPTIONS=noudeb \
|
|
|
|
--env TEST_UPSTREAM=1 ../systemd_*.dsc \
|
|
|
|
-o "$ARTIFACTS_DIR" \
|
|
|
|
-- lxc -s $CONTAINER \
|
|
|
|
|| [ $? -eq 2 ]
|