Skip to content

Commit bd4f773

Browse files
authored
Merge pull request #1629 from lsm5/tmt-c9s-upstreaming
TMT: upstream tests from c9s
2 parents a48818a + ec5947c commit bd4f773

File tree

11 files changed

+336
-74
lines changed

11 files changed

+336
-74
lines changed

.packit.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ packages:
2929
crun-centos:
3030
pkg_tool: centpkg
3131
specfile_path: rpm/crun.spec
32-
crun-rhel:
33-
specfile_path: rpm/crun.spec
3432
crun-eln:
3533
specfile_path: rpm/crun.spec
3634

@@ -79,14 +77,6 @@ jobs:
7977
centos-stream-10-x86_64: {}
8078
centos-stream-10-aarch64: {}
8179

82-
- job: copr_build
83-
trigger: pull_request
84-
packages: [crun-rhel]
85-
notifications: *copr_build_failure_notification
86-
targets:
87-
- epel-9-x86_64
88-
- epel-9-aarch64
89-
9080
# Run on commit to main branch
9181
- job: copr_build
9282
trigger: commit
@@ -124,26 +114,6 @@ jobs:
124114
- type: repository-file
125115
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
126116

127-
# Podman system tests for RHEL
128-
- job: tests
129-
trigger: pull_request
130-
packages: [crun-rhel]
131-
use_internal_tf: true
132-
notifications: *podman_system_test_fail_notification
133-
targets:
134-
epel-9-x86_64:
135-
distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly]
136-
epel-9-aarch64:
137-
distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly]
138-
#TODO: Enable RHEL10 targets once epel-10 copr target is available
139-
tf_extra_params:
140-
environments:
141-
- artifacts:
142-
- type: repository-file
143-
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo
144-
- type: repository-file
145-
id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo
146-
147117
- job: propose_downstream
148118
trigger: release
149119
packages: [crun-fedora]

plans/main.fmf

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,39 @@ discover:
22
how: fmf
33
execute:
44
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+
# FIXME: Use epel10 once bats is available there
14+
- when: distro == centos-stream-10 or distro == rhel-10
15+
because: "bats isn't yet available on epel10"
16+
prepare+:
17+
how: install
18+
copr: rhcontainerbot/bats-el10
19+
package: bats
20+
- when: distro == centos-stream-9 or distro == rhel-9
21+
because: "bats is present on EPEL on rhel9 / c9s"
22+
prepare+:
23+
how: feature
24+
epel: enabled
525

626
/upstream:
727
summary: Run crun specific Podman system tests on upstream PRs
828
discover+:
929
filter: tag:upstream
1030
adjust+:
11-
enabled: false
12-
when: initiator is not defined or initiator != packit
31+
- enabled: false
32+
when: initiator is not defined or initiator != packit
1333

1434
/downstream:
1535
summary: Run crun specific Podman system tests on bodhi / errata and dist-git PRs
1636
discover+:
1737
filter: tag:downstream
1838
adjust+:
19-
enabled: false
20-
when: initiator == packit
39+
- enabled: false
40+
when: initiator == packit

rpm/gating.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
--- !Policy
22
product_versions:
33
- fedora-*
4-
decision_context: bodhi_update_push_stable
4+
decision_context:
5+
- bodhi_update_push_stable
6+
- bodhi_update_push_testing
57
rules:
68
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
79

810
--- !Policy
911
product_versions:
1012
- rhel-*
1113
decision_context: osci_compose_gate
12-
rules: []
14+
rules:
15+
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

tests/tmt/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/tmt/main.fmf

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/tmt/podman-tests.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/tmt/podman/system-test.fmf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require:
2+
- bats
3+
- conmon
4+
- crun
5+
- make
6+
- podman-tests
7+
8+
adjust:
9+
duration: 10m
10+
when: arch == aarch64
11+
12+
/system_test:
13+
tag: [ upstream, downstream ]
14+
summary: Run crun specific Podman tests
15+
test: bash ./system-test.sh

tests/tmt/podman/system-test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -exo pipefail
4+
5+
if [[ "$(id -u)" -ne 0 ]];then
6+
echo "Please run this script as superuser"
7+
exit 1
8+
fi
9+
10+
cat /etc/redhat-release
11+
rpm -q conmon containers-common crun podman podman-tests
12+
13+
# Run crun specific podman tests
14+
bats -t /usr/share/podman/test/system/030-run.bats
15+
bats -t /usr/share/podman/test/system/075-exec.bats
16+
bats -t /usr/share/podman/test/system/280-update.bats

