Rework of gating tests

This commit is contained in:
Jan Kurik 2023-08-15 16:02:03 +02:00
parent 858f4d89e8
commit 259dee0f85
8 changed files with 97 additions and 21 deletions

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -4,16 +4,4 @@ product_versions:
decision_context: bodhi_update_push_stable decision_context: bodhi_update_push_stable
subject_type: koji_build subject_type: koji_build
rules: rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/gating.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,6 +1,6 @@
summary: CI Gating Plan summary: CI Gating Plan
discover: discover:
how: fmf how: fmf
directory: tests filter: tag:gating
execute: execute:
how: beakerlib how: tmt

View File

@ -0,0 +1,30 @@
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled = 0
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
[epel-debuginfo]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/debug/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever/Everything/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
gpgcheck=1

View File

@ -0,0 +1,12 @@
summary: Chek for used licenses in packages
test: ./test.sh
link:
- relates: https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1
- relates: https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
recommend:
- rpm-build
- license-validate
- js-d3-flame-graph
duration: 15m
tag:
- gating

View File

@ -0,0 +1,46 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE=js-d3-flame-graph
TCWD="$(pwd)"
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d /var/tmp/XXXXXXXXXXXXX)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
# Get list of rpms
rlFetchSrcForInstalled --quiet "${PACKAGE}" || \
rlDie 'Can not get source package of ${PACKAGE} .... giving up...'
SOURCEPKG=$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE})
rlAssertExists "${tmp}/${SOURCEPKG}"
rlRun "rpm -D '_topdir ${tmp}' -i ${tmp}/${SOURCEPKG}"
rlRun "LICENSES=\"\$(rpm -q --qf '%{license}\n' --specfile ${tmp}/SPECS/${PACKAGE}.spec\
| sed -e 's/ and /\\n/g' -e 's/^ *//' -e 's/ *$//')\""
rlRun "TUPLE=\"\$(rpm -q --qf '%{name} %{license}\n' \
--specfile ${tmp}/SPECS/${PACKAGE}.spec )\""
rlPhaseEnd
while read l; do
rlPhaseStart FAIL "License check of ${l}"
retcode=
rlRun -s "license-validate '${l}'" || retcode=Fail
# Report affected packages
if [[ -n "${retcode}" ]]; then
rlLogInfo "The following packages needs to fix the ${l} license:"
#for p in $(awk "\$0~/${l}/{print \$1;}" <<< "${TUPLE}"); do
for p in $(grep "${l}" <<< "${TUPLE}" | cut -d ' ' -f 1); do
rlLogInfo " - ${p}"
done
fi
rlPhaseEnd
done < <(sort -u <<< "${LICENSES}")
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

View File

@ -1,16 +1,12 @@
summary: Upstream sanity testsuite summary: Upstream sanity testsuite
description: ''
contact:
- Jan Kuřík <jkurik@redhat.com>
component:
- js-d3-flame-graph
test: ./runtest.sh test: ./runtest.sh
framework: beakerlib
recommend: recommend:
- js-d3-flame-graph - js-d3-flame-graph
- nodejs - nodejs
- make - make
- rpm-build - rpm-build
tag:
- gating
duration: 15m duration: 15m
extra-summary: /tools/js-d3-flame-graph/Sanity/upstream-testsuite extra-summary: /tools/js-d3-flame-graph/Sanity/upstream-testsuite
extra-task: /tools/js-d3-flame-graph/Sanity/upstream-testsuite extra-task: /tools/js-d3-flame-graph/Sanity/upstream-testsuite

3
tests/main.fmf Normal file
View File

@ -0,0 +1,3 @@
contact: Jan Kuřík <jkurik@redhat.com>
component: js-d3-flame-graph
framework: beakerlib