Commit Graph

66 Commits

Author SHA1 Message Date
Miloslav Trmač 3748cda03b Also run integration tests with the Sequoia backend
This extra test run is temporary; it should be removed after
rust-podman-sequoia makes it to a stable Fedora release.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2025-09-30 21:42:51 +02:00
Nalin Dahyabhai f8f398bb3c Run with --device /dev/fuse and not just -v /dev/fuse:/dev/fuse
When passing /dev/fuse to a container, use --device instead of a plain
volume mount.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-17 09:22:47 -04:00
Nalin Dahyabhai a9a9a43962 CI: pass $BUILDAH_RUNTIME through to in-container test runs
Pass BUILDAH_RUNTIME through to tests that we run inside of containers,
and discard the CI_DESIRED_RUNTIME variable, which sort of did the same
thing.  We still set OCI to the name of the runtime because tests
consult it directly.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-17 09:22:14 -04:00
Nalin Dahyabhai b97fd7d686 CI: ensure rootless groups aren't duplicates
When adding an unprivileged user to run tests as, ensure that the
primary and supplemental groups are not repeated, and that at least one
supplemental group is outside of the user's subgid range.  When skipping
a test because the invoking user doesn't have any supplemental groups,
log the user's IDs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-17 09:18:47 -04:00
Nalin Dahyabhai 9ecc98e584 CI: give the rootless test user some supplemental groups
Exercise preservation of supplemental groups in the tests that use
`buildah build` and `buildah from` with `--group-add keep-groups`.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-13 10:32:33 -04:00
flouthoc 147a3ca916
.cirrus: run -race only on non-PR branch
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-05 06:57:14 -08:00
Nalin Dahyabhai 282cc38c39 `make lint`: use --timeout instead of --deadline
Updated linters use `--timeout` instead of `--deadline`.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-07 10:10:35 -04:00
Ed Santiago 3ad0fd1ed1 CI: use local registry, part 2 of 2
Make tests pass when using a local cache registry (as triggered
by $CI_USE_REGISTRY_CACHE being non-empty).

Mostly just change images: consolidate to a smaller set, like,
replace the few instances of debian with ubuntu, use $SAFEIMAGE
where we can.

The most significant change was with some s1 (schema 1?) images.
Those exist on quay, but cannot be mirrored locally: the local
registry forbids schema 1 images. I choose to skip these tests
when running against a local registry.

Second most significant change is running containerized tests
with --net=host. We need this to access the registry running
on a localhost port. (One alternative would be to bind the
registry on all interfaces, cringe, then perform sed magic
on the registries-cache.conf file changing 127.0.0.1 to
host.containers.internal, more cringe).

Also, some cleanup.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 12:26:49 -06:00
Ed Santiago 52df6e0e0f CI: use local registry, part 1 of 2
As of https://github.com/containers/automation_images/pull/357
our CI VMs include a local registry preloaded with all(*)
images used in tests.

 * where "all" means "most".

This commit defines a new registries-cached.conf, used in tests,
that redirects docker and quay to the new local registry. The
hope is that this will reduce CI flakes.

Since tests change over time, and new tests may require new
images, this commit also adds a mechanism for pulling in
remote images at test run time. Obviously this negates
the purpose of the cache, since it introduces a flake
pain point. The idea is: DO NOT DO THIS UNLESS ABSOLUTELY
NECESSARY, and then, if we have to do this, hurry up and
spin new CI VMs that include the new image(s).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 12:09:54 -06:00
Nalin Dahyabhai 0569f3728a Cirrus: run `df` during job setup
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-06-07 11:32:12 -04:00
Chris Evich 239b2a877a
Cirrus: container/rootless env. var. passthrough
Fixes: https://github.com/containers/buildah/issues/4838