tests/tmt/sanity/config.json

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
{
2+
"ociVersion": "1.0.0",
3+
"process": {
4+
"terminal": false,
5+
"user": {
6+
"uid": 0,
7+
"gid": 0
8+
},
9+
"args": [
10+
"sleep", "10"
11+
],
12+
"env": [
13+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
14+
"TERM=xterm"
15+
],
16+
"cwd": "/",
17+
"capabilities": {
18+
"bounding": [
19+
"CAP_AUDIT_WRITE",
20+
"CAP_KILL",
21+
"CAP_NET_BIND_SERVICE"
22+
],
23+
"effective": [
24+
"CAP_AUDIT_WRITE",
25+
"CAP_KILL",
26+
"CAP_NET_BIND_SERVICE"
27+
],
28+
"inheritable": [
29+
],
30+
"permitted": [
31+
"CAP_AUDIT_WRITE",
32+
"CAP_KILL",
33+
"CAP_NET_BIND_SERVICE"
34+
],
35+
"ambient": [
36+
"CAP_AUDIT_WRITE",
37+
"CAP_KILL",
38+
"CAP_NET_BIND_SERVICE"
39+
]
40+
},
41+
"rlimits": [
42+
{
43+
"type": "RLIMIT_NOFILE",
44+
"hard": 1024,
45+
"soft": 1024
46+
}
47+
],
48+
"noNewPrivileges": true
49+
},
50+
"root": {
51+
"path": "rootfs",
52+
"readonly": true
53+
},
54+
"hostname": "crun",
55+
"mounts": [
56+
{
57+
"destination": "/proc",
58+
"type": "proc",
59+
"source": "proc"
60+
},
61+
{
62+
"destination": "/dev",
63+
"type": "tmpfs",
64+
"source": "tmpfs",
65+
"options": [
66+
"nosuid",
67+
"strictatime",
68+
"mode=755",
69+
"size=65536k"
70+
]
71+
},
72+
{
73+
"destination": "/dev/pts",
74+
"type": "devpts",
75+
"source": "devpts",
76+
"options": [
77+
"nosuid",
78+
"noexec",
79+
"newinstance",
80+
"ptmxmode=0666",
81+
"mode=0620",
82+
"gid=5"
83+
]
84+
},
85+
{
86+
"destination": "/dev/shm",
87+
"type": "tmpfs",
88+
"source": "shm",
89+
"options": [
90+
"nosuid",
91+
"noexec",
92+
"nodev",
93+
"mode=1777",
94+
"size=65536k"
95+
]
96+
},
97+
{
98+
"destination": "/dev/mqueue",
99+
"type": "mqueue",
100+
"source": "mqueue",
101+
"options": [
102+
"nosuid",
103+
"noexec",
104+
"nodev"
105+
]
106+
},
107+
{
108+
"destination": "/sys",
109+
"type": "sysfs",
110+
"source": "sysfs",
111+
"options": [
112+
"nosuid",
113+
"noexec",
114+
"nodev",
115+
"ro"
116+
]
117+
},
118+
{
119+
"destination": "/sys/fs/cgroup",
120+
"type": "cgroup",
121+
"source": "cgroup",
122+
"options": [
123+
"nosuid",
124+
"noexec",
125+
"nodev",
126+
"relatime",
127+
"ro"
128+
]
129+
}
130+
],
131+
"linux": {
132+
"resources": {
133+
"devices": [
134+
{
135+
"allow": false,
136+
"access": "rwm"
137+
}
138+
]
139+
},
140+
"namespaces": [
141+
{
142+
"type": "pid"
143+
},
144+
{
145+
"type": "network"
146+
},
147+
{
148+
"type": "ipc"
149+
},
150+
{
151+
"type": "uts"
152+
},
153+
{
154+
"type": "cgroup"
155+
},
156+
{
157+
"type": "mount"
158+
}
159+
],
160+
"maskedPaths": [
161+
"/proc/acpi",
162+
"/proc/asound",
163+
"/proc/kcore",
164+
"/proc/keys",
165+
"/proc/latency_stats",
166+
"/proc/timer_list",
167+
"/proc/timer_stats",
168+
"/proc/sched_debug",
169+
"/sys/firmware",
170+
"/proc/scsi"
171+
],
172+
"readonlyPaths": [
173+
"/proc/bus",
174+
"/proc/fs",
175+
"/proc/irq",
176+
"/proc/sys",
177+
"/proc/sysrq-trigger"
178+
]
179+
}
180+
}

tests/tmt/sanity/main.fmf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require: [crun, podman]
2+
summary: Sanity test for crun
3+
tag: ['upstream', 'downstream']
4+
test: bash ./runtest.sh
5+
duration: 10m

0 commit comments

Comments
 (0)