Skip to content

Commit 9158b65

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. TODO: enable aarch64 tests. 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 778213a commit 9158b65

File tree

7 files changed

+139
-3
lines changed

7 files changed

+139
-3
lines changed

.fmf/version

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

.packit.yaml

+48-2
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,7 +46,7 @@ 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
@@ -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,31 @@ jobs:
6687
project: podman-next
6788
enable_net: true
6889

90+
# Tests on Fedora for main branch PRs
91+
- job: tests
92+
trigger: pull_request
93+
packages: [buildah-fedora]
94+
targets: &fedora_copr_test_targets
95+
- fedora-all-x86_64
96+
tf_extra_params:
97+
environments:
98+
- artifacts:
99+
- type: repository-file
100+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
101+
102+
# Tests on CentOS Stream for main branch PRs
103+
- job: tests
104+
trigger: pull_request
105+
packages: [buildah-centos]
106+
targets: &centos_copr_test_targets
107+
- centos-stream-9-x86_64
108+
- centos-stream-10-x86_64
109+
tf_extra_params:
110+
environments:
111+
- artifacts:
112+
- type: repository-file
113+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
114+
69115
# Sync to Fedora
70116
- job: propose_downstream
71117
trigger: release

plans/main.fmf

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
discover:
2+
how: fmf
3+
4+
execute:
5+
how: tmt
6+
7+
prepare:
8+
- when: distro == centos-stream or distro == rhel
9+
how: shell
10+
script: |
11+
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm --eval '%{?rhel}').noarch.rpm
12+
dnf -y config-manager --set-enabled epel
13+
order: 10
14+
- when: initiator == packit
15+
how: shell
16+
script: |
17+
COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo"
18+
if compgen -G $COPR_REPO_FILE > /dev/null; then
19+
sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE
20+
fi
21+
dnf -y upgrade --allowerasing
22+
order: 20
23+
24+
provision:
25+
how: artemis
26+
hardware:
27+
memory: ">= 16 GB"
28+
cpu:
29+
cores: ">= 4"
30+
threads: ">=8"
31+
disk:
32+
- size: ">= 512 GB"
33+
34+

rpm/buildah.spec

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ or
7979
* save container's root file system layer to create a new image
8080
* delete a working container or an image
8181

82+
# This subpackage is only intended for CI testing.
83+
# Not meant for end user/customer usage.
8284
%package tests
8385
Summary: Tests for %{name}
8486

8587
Requires: %{name} = %{epoch}:%{version}-%{release}
86-
%if %{defined fedora}
88+
%if %{defined bats_epel}
8789
Requires: bats
90+
%else
91+
Recommends: bats
8892
%endif
8993
Requires: bzip2
9094
Requires: podman

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

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
summary: System test
16+
test: bash ./system.sh
17+
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)