Skip to content

Commit

Permalink
Merge pull request #1629 from lsm5/tmt-c9s-upstreaming
Browse files Browse the repository at this point in the history
TMT: upstream tests from c9s
  • Loading branch information
giuseppe authored Dec 30, 2024
2 parents a48818a + ec5947c commit bd4f773
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 74 deletions.
30 changes: 0 additions & 30 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ packages:
crun-centos:
pkg_tool: centpkg
specfile_path: rpm/crun.spec
crun-rhel:
specfile_path: rpm/crun.spec
crun-eln:
specfile_path: rpm/crun.spec

Expand Down Expand Up @@ -79,14 +77,6 @@ jobs:
centos-stream-10-x86_64: {}
centos-stream-10-aarch64: {}

- job: copr_build
trigger: pull_request
packages: [crun-rhel]
notifications: *copr_build_failure_notification
targets:
- epel-9-x86_64
- epel-9-aarch64

# Run on commit to main branch
- job: copr_build
trigger: commit
Expand Down Expand Up @@ -124,26 +114,6 @@ jobs:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo

# Podman system tests for RHEL
- job: tests
trigger: pull_request
packages: [crun-rhel]
use_internal_tf: true
notifications: *podman_system_test_fail_notification
targets:
epel-9-x86_64:
distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly]
epel-9-aarch64:
distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly]
#TODO: Enable RHEL10 targets once epel-10 copr target is available
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo
- type: repository-file
id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo

- job: propose_downstream
trigger: release
packages: [crun-fedora]
Expand Down
28 changes: 24 additions & 4 deletions plans/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,39 @@ 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
# 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
- when: distro == centos-stream-9 or distro == rhel-9
because: "bats is present on EPEL on rhel9 / c9s"
prepare+:
how: feature
epel: enabled

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

/downstream:
summary: Run crun specific Podman system tests on bodhi / errata and dist-git PRs
discover+:
filter: tag:downstream
adjust+:
enabled: false
when: initiator == packit
- enabled: false
when: initiator == packit
7 changes: 5 additions & 2 deletions rpm/gating.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
decision_context:
- bodhi_update_push_stable
- bodhi_update_push_testing
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules: []
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
3 changes: 0 additions & 3 deletions tests/tmt/Makefile

This file was deleted.

13 changes: 0 additions & 13 deletions tests/tmt/main.fmf

This file was deleted.

22 changes: 0 additions & 22 deletions tests/tmt/podman-tests.sh

This file was deleted.

15 changes: 15 additions & 0 deletions tests/tmt/podman/system-test.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require:
- bats
- conmon
- crun
- make
- podman-tests

adjust:
duration: 10m
when: arch == aarch64

/system_test:
tag: [ upstream, downstream ]
summary: Run crun specific Podman tests
test: bash ./system-test.sh
16 changes: 16 additions & 0 deletions tests/tmt/podman/system-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -exo pipefail

if [[ "$(id -u)" -ne 0 ]];then
echo "Please run this script as superuser"
exit 1
fi

cat /etc/redhat-release
rpm -q conmon containers-common crun podman podman-tests

# Run crun specific podman tests
bats -t /usr/share/podman/test/system/030-run.bats
bats -t /usr/share/podman/test/system/075-exec.bats
bats -t /usr/share/podman/test/system/280-update.bats
180 changes: 180 additions & 0 deletions tests/tmt/sanity/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"ociVersion": "1.0.0",
"process": {
"terminal": false,
"user": {
"uid": 0,
"gid": 0
},
"args": [
"sleep", "10"
],
"env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm"
],
"cwd": "/",
"capabilities": {
"bounding": [
"CAP_AUDIT_WRITE",
"CAP_KILL",
"CAP_NET_BIND_SERVICE"
],
"effective": [
"CAP_AUDIT_WRITE",
"CAP_KILL",
"CAP_NET_BIND_SERVICE"
],
"inheritable": [
],
"permitted": [
"CAP_AUDIT_WRITE",
"CAP_KILL",
"CAP_NET_BIND_SERVICE"
],
"ambient": [
"CAP_AUDIT_WRITE",
"CAP_KILL",
"CAP_NET_BIND_SERVICE"
]
},
"rlimits": [
{
"type": "RLIMIT_NOFILE",
"hard": 1024,
"soft": 1024
}
],
"noNewPrivileges": true
},
"root": {
"path": "rootfs",
"readonly": true
},
"hostname": "crun",
"mounts": [
{
"destination": "/proc",
"type": "proc",
"source": "proc"
},
{
"destination": "/dev",
"type": "tmpfs",
"source": "tmpfs",
"options": [
"nosuid",
"strictatime",
"mode=755",
"size=65536k"
]
},
{
"destination": "/dev/pts",
"type": "devpts",
"source": "devpts",
"options": [
"nosuid",
"noexec",
"newinstance",
"ptmxmode=0666",
"mode=0620",
"gid=5"
]
},
{
"destination": "/dev/shm",
"type": "tmpfs",
"source": "shm",
"options": [
"nosuid",
"noexec",
"nodev",
"mode=1777",
"size=65536k"
]
},
{
"destination": "/dev/mqueue",
"type": "mqueue",
"source": "mqueue",
"options": [
"nosuid",
"noexec",
"nodev"
]
},
{
"destination": "/sys",
"type": "sysfs",
"source": "sysfs",
"options": [
"nosuid",
"noexec",
"nodev",
"ro"
]
},
{
"destination": "/sys/fs/cgroup",
"type": "cgroup",
"source": "cgroup",
"options": [
"nosuid",
"noexec",
"nodev",
"relatime",
"ro"
]
}
],
"linux": {
"resources": {
"devices": [
{
"allow": false,
"access": "rwm"
}
]
},
"namespaces": [
{
"type": "pid"
},
{
"type": "network"
},
{
"type": "ipc"
},
{
"type": "uts"
},
{
"type": "cgroup"
},
{
"type": "mount"
}
],
"maskedPaths": [
"/proc/acpi",
"/proc/asound",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/sys/firmware",
"/proc/scsi"
],
"readonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
}
}
5 changes: 5 additions & 0 deletions tests/tmt/sanity/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require: [crun, podman]
summary: Sanity test for crun
tag: ['upstream', 'downstream']
test: bash ./runtest.sh
duration: 10m
Loading

0 comments on commit bd4f773

Please sign in to comment.