Commit Graph

87 Commits

Author SHA1 Message Date
Ondrej Mosnacek
edb4f38934 deploy: Try to rebuild policy in new deployment if needed
Whenever the user has SELinux enabled and has any local
modules/modifications installed, it is necessary to rebuild the policy
in the final deployment, otherwise ostree will leave the binary policy
files unchanged from last deployment as it detects difference against
the base content (in rpm-ostree case this is the RPM content).

To avoid the situation where the policy binaries go stale once any local
customization of the policy is made, try to rebuild the policy as part
of sysroot_finalize_deployment(). Use the special
--rebuild-if-modules-changed switch, which detects if the input module
files have changed relative to last time the policy was built and skips
the most time-consuming part of the rebuild process if modules are
unchanged (thus making this a relatively cheap operation if the user
hasn't made any modifications to the shipped policy).

As suggested by Jonathan Lebon, this uses bubblewrap (via
g_spawn_sync()) to perform the rebuild inside the deployment's
filesystem tree, which also means that ostree will have a runtime
dependency on bubblewrap.

Partially addresses: https://github.com/coreos/fedora-coreos-tracker/issues/701

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-03-28 17:18:03 -04:00
Jonathan Lebon
a51ae1ed73 ci/make-git-snapshot.sh: xz the archive
This matches `make dist` and what the spec file expects.
2022-02-03 13:23:43 -05:00
Jonathan Lebon
92c396c82b ci/make-git-snapshot.sh: auto-initialize submodules
Matches `autogen.sh`.
2022-02-03 13:22:47 -05:00
Jonathan Lebon
8d45298a2d ci/make-git-snapshot.sh: fix archive name
The archive name is libostree even though the project name is ostree, so
we can't rely on the directory name.

Just hardcode it.
2022-02-03 13:21:54 -05:00
Jonathan Lebon
8e445cb957 ci/libbuild.sh: drop yum/CentOS support
`dnf` is present in all the platforms we care about now, and the CentOS
bit is out of date. We can re-add it if we add e.g. C[89]S support with
the updated list of packages.

Motivated by noticing that the `yum` symlink isn't always present.
2022-02-03 13:17:56 -05:00
Simon McVittie
43859b58f6
rofiles-fuse: Build using FUSE 3 if possible, falling back to FUSE 2
This adds build-time configuration logic to automatically detect
and switch between libfuse 2.x and 3.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Luca BRUNO <luca.bruno@coreos.com>
2022-01-04 09:41:38 +00:00
Colin Walters
3b338df956 ci: Require libcap2-bin for capsh
This was previously pulled in indirectly, but it looks like we need
to require it explicitly in newer Ubuntu.
2021-11-09 09:22:43 -05:00
Colin Walters
fda41e8d24 ci: Enable -fanalyzer
Followup to https://github.com/ostreedev/ostree/pull/2463

One thing I noticed here is we lost usage of `build-check.sh`
which also invokes `clang`, which doesn't speak `-fanalyzer`
and would be broken by this if we try to enable `build-check.sh`
again.  But that can come later.
2021-10-15 15:44:04 -04:00
Colin Walters
7ba8dbf0cc Attempt to update packit flow to build in COPR
No idea if this will really work, but at least `packit srpm`
does work now.
2021-10-14 12:36:38 -04:00
Simon McVittie
2c5fa2cdb6 tests: Unset SOURCE_DATE_EPOCH
Some distributions set this during build in order to have reproducible
builds from the same source code: for example, Debian uses the date
from debian/changelog.

However, some of our tests assume that `ostree commit` will result in
a commit with the current date/time, and SOURCE_DATE_EPOCH breaks that
assumption. Unset it for our build-time tests.

Resolves: https://github.com/ostreedev/ostree/issues/2405
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-07-26 11:48:45 +01:00
Luca BRUNO
d573b8dc2f
ci/release-build: evaluate package_version from m4 definition
This fixes the ci-release-build.sh script to directly source
and evaluate 'package_version' from its m4 definition, without
requiring a fully configured source tree.
2021-07-09 16:17:31 +00:00
Dan Nicholson
410b46f09d ci: Update Debian and Ubuntu build dependencies
This refreshes the build dependencies installed for the GitHub Tests
workflow based on the Build-Depends in the upstream packaging. The
handling is now more explicit about any deviations and any release
differences.
2021-06-21 13:47:00 -06:00
Dan Nicholson
156ec07f01 ci: Drop special handling of test-suite.log
The automake test harness[1] already dumps the contents of
`test-suite.log` when `VERBOSE=1` is set, so we don't need to add
special handling for it.

1. https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html
2021-06-21 13:47:00 -06:00
Dan Nicholson
00f7c88a2d ci: So long, Travis CI
travis-ci.org stopped running builds on June 15, 2021. Since this
organization is very unlikely to switch to travis-ci.com, just drop the
setup. The new GitHub Actions tests completely replace it.
2021-06-18 15:30:06 -06:00
Dan Nicholson
a0012ae0ee ci: Add GitHub Actions workflow for test suite
This runs the test suite in various distros. The intention is to use
this to replace the Travis CI setup since it often has rate limit
failures.

Each configuration in the matrix runs in a Docker container, installs
system dependencies and then builds and tests ostree. The scripts are
basically copy and paste of the travis ones with some of the lesser used
features pruned out.

Some differences from the travis setup:

* OS details are gathered from `/etc/os-release` instead of being passed
  in as environment variables.

* The scripts always assume the user is root and don't try to use
  `sudo`.

* The `installcheck` test has been removed since ostree doesn't actually
  use that. It could be added to run the installed tests or
  `gnome-desktop-testing-runner` could just be called directly.

There should be enough flexibility to run other distros like Fedora,
Arch or Alpine. Another option would be to use the other build scripts
in ci/.
2021-06-18 15:30:06 -06:00
Timothée Ravier
b8cca6cef1 *: rename master branch to main 2021-05-07 16:55:03 +02:00
Dan Nicholson
764116ef56 travis: Don't ask any debconf questions when installing packages
Currently the Ubuntu builds are stuck waiting for an answer on what
timezone to use. That could be fixed, but generally the way to do these
types of installs is to set the DEBIAN_FRONTEND environment variable to
`noninteractive` so that debconf just chooses a default. This is what
debootstrap does, for instance. I tested installing tzdata on a local
focal container this way and it just chooses `Etc/UTC` as the timezone.
2021-04-08 10:25:46 -06:00
Colin Walters
7170cf9efd installdeps: Drop PyYAML
Doesn't exist anymore in f33 and we don't depend on python2 anymore.
2021-03-31 15:11:34 -04:00
Colin Walters
d49f3291ad Add --enable-sanitizers, fix make check with it
It's cleaner if this is an build option rather than being
kludged into the CI layer.

Notably we can't use `LD_PRELOAD` anymore with ASAN, so update
our tests to check for `ASAN_OPTIONS`.
2021-02-03 20:33:19 +00:00
Colin Walters
6b5aef7612 ci: Add new build-check-sanitized.sh
All C/C++ projects should use the sanitizers (and static analysis)
in their CI.  We had this but lost it in one of our CI shuffles;
let's readd it.
2021-02-02 21:09:23 +00:00
Colin Walters
afb032e693 ci: Don't install deps if running as non-root
This way we run in Prow too.
2021-02-02 21:08:54 +00:00
Luca BRUNO
0d0eb4715b
ci: run ci-release-build.sh on GitHub
This adds a GitHub action in order to run ci-release-build.sh on
release PRs (detected via the `kind/release` label).
2020-11-16 11:14:40 +00:00
Colin Walters
53b6bbbdf2 travis: Add a 32 bit build
In the past we've had 32 bit bugs that were caught by
the compiler, let's add this to Travis.
2020-10-15 10:50:22 -04:00
Colin Walters
1e127f2dcc ci: Barf on unset umask
Since it's just not a sane thing to do and will cause various
failures in our test suite.
2020-08-05 16:34:52 +00:00
Jonathan Lebon
92284f9b81 ci: Constrain parallel build jobs
The default `_NPROCESSORS_ONLN` heuristic we have isn't cgroups aware.
So it thinks it has e.g. 40 CPUs when running in a k8s pod. This can
then blow through our allocated resource limits.

Declare some modest amount of RAM and CPU resources and override `make`
parallelism.

This matches what rpm-ostree now does in
https://github.com/coreos/rpm-ostree/pull/2155.
2020-07-16 15:44:34 -04:00
Jonathan Lebon
516c1340b3 ci: Remove libpaprci/ directory
And move everything that was in it directly in `ci/`. There's a bunch
more cleanups here that we need to do (and more changes to upstream from
the rpm-ostree copies of this).
2020-06-17 15:48:31 -04:00
Jonathan Lebon
eb3fe35b06 ci: Import latest ci-commitmessage-submodules from rpm-ostree
Especially for https://github.com/coreos/rpm-ostree/pull/2079.
2020-06-17 10:39:51 -04:00
Denis Pynkin
a17cdec936 Add the same config options for distcheck
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2020-04-16 17:34:09 -04:00
Denis Pynkin
0807f100e2 Fix the lost line separator
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2020-04-16 17:34:09 -04:00
Denis Pynkin
735b03dbf9 Add ci_pkgs to travis-install.sh
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2020-04-16 17:34:09 -04:00
Colin Walters
e63647c6d0 travis: Add some libsodium coverage
As far as I can tell we're not gating on this right now.  From
a quick glance, it looks like Debian stable has `libsodium-dev`
but only Ubuntu eoan does which we're not testing right now.
2020-04-16 17:19:51 +00:00
Colin Walters
7febd9d36e Add .cci.jenkinsfile
See https://github.com/jlebon/coreos-ci

This is just a start to test, cut down from the rpm-ostree version.
2020-02-03 16:57:24 +00:00
Dan Nicholson
68a11d4eeb ci/flatpak: Patch GPG error assertions from OSTree
Some of the flatpak tests assert on GPG error strings that come from
OSTree. Those are being changed here, so patch the cloned flatpak 1.4.1
to accommodate the new error strings. When this work lands, I'll send a
patch upstream to flatpak that will eventually trickle back here in a
tagged build.
2020-01-24 13:03:30 -07:00
Dan Nicholson
a6994459c1 ci/rpmostree: Bump to 2019.4
The vmcheck tests in 2019.3 fail because of an SSH control socket issue
on overlayfs. This is fixed in 2019.4[1]. That has some other changes
such as using Python 3 in tests. The package dependencies have been
synced from the rpm-ostree CI for that.

Unfortunately, this is no longer a totally representative test of f29
since it has 2019.3 in updates. But that's the price you pay for
exercising someone else's CI from your own CI.

1. c89f81c138

Fixes: #1994
2020-01-21 20:33:58 -07:00
Alex Kiernan
967ea66921 Revert "Always enable trivial-httpd for tests"
This reverts commit 82699a67db.
2019-10-19 22:20:27 +01:00
OpenShift Merge Robot
c943bf40b4
Merge pull request #1912 from akiernan/us-fix-trivial-httpd
Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD
2019-10-16 20:15:56 +02:00
Colin Walters
9defac5b8c ci: Skip all yum operations if SKIP_INSTALLDEPS is set
This is used by our OpenShift Prow job; we use the
cosa buildroot container:

https://github.com/coreos/coreos-assembler/pull/730

And using `yum` at all means we can flake on fetching rpm metadata.
2019-10-16 13:32:36 +00:00
Colin Walters
1a134bf7ee ci: Make ${ARTIFACTS} directory
It may not exist in OpenShift Prow by default.
2019-10-14 14:30:14 +00:00
Colin Walters
569e09f509 ci: Honor ARTIFACTS environment variable
This is set by the OpenShift Prow pod-utils:
https://github.com/openshift/test-infra/blob/master/prow/pod-utilities.md

Prep for having OSTree use that.

Closes: #1930
Approved by: jlebon
2019-10-11 21:00:30 +00:00
Alex Kiernan
82699a67db Always enable trivial-httpd for tests
When running tests we always need ostree-trivial-httpd, so enable it
unconditionally

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-10-09 06:04:54 +01:00
Colin Walters
d85366d52a ci: Add prow/ subdirectory with Dockerfile
I'd like to add OpenShift's prow to this repository.  Let's start
by adding a Dockerfile - it doesn't really do anything besides build.

However...I've lately been thinking about e.g. shipping the ostree tests
as an image, and then e.g. we could test FCOS by running that container
(which would orchestrate the *host's* ostree).

Anyways, not doing that right now but this is a start.

Also this cherry picks the fix from rpm-ostree CI for the sad
Fedora release package brokenness.

Closes: #1906
Approved by: cgwalters
2019-08-29 05:43:11 +00:00
Dan Nicholson
cf7fc0eabb ci/rpmostree: Bump to 2019.3
The test-ucontainer.sh test in rpmostree 2019.1 is failing for
non-ostree reasons. This is fixed in [1], which is part of 2019.3. I
believe this is still a relevant test of f29 since that's what's shipped
in f29-updates.

1. 45b6186be0

Closes: #1892
Approved by: jlebon
2019-07-27 03:20:21 +00:00
Robert Fairley
86cf6ba5c5 ci/flatpak: Bump FLATPAK_TAG to 1.4.1
Bump the flatpak version used in CI to avoid a repeated definition of
`renameat2()` in libglnx and glibc.

See: https://github.com/ostreedev/ostree/pull/1871#issuecomment-503768062

Closes: #1871
Approved by: jlebon
2019-06-21 13:17:10 +00:00
Robert Fairley
35cce4972e ci/build-check: Remove unused-command-line-argument diagnostic
Since `clang-4.0` is no longer being used, it should be safe to remove
use of this diagnostic for clang. This enables using `gcc` as a workaround
for `g-ir-scanner`, as `unused-command-line-argument` is not recognized by
`gcc`.

See: https://github.com/ostreedev/ostree/pull/1871#issuecomment-503765624

Closes: #1871
Approved by: jlebon
2019-06-21 13:17:10 +00:00
Robert Fairley
46da9356a7 ci: Use Fedora 29 artifacts
Use Fedora 29 artifacts instead of Fedora 28, since 28 is now
end-of-life.

Also rename `ci/fah28-insttests.sh` -> `ci/fah29-insttests.sh`
and use the https://getfedora.org/atomic_qcow2_latest redirect
URL for the latest Fedora Atomic Host 29 image.

Closes: #1871
Approved by: jlebon
2019-06-21 13:17:10 +00:00
Robert Fairley
1c0933b40c ci: Split out installdeps.sh from build.sh
This script is useful to run individually when setting up a
development environment for OSTree.

Closes: #1865
Approved by: jlebon
2019-05-27 16:07:07 +00:00
Robert Fairley
95d6701fb9 travis: Update to Debian Stretch
Update to Stretch to use updated version of glib2.0. Fixes CI
failure when parsing error output in tests/test-config.sh. See:

https://github.com/ostreedev/ostree/pull/1838#issuecomment-482186680
https://api.travis-ci.org/v3/job/518830164/log.txt

Closes: #1839
Approved by: cgwalters
2019-04-23 06:11:39 +00:00
Colin Walters
6e1588c022 ci/rpmostree: Bump to 2019.1
Should fix the issue that CI broke due to libsolv not being sync'd.

Closes: #1806
Approved by: jlebon
2019-03-01 16:41:09 +00:00
Colin Walters
bb141d38da ci/rpmostree: Fix use of fatal
We're not using libtest, just inline it.

Closes: #1806
Approved by: jlebon
2019-03-01 16:41:09 +00:00
Jonathan Lebon
6e3d4f9054 ci: Bump rpm-ostree tag to 2018.8
2018.7 started failing `test-ucontainer.sh`. I don't have the cycles to
look more deeply into what was going on there, but bumping to 2018.8
fixes it at least. (And of course, it's passing in rpm-ostree too.)

Closes: #1728
Approved by: cgwalters
2018-09-28 19:06:08 +00:00