From c89a140bb68b3e8462670da726033ab17a91b667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Wed, 12 Aug 2026 16:32:57 +0200 Subject: [PATCH] Add gating test in tmt --- .fmf/version | 1 + gating.yaml | 4 +++- plan.fmf | 25 +++++++++++++++++++++++++ tests/rebuild-hypothesis.fmf | 7 +++++++ tests/rebuild-hypothesis.sh | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .fmf/version create mode 100644 plan.fmf create mode 100644 tests/rebuild-hypothesis.fmf create mode 100755 tests/rebuild-hypothesis.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml index eb7c84f..d74bf08 100644 --- a/gating.yaml +++ b/gating.yaml @@ -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} + diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..5975f7e --- /dev/null +++ b/plan.fmf @@ -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 + diff --git a/tests/rebuild-hypothesis.fmf b/tests/rebuild-hypothesis.fmf new file mode 100644 index 0000000..e6ec5b2 --- /dev/null +++ b/tests/rebuild-hypothesis.fmf @@ -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 diff --git a/tests/rebuild-hypothesis.sh b/tests/rebuild-hypothesis.sh new file mode 100755 index 0000000..8091a87 --- /dev/null +++ b/tests/rebuild-hypothesis.sh @@ -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