Resolve a long-standing TODO item (and bug fix apparently) relating to
passing important env. var. values into special testing contexts.
Namely container-based and rootless testing.  These changes mostly come
from the (now battle-tested) work by @edsantiago in the podman CI
scripts.  Some podman-CI specific variables have been stripped out, and
other buildah-specific simplifications made.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-08-02 10:57:21 -04:00
Chris Evich 65c1c9327a
Cirrus: Remove duplicate env. var. definitions
These are pre-defined by the common automation library sourced near the
top of the file.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-08-01 15:45:39 -04:00
Chris Evich a630e35131
CI: Support testing w/ podman-next COPR packages
Sometimes important updates need to be made to dependent packages and
run through CI w/o waiting for package release and new CI VM image
builds.  Support this in buildah CI as in podman CI, by updating
packages during setup when the magic string is present and PR is in
draft-mode.

Note: To support containerized testing, both `CIRRUS_CHANGE_TITLE`
and `CIRRUS_PR_DRAFT` env. vars. are passed through.  For these tasks,
this will result in **TWO** updates - One for the host, and another one
in the container.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-06-01 14:06:16 -04:00
Ed Santiago d58d3a14be Revert "Proof of concept: nightly dependency treadmill"
No longer needed: this functionality is now done by renovatebot.

The nightly cron job has been deleted.

This reverts commit 899ecaaf74.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-17 09:32:14 -06:00
Chris Evich bc2423ebcb
Cirrus: Replace Ubuntu -> Debian SID
Signed-off-by: Chris Evich <cevich@redhat.com>
2023-03-14 17:18:34 -04:00
Ed Santiago 899ecaaf74 Proof of concept: nightly dependency treadmill
As discussed in f2f: this is the cleanest, simplest mechanism
I can think of to auto-test the Big Three dependencies: simply
run go mod edit immediately after git checkout, then run the
entire CI test suite.

If this approach works, we can set up a new CIRRUS_CRON=treadmill job.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-27 13:33:06 -06:00
Giuseppe Scrivano 02d4a6b5f2
test: run in the host cgroup namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-21 13:45:41 +02:00
Chris Evich cc5e80f6de
Cirrus: Update CI VMs to F36
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-28 10:37:33 -04:00
Aditya R 5eccef1482
cirrus: add seperate task and matrix for rootless
Split rootless testing into its own cirrus task and do not merge it with
existing rootless tests.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-08 15:08:12 +05:30
Aditya R 165e984b50
buildah: test rootless integration
Add cirrus boiler plate for rootless testing infrastructure.
Following commit introduces only neccassary foundation and skeleton
which will be used by rootless testing of buildah.

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-08 14:57:43 +05:30
Chris Evich 0b3e75a23c
Cirrus: Bump up to Fedora 35 & Ubuntu 21.10
The Fedora 35 cloud images have switched to UEFI boot with a GPT
partition. Formerly, all Fedora images included support for runtime
re-partitioning. However, the requirement to test alternate storage
has since been dropped/removed.  Rather than maintain a disused
feature, and supporting scripts, these Fedora VM images have reverted
to the default: Automatically resize to 100% on boot.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 14:07:50 -05:00
Chris Evich 6542126b9d
Cirrus: Fix defunct package metadata breaking cache
During VM image build, a number of packages are downloaded but not
installed, since they may interfere with some testing.  Then at runtime,
where required, the packages are installed from cache and used.
However, between image build and runtime it's possible the repository
contents change, which will invalidate the package cache.  Since the
`--no-download --ignore-missing` options were used, the install will
fail.

Ref: https://github.com/containers/automation_images/issues/95

Fortunately, when it comes to the docker packages, no other dependencies
are required and so `apt-get` isn't required.  Switch to using a simple
dpkg install command on the necessary files.  If this ever breaks due
to new dependencies, the list of files may simply be updated.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-10-01 15:39:32 -04:00
Chris Evich 1156cf0759
Update VM Images + Drop prior-ubuntu testing
These images contain a workaround for:
     https://github.com/containers/podman/issues/11123

Ref: https://github.com/containers/podman/issues/11070
     https://github.com/containers/automation_images/pull/88

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-15 14:28:53 -04:00
Valentin Rothberg fbd99d001d vendor containers/common@main
The `IgnorePlatform` options has been removed from the
`LookupImageOptions` in libimage to properly support multi-arch images.
Buildah always set it to true.

