2018-01-09 21:20:24 +03:00
#!/bin/bash
# Build and run rpm-ostree's unit tests using the just-built ostree for this PR.
set -xeuo pipefail
# Frozen to a tag for now to help predictability; it's
# also useful to test building *older* versions since
# that must work.
2020-01-22 00:56:31 +03:00
RPMOSTREE_TAG = v2019.4
2018-01-09 21:20:24 +03:00
dn = $( dirname $0 )
2020-06-17 22:48:31 +03:00
. ${ dn } /libbuild.sh
2018-01-09 21:20:24 +03:00
codedir = $( pwd )
pkg_upgrade
2018-02-22 22:16:33 +03:00
pkg_install_buildroot
pkg_builddep ostree rpm-ostree
2018-01-09 21:20:24 +03:00
pkg_install rpm-ostree && rpm -e rpm-ostree
2020-01-22 00:56:31 +03:00
# Duplicate of deps from ci/installdeps.sh in rpm-ostree for tests
pkg_install ostree{ ,-devel,-grub2} createrepo_c /usr/bin/jq python3-pyyaml \
libubsan libasan libtsan elfutils fuse sudo python3-gobject-base \
selinux-policy-devel selinux-policy-targeted python3-createrepo_c \
2023-05-01 20:43:26 +03:00
rsync python3-rpm parallel clang rustfmt-preview clang-tools-extra
2020-01-22 00:56:31 +03:00
# From rpm-ostree/ci/vmcheck-provision.sh
pkg_install openssh-clients ansible
2018-01-09 21:20:24 +03:00
# build+install ostree
cd ${ codedir }
build ${ CONFIGOPTS :- }
make install
tmpd = $( mktemp -d)
cd ${ tmpd }
git clone --recursive --depth= 1 -b ${ RPMOSTREE_TAG } https://github.com/projectatomic/rpm-ostree
cd rpm-ostree
build
# We want to capture automake results
cleanup( ) {
mv test-suite.log ${ codedir } || true
2018-05-28 22:21:19 +03:00
mv vmcheck ${ codedir } || true
2018-01-09 21:20:24 +03:00
}
trap cleanup EXIT
make -j 8 check
# Basic sanity test of rpm-ostree+new ostree by restarting rpm-ostreed
if ! make vmsync; then
ssh -o User = root vmcheck 'journalctl --no-pager | tail -1000'
2019-01-24 13:36:40 +03:00
echo "vmsync failed" ; exit 1
2018-01-09 21:20:24 +03:00
fi
# Now run tests; just a subset ⊂ for now to avoid CI overload
2018-08-18 04:50:14 +03:00
make vmcheck TESTS = "layering-basic-1 layering-basic-2"