Skip to content

Commit

Permalink
[skip-ci] TMT: system tests
Browse files Browse the repository at this point in the history
This commit adds TMT jobs for system tests triggered via Packit for
all active Fedora and CentOS Stream releases on x86_64 and aarch64.

Official Fedora and CentOS Stream spec and gating test configs can be
synced from upstream by Packit, effectively upstreaming almost all
mainteenance.

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Dec 24, 2024
1 parent a1dede8 commit bf833e8
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 3 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
76 changes: 73 additions & 3 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@
downstream_package_name: buildah
upstream_tag_template: v{version}

# These files get synced from upstream to downstream (Fedora / CentOS Stream) on every
# propose-downstream job. This is done so tests maintained upstream can be run
# downstream in Zuul CI and Bodhi.
# Ref: https://packit.dev/docs/configuration#files_to_sync
files_to_sync:
- src: rpm/gating.yaml
dest: gating.yaml
delete: true
- src: plans/
dest: plans/
delete: true
mkpath: true
- src: tests/tmt/
dest: tests/tmt/
delete: true
mkpath: true
- src: .fmf/
dest: .fmf/
delete: true
- .packit.yaml

packages:
buildah-fedora:
pkg_tool: fedpkg
Expand All @@ -25,13 +46,13 @@ jobs:
notifications: &copr_build_failure_notification
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
targets:
targets: &fedora_copr_targets
- fedora-all-x86_64
- fedora-all-aarch64
enable_net: true

- job: copr_build
trigger: pull_request
trigger: ignore
packages: [buildah-eln]
notifications: *copr_build_failure_notification
targets:
Expand All @@ -47,7 +68,7 @@ jobs:
trigger: pull_request
packages: [buildah-centos]
notifications: *copr_build_failure_notification
targets:
targets: &centos_copr_targets
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10-x86_64
Expand All @@ -66,6 +87,55 @@ jobs:
project: podman-next
enable_net: true

- job: tests
trigger: pull_request
packages: [buildah-fedora]
targets: *fedora_copr_targets
require: &dev_tests
label:
absent:
- release
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
identifier: "dev"

- job: tests
trigger: pull_request
packages: [buildah-fedora]
targets: *fedora_copr_targets
require: &release_tests
label:
present:
- release
preserve_project: true
identifier: "release"

# FIXME: Enable centos stream tests after containers-common is fixed
# FIXME: centos stream 10 currently also lacks bats
# https://bugzilla.redhat.com/show_bug.cgi?id=2329315
- job: tests
trigger: pull_request
packages: [buildah-centos]
targets: *centos_copr_targets
require: *dev_tests
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
identifier: "dev"

- job: tests
trigger: pull_request
packages: [buildah-centos]
targets: *centos_copr_targets
require: *release_tests
preserve_project: true
identifier: "release"

# Sync to Fedora
- job: propose_downstream
trigger: release
Expand Down
42 changes: 42 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
discover:
how: fmf
execute:
how: tmt
adjust:
- when: "initiator == packit"
because: "We need to test with updated packages from rhcontainerbot/podman-next copr"
prepare+:
how: shell
script: |
sed -i -n '/^priority=/!p;$apriority=1' /etc/yum.repos.d/*podman-next*.repo
dnf -y upgrade --allowerasing
order: 30
# FIXME: Use epel10 once bats is available there
- when: distro == centos-stream-10 or distro == rhel-10
because: "bats isn't yet available on epel10"
prepare+:
how: install
copr: rhcontainerbot/bats-el10
package: bats
order: 30
- when: distro == centos-stream or distro == rhel
because: "bats is present on EPEL on rhel9 / c9s"
how: feature
epel: enabled
order: 20

/upstream:
summary: Run tests on upstream PRs
discover+:
filter: tag:upstream
adjust+:
- enabled: false
when: revdeps == yes or initiator is not defined or initiator != packit

/downstream:
summary: Run tests on bodhi / errata and dist-git PRs
discover+:
filter: tag:downstream
adjust+:
- enabled: false
when: initiator == packit
16 changes: 16 additions & 0 deletions rpm/gating.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_stable
- bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
18 changes: 18 additions & 0 deletions tests/tmt/system.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require:
- buildah-tests
- git-daemon
- slirp4netns

environment:
BUILDAH_BINARY: /usr/bin/buildah
IMGTYPE_BINARY: /usr/bin/buildah-imgtype
INET_BINARY: /usr/bin/buildah-inet
COPY_BINARY: /usr/bin/buildah-copy
TUTORIAL_BINARY: /usr/bin/buildah-tutorial
TMPDIR: /var/tmp

/local/root:
tag: [ downstream, upstream ]
summary: System test
test: bash ./test.sh
duration: 60m
19 changes: 19 additions & 0 deletions tests/tmt/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -exo pipefail

uname -r

rpm -q \
aardvark-dns \
buildah \
buildah-tests \
conmon \
container-selinux \
containers-common \
containers-common-extra \
crun \
netavark \
systemd

bats /usr/share/buildah/test/system

0 comments on commit bf833e8

Please sign in to comment.