Add gating test in tmt

This commit is contained in:
Lukáš Zachar 2026-08-12 16:32:57 +02:00
parent ca254cdd05
commit c89a140bb6
5 changed files with 68 additions and 1 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,6 +1,8 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

25
plan.fmf Normal file
View File

@ -0,0 +1,25 @@
execute:
how: tmt
discover:
- name: same_repo
how: fmf
prepare:
- name: enable crb
how: feature
crb: enabled
- name: Get rid of 'rcmtools' repo and packages installed from there
how: shell
script: |
dnf config-manager --set-disabled rcmtools || true
dnf remove -y brewkoji koji python3-brewkoji python3-defusedxml python3-koji || true
dnf distrosync -y
- name: Update packages
how: shell
script: dnf upgrade -y
- name: rpm_qa
order: 100
how: shell
script: rpm -qa | sort | tee $TMT_PLAN_DATA/rpmqa.txt

View File

@ -0,0 +1,7 @@
test: ./rebuild-hypothesis.sh
require:
- /usr/bin/sphinx-build
- rpm-build
- python3-hypothesis
- python36-devel # there is another python3-devel in buildroot :/
framework: beakerlib

32
tests/rebuild-hypothesis.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlRun "rlFetchSrcForInstalled python3-hypothesis"
rlPhaseEnd
rlPhaseStartTest
rlRun "rpmbuild --rebuild ./python-hypothesis*"
# option -s stores err/out into files in $rlRun_LOG,
# 0th item is latest file
# all such files are cleaned during rlJournalEnd
rlRun -s "rpm -qpR /root/rpmbuild/RPMS/noarch/python3-hypothesis-*"
rlAssertGrep 'python(abi) = 3.6' $rlRun_LOG -F
rlAssertGrep 'python3.6dist(attrs) >= 16.0.0' $rlRun_LOG -F
rlAssertGrep 'python3.6dist(coverage)' $rlRun_LOG -F
rlRun -s "rpm -qpP /root/rpmbuild/RPMS/noarch/python3-hypothesis-*"
rlAssertGrep 'python3-hypothesis' $rlRun_LOG -F
rlAssertGrep 'python3.6dist(hypothesis)' $rlRun_LOG -F
rlAssertGrep 'python3dist(hypothesis)' $rlRun_LOG -F
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd