Skip to content

Commit e9a0088

Browse files
committed
[skip-ci] TMT: system tests
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]>
1 parent a1dede8 commit e9a0088

File tree

6 files changed

+168
-3
lines changed

6 files changed

+168
-3
lines changed

.fmf/version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.packit.yaml

+73-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@
55
downstream_package_name: buildah
66
upstream_tag_template: v{version}
77

8+
# These files get synced from upstream to downstream (Fedora / CentOS Stream) on every
9+
# propose-downstream job. This is done so tests maintained upstream can be run
10+
# downstream in Zuul CI and Bodhi.
11+
# Ref: https://packit.dev/docs/configuration#files_to_sync
12+
files_to_sync:
13+
- src: rpm/gating.yaml
14+
dest: gating.yaml
15+
delete: true
16+
- src: plans/
17+
dest: plans/
18+
delete: true
19+
mkpath: true
20+
- src: tests/tmt/
21+
dest: tests/tmt/
22+
delete: true
23+
mkpath: true
24+
- src: .fmf/
25+
dest: .fmf/
26+
delete: true
27+
- .packit.yaml
28+
829
packages:
930
buildah-fedora:
1031
pkg_tool: fedpkg
@@ -25,13 +46,13 @@ jobs:
2546
notifications: &copr_build_failure_notification
2647
failure_comment:
2748
message: "Ephemeral COPR build failed. @containers/packit-build please check."
28-
targets:
49+
targets: &fedora_copr_targets
2950
- fedora-all-x86_64
3051
- fedora-all-aarch64
3152
enable_net: true
3253

3354
- job: copr_build
34-
trigger: pull_request
55+
trigger: ignore
3556
packages: [buildah-eln]
3657
notifications: *copr_build_failure_notification
3758
targets:
@@ -47,7 +68,7 @@ jobs:
4768
trigger: pull_request
4869
packages: [buildah-centos]
4970
notifications: *copr_build_failure_notification
50-
targets:
71+
targets: &centos_copr_targets
5172
- centos-stream-9-x86_64
5273
- centos-stream-9-aarch64
5374
- centos-stream-10-x86_64
@@ -66,6 +87,55 @@ jobs:
6687
project: podman-next
6788
enable_net: true
6889

90+
- job: tests
91+
trigger: pull_request
92+
packages: [buildah-fedora]
93+
targets: *fedora_copr_targets
94+
require: &dev_tests
95+
label:
96+
absent:
97+
- release
98+
tf_extra_params:
99+
environments:
100+
- artifacts:
101+
- type: repository-file
102+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
103+
identifier: "dev"
104+
105+
- job: tests
106+
trigger: pull_request
107+
packages: [buildah-fedora]
108+
targets: *fedora_copr_targets
109+
require: &release_tests
110+
label:
111+
present:
112+
- release
113+
preserve_project: true
114+
identifier: "release"
115+
116+
# FIXME: Enable centos stream tests after containers-common is fixed
117+
# FIXME: centos stream 10 currently also lacks bats
118+
# https://bugzilla.redhat.com/show_bug.cgi?id=2329315
119+
- job: tests
120+
trigger: pull_request
121+
packages: [buildah-centos]
122+
targets: *centos_copr_targets
123+
require: *dev_tests
124+
tf_extra_params:
125+
environments:
126+
- artifacts:
127+
- type: repository-file
128+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
129+
identifier: "dev"
130+
131+
- job: tests
132+
trigger: pull_request
133+
packages: [buildah-centos]
134+
targets: *centos_copr_targets
135+
require: *release_tests
136+
preserve_project: true
137+
identifier: "release"
138+
69139
# Sync to Fedora
70140
- job: propose_downstream
71141
trigger: release

plans/main.fmf

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
discover:
2+
how: fmf
3+
execute:
4+
how: tmt
5+
adjust:
6+
- when: "initiator == packit"
7+
because: "We need to test with updated packages from rhcontainerbot/podman-next copr"
8+
prepare+:
9+
how: shell
10+
script: |
11+
sed -i -n '/^priority=/!p;$apriority=1' /etc/yum.repos.d/*podman-next*.repo
12+
dnf -y upgrade --allowerasing
13+
order: 30
14+
# FIXME: Use epel10 once bats is available there
15+
- when: distro == centos-stream-10 or distro == rhel-10
16+
because: "bats isn't yet available on epel10"
17+
prepare+:
18+
how: install
19+
copr: rhcontainerbot/bats-el10
20+
package: bats
21+
order: 30
22+
- when: distro == centos-stream or distro == rhel
23+
because: "bats is present on EPEL on rhel9 / c9s"
24+
how: feature
25+
epel: enabled
26+
order: 20
27+
28+
/upstream:
29+
summary: Run tests on upstream PRs
30+
discover+:
31+
filter: tag:upstream
32+
adjust+:
33+
- enabled: false
34+
when: revdeps == yes or initiator is not defined or initiator != packit
35+
36+
/downstream:
37+
summary: Run tests on bodhi / errata and dist-git PRs
38+
discover+:
39+
filter: tag:downstream
40+
adjust+:
41+
- enabled: false
42+
when: initiator == packit

rpm/gating.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- !Policy
2+
product_versions:
3+
- fedora-*
4+
decision_contexts:
5+
- bodhi_update_push_stable
6+
- bodhi_update_push_testing
7+
subject_type: koji_build
8+
rules:
9+
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
10+
11+
--- !Policy
12+
product_versions:
13+
- rhel-*
14+
decision_context: osci_compose_gate
15+
rules:
16+
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

tests/tmt/system.fmf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require:
2+
- buildah-tests
3+
- git-daemon
4+
- slirp4netns
5+
6+
environment:
7+
BUILDAH_BINARY: /usr/bin/buildah
8+
IMGTYPE_BINARY: /usr/bin/buildah-imgtype
9+
INET_BINARY: /usr/bin/buildah-inet
10+
COPY_BINARY: /usr/bin/buildah-copy
11+
TUTORIAL_BINARY: /usr/bin/buildah-tutorial
12+
TMPDIR: /var/tmp
13+
14+
/local/root:
15+
tag: [ downstream, upstream ]
16+
summary: System test
17+
test: bash ./system.sh
18+
duration: 60m

tests/tmt/system.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -exo pipefail
4+
5+
uname -r
6+
7+
rpm -q \
8+
aardvark-dns \
9+
buildah \
10+
buildah-tests \
11+
conmon \
12+
container-selinux \
13+
containers-common \
14+
crun \
15+
netavark \
16+
systemd
17+
18+
bats /usr/share/buildah/test/system

0 commit comments

Comments
 (0)