Also temporarily remove /usr/share/containers/containers.conf.  c/common
is now throwing warnings when facing unknown keys which unfortunately is
the case with the upstream containers.conf and ultimately breaks CI
since some output checks are failing.

Once an updated containers.conf has been shipped, we can revert the
change.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-07 13:28:20 +02:00
Chris Evich eff2bd2cd1
Cirrus: Install docker from package cache
Installing packages at runtime (from an external source) is problematic
for many reasons.  Specifically in the case of buildah/docker
conformance testing, it means the current "latest" pacakges are
always installed.  This is a problem as new release branches are
created, because it presents an opportunity for test-environment changes
to happen after buildah/test code is stabilized.

Fix this by using new/special VM images which cache the required docker
packages.  At runtime then, the required packages may be installed from
this cache instead of reaching out to the repository.  Since images used
by tests on release branches never change, this will also serve to
stabilize the package versions for that specific environment.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-06-29 11:01:27 -04:00
Daniel J Walsh 65048c85d0
codespell cleanup
[NO TESTS NEEDED] Only code cleanup

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-05 15:56:04 -04:00
Chris Evich 174cf8963f
Cirrus: Update Ubuntu images to 21.04
Also simplify `lib.sh` after supporting changes incorporated
into automation library 2.x+ (present in all VM and container
images).

* No need to force-load `/etc/profile` and handle it's expectation
  to **not** being in `errexit` mode.
* Slightly re-arrange loading of automation library files for
  clarity.
* Remove dependency on updating `/etc/environment` for GPG.
* Remove redundant showrun() function (now present in automation
  library)
* Update comments.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-26 14:15:12 -04:00
Chris Evich d46d84e0db
Cirrus: Make use of shared get_ci_vm container
Depends on:
    https://github.com/containers/automation_images/pull/57
    https://github.com/containers/automation/pull/64
    https://github.com/containers/automation/pull/66
    https://github.com/containers/automation/pull/67
    https://github.com/containers/automation/pull/68

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-05 13:19:57 -04:00
Chris Evich 998f98efe3
Cirrus: Native OSX Build
These changes execute the cross-compile build naively on an OSX VM to
more thoroughly verify multi-platform support (other than on Linux). In
other words, it better confirms that any Linux-only changes do not leak
into non-Linux environments.  This change also enables greatly
simplifying automation scripts, as there is no longer any need to
support/check the `$CROSS_TARGET` variable.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-21 09:41:19 -05:00
Chris Evich e7e1728b46
Cirrus: Two minor cleanup items
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-21 09:41:18 -05:00
Chris Evich bc9c02f68d
Cirrus: Support new VM Images in get_ci_vm.sh
Due to necessary changes in both scripts and within images, updates are
necessary for this script to function.  These changes also bring
the script very close to being identical to the same in the
containers/podman repository.  The intent is to support a future
where this script can simply be shared across repos.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-12 16:26:43 -05:00
Chris Evich 5672097146
Cirrus: Make tests pass with new VM Images
Also, utilize the common library functions from containers/automation.
This library is now pre-installed into the VM images. There are some
minor API differences to a few frequently used functions.  Otherwise
the behaviors are largely identical.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-12 16:26:43 -05:00
Chris Evich f4553e7c09
Cirrus: Collect cri-o-runc version
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-12 16:26:42 -05:00
Chris Evich 69d4542b7e
Cirrus: Track libseccomp and golang version
The versions of these packages on Fedora/Ubuntu are important/relevant
for testing, make them easy to observe.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-05 12:00:13 -05:00
OpenShift Merge Robot ffef8a6c0b
Merge pull request #2864 from jsoref/spelling
Spelling
2020-12-23 17:04:31 +01:00
Josh Soref c7963db369 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-21 16:47:18 -05:00
Daniel J Walsh 18f3e8724e
Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-18 06:37:59 -05:00
dependabot-preview[bot] 063a6533e7
build(deps): bump github.com/containers/storage from 1.24.2 to 1.24.3
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.24.2 to 1.24.3.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.24.2...v1.24.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-16 15:47:16 -05:00
Chris Evich 6a01461f79
Cirrus: Fix validate commit epoch
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-15 14:20:17 -04:00
Nalin Dahyabhai 13fda9e342 contrib/cirrus/lib.sh: don't use CN for the hostname
When generating a certificate to be used by a registry server that we're
bringing up, instead of setting a CN value in the subject name to
"localhost" to pass the name check that a client makes, use a subject
alternative name extension.

