[c9s-tmt] TMT: gating tests pulled from upstream

Resolves: RHEL-80816

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar 2025-03-03 15:14:37 +05:30
parent 80791c4ff0
commit 45f69aca59
No known key found for this signature in database
GPG Key ID: 1C1EDD7CC7C3A0DD
10 changed files with 57 additions and 50 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,7 +1,16 @@
# recipients: jnovy, lsm5, santiago
--- !Policy
product_versions:
- rhel-9
- fedora-*
decision_context:
- 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}

20
plans/main.fmf Normal file
View File

@ -0,0 +1,20 @@
discover:
how: fmf
execute:
how: tmt
prepare:
- when: distro == centos-stream or distro == rhel
how: shell
script: |
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm --eval '%{?rhel}').noarch.rpm
dnf -y config-manager --set-enabled epel
order: 10
- when: initiator == packit
how: shell
script: |
COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo"
if compgen -G $COPR_REPO_FILE > /dev/null; then
sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE
fi
dnf -y upgrade --allowerasing
order: 20

View File

@ -66,10 +66,7 @@ registries without the need to pull them
Summary: Tests for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%if %{defined fedora}
Requires: bats
Requires: fakeroot
%endif
Requires: gnupg
Requires: jq
Requires: golang
@ -82,7 +79,8 @@ Requires: squashfs-tools
%description tests
%{summary}
This package contains system tests for %{name}
This package contains system tests for %{name}. Only intended for distro gating
tests. End user / customer usage not supported.
%prep
%if 0%{?branch:1}

10
test/tmt/main.fmf Normal file
View File

@ -0,0 +1,10 @@
require:
- bats
- skopeo-tests
environment:
SKOPEO_BINARY: /usr/bin/skopeo
summary: System test
test: bash ./test.sh
duration: 60m

13
test/tmt/test.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -exo pipefail
uname -r
rpm -q \
bats \
containers-common \
skopeo \
skopeo-tests \
bats /usr/share/skopeo/test/system

View File

@ -1,12 +0,0 @@
---
# Sigh; RHEL8 doesn't have BATS
- name: bats | fetch and unpack tarball
unarchive:
src: https://github.com/bats-core/bats-core/archive/v1.9.0.tar.gz
dest: /root
remote_src: true
- name: bats | install
command: ./install.sh /usr/local
args:
chdir: /root/bats-core-1.9.0

View File

@ -1,14 +0,0 @@
#!/bin/bash -e
# Log program and kernel versions
echo "Important package versions:"
(
uname -r
rpm -qa | egrep 'skopeo|podman|conmon|crun|runc|iptable|slirp|systemd' | sort
) | sed -e 's/^/ /'
# Log environment; or at least the useful bits
echo "Environment:"
env | grep -v LS_COLORS= | sort | sed -e 's/^/ /'
SKOPEO_BINARY=/usr/bin/skopeo bats /usr/share/skopeo/test/system

View File

@ -1,17 +0,0 @@
---
- hosts: localhost
tags: classic
roles:
- role: bats_installed
- role: standard-test-basic
tags:
- classic
- container
required_packages:
- skopeo
- skopeo-tests
tests:
- root-test:
dir: ./
run: ./test_skopeo.sh
timeout: 15m

View File

@ -1 +0,0 @@
- import_playbook: test_skopeo.yml