1acd834104
We have some unit-style tests that run `ex container`, but they aren't "real"; they don't use scripts for example. Let's add tests for this similar to `tests/compose`. We use a 26 base, but the target repos need to be 27 to pick up the fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1478172 Add some bits to share infra between `tests/compose` and `tests/ex-container`; basically handling the rpmmd repos. I tweaked things to be more streamlined there between the `.papr.yml` and the test script. Right now this is just one test for `bash`, but lays some of the infrastructure for doing more. One thing that we need to do to improve more here is to better cache RPMs, a bit like the compose tests do. Closes: #1024 Approved by: jlebon
37 lines
1.4 KiB
Bash
Executable File
37 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/bash
|
|
# Install build dependencies, run unit tests and installed tests.
|
|
|
|
set -xeuo pipefail
|
|
|
|
dn=$(dirname $0)
|
|
. ${dn}/libbuild.sh
|
|
|
|
# Use the latest ostree by default
|
|
id=$(. /etc/os-release && echo $ID)
|
|
version_id=$(. /etc/os-release && echo $VERSION_ID)
|
|
if [ "$id" == fedora ] && [ "$version_id" == 26 ]; then
|
|
echo -e '[fahc]\nmetadata_expire=1m\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/fahc/rdgo/build/\ngpgcheck=0\n' > /etc/yum.repos.d/fahc.repo
|
|
# Until we fix https://github.com/rpm-software-management/libdnf/pull/149
|
|
sed -i -e 's,metadata_expire=6h,exclude=ostree ostree-devel ostree-libs ostree-grub2\nmetadata_expire=6h,' /etc/yum.repos.d/fedora-updates.repo
|
|
elif [ "$id" == centos ]; then
|
|
echo -e '[cahc]\nmetdata_expire=1m\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build\ngpgcheck=0\n' > /etc/yum.repos.d/cahc.repo
|
|
fi
|
|
|
|
pkg_upgrade
|
|
pkg_install_builddeps rpm-ostree
|
|
# Mostly dependencies for tests
|
|
pkg_install ostree{,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML clang \
|
|
libubsan libasan libtsan elfutils fuse sudo python-gobject-base
|
|
# For ex-container tests
|
|
pkg_install_if_os fedora parallel
|
|
|
|
if [ -n "${CI_PKGS:-}" ]; then
|
|
pkg_install ${CI_PKGS}
|
|
fi
|
|
|
|
# create an unprivileged user for testing
|
|
adduser testuser
|
|
|
|
export LSAN_OPTIONS=verbosity=1:log_threads=1
|
|
build --enable-installed-tests --enable-gtk-doc
|