The "compare the hostname we're given with a CN from the subject name
field" method stops working if the client is built with Go 1.15.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-08 12:21:03 -04:00
Nalin Dahyabhai 1799dfc47e CI: expand cross-compile checks
Expand the list of OS/arch combinations we check when we're checking if
we can successfully be cross-compiled, and fix up a couple of places
that wouldn't pass otherwise.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-03 14:35:32 -04:00
Nalin Dahyabhai 52c07811f3 in_podman: don't get tripped up by $CIRRUS_CHANGE_TITLE
We don't handle passing environment values that contain whitespace
through to tests that we run inside of podman, so we need to screen out
$CIRRUS_CHANGE_TITLE from the list of variables we try to pass in via
the command line.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-19 16:23:49 -04:00
Nalin Dahyabhai 92e0c3fdcf Rework conformance testing
Move the conformance tests from ginkgo to using the default testing
package and github.com/stretchr/testify/require, preserving the existing
tests and adding more.

Add conformance tests to our Cirrus configuration, currently marked as
an allowed failure.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-23 15:30:58 -04:00
Nalin Dahyabhai d992ade363 build.sh: log the version of Go that we're using
Have contrib/cirrus/build.sh run `go version` and `go env`, to make it
easier to diagnose build problems that might be specific to the version
of go that we're using for the build test.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-20 23:33:44 -04:00
Ed Santiago 2ccd8751d4 tests: add auth tests
Add authentication tests using local registry:
 - add output string checking wherever possible; this
   caught a bug in the old tests, a command that was
   failing due to a typo instead of the expected way.

 - new --tls-verify=true tests, if $BUILDAH_AUTHDIR is
   defined by caller. For Cirrus CI, that's hardcoded
   as $HOME/auth and too tricky to change. For Fedora
   and RHEL gating tests, this will require further
   changes beyond the scope of this PR.

 - new buildah-login tests, positive and negative, using
   local registry

Also:
 - remove unused tests in from.bats

 - add "authenticate: " prefix to all tests in that file,
   to make it easier for viewer to find the test source file.

 - do not copy autogenerated certs to /etc/certs.d - doing so
   defeats the purpose of testing --tls-verify={true,false}

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-07-08 09:24:07 -06:00
Daniel J Walsh b4449c693c
Switch scripts to use containers.conf
Podman no longer uses libpod.conf and has switched to containers.conf.
This change will cause podman to use crun by default, by creating a
/etc/containers/containers.conf file

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-04 07:15:50 -04:00
Chris Evich 8a4646d584
Cirrus: Fix missing htpasswd in registry img
Recently the registry image was updated significantly with breaking
changes.  Most were caught, this one was not.  Instead of relying on the
(clearly) unreliable container image, simply install the package
providing the htpasswd command locally.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-06-30 09:08:24 -04:00
Wong Hoi Sing Edison 3a122aa3c8
Add nix derivation for static builds
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
2020-06-18 19:19:21 +08:00
Chris Evich df51162765
Cirrus: Fixes from review feedback
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-04 11:45:14 -04:00
Chris Evich 278fb818c4
Cirrus: Use pre-installed VM packages + F32
All packages required for building + testing buildah are now included in
VM images shared withthe libpod project's CI system.  Remove former
`setup.sh` and `lib.sh` facilities for installing/updating packages.
Also add in a new function for removing the pre-installed buildah
package files (since we run and test from source).  This mirrors
the same behavior used in libpod's CI setup.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 13:26:09 -04:00