Gating configuration for c10s
Setup of gating configuration for c10s/rhel-10 Modification of gating plan to select specific tests from Fedora Removal of redundant tests from the repo
This commit is contained in:
parent
9f22768f61
commit
81afc9ee9a
@ -1,7 +1,7 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
- rhel-10
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/gating.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build./plans/gating.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/gating.functional}
|
||||
|
||||
@ -2,5 +2,6 @@ summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
filter: tag:gating
|
||||
url: https://src.fedoraproject.org/rpms/HdrHistogram_c
|
||||
execute:
|
||||
how: tmt
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
|
||||
for backward compatibility with traditional beakerlib test harness in RHEL.
|
||||
@ -1,30 +0,0 @@
|
||||
[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
|
||||
@ -1,17 +0,0 @@
|
||||
summary: Check 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:
|
||||
- HdrHistogram_c
|
||||
- rpm-build
|
||||
- license-validate
|
||||
duration: 15m
|
||||
tag:
|
||||
- gating
|
||||
enabled: true
|
||||
adjust:
|
||||
- enabled: false
|
||||
continue: false
|
||||
when: distro < rhel-10
|
||||
@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE=HdrHistogram_c
|
||||
TCWD="$(pwd)"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "tmp=\$(mktemp -d /var/tmp/XXXXXXXXXXXXX)" 0 "Create tmp directory"
|
||||
rlRun "pushd $tmp"
|
||||
rlRun "set -o pipefail"
|
||||
|
||||
# Ensure we have license tools available
|
||||
EPELREPO=
|
||||
if ! which license-fedora2spdx &>/dev/null; then
|
||||
YUMPARAM=
|
||||
if rlIsRHEL || rlIsCentOS; then
|
||||
EPELREPO="/etc/yum.repos.d/$(basename ${tmp})"
|
||||
rlRun "cp ${TCWD}/epel.repo ${EPELREPO}"
|
||||
YUMPARAM="--enablerepo=epel"
|
||||
else
|
||||
rlDie "Can not find license-validate tool"
|
||||
fi
|
||||
rlRun "yum install -y ${YUMPARAM} license-validate" \
|
||||
|| rlDie "Failed to install license-validate tool"
|
||||
fi
|
||||
|
||||
# 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"
|
||||
rlRun "yum clean metadata"
|
||||
[[ -n "${EPELREPO}" ]] && rlRun "rm -f ${EPELREPO}"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
@ -1,14 +0,0 @@
|
||||
summary: Install, build and run upstream test
|
||||
test: ./runtest.sh
|
||||
recommend:
|
||||
- HdrHistogram_c
|
||||
- make
|
||||
- cmake
|
||||
- gcc
|
||||
- gcc-c++
|
||||
- rpm-build
|
||||
duration: 15m
|
||||
tag:
|
||||
- gating
|
||||
extra-summary: /tools/HdrHistogram_c/Sanity/sanity-test
|
||||
extra-task: /tools/HdrHistogram_c/Sanity/sanity-test
|
||||
@ -1,95 +0,0 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/HdrHistogram_c/Sanity/sanity-test
|
||||
# Description: Installs and builds HdrHistogram_c, then runs minimal upstream testsuite.
|
||||
# Author: Jan Kuřík <jkurik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2020 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="HdrHistogram_c"
|
||||
BUILD_USER=${BUILD_USER:-hdrbuild}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Get source code and setup build environment"
|
||||
rlFetchSrcForInstalled "${PACKAGE}" \
|
||||
|| rlDie "Can not download SRPM of ${PACKAGE} - giving up"
|
||||
rlRun "yum-builddep -y \
|
||||
$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE}.$(arch))" \
|
||||
|| rlDie "Can not install build dependencies - giving up"
|
||||
rlRun "useradd -m -N $BUILD_USER" 0,9 && del="yes"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Build ${PACKAGE}'s upstream testsuite"
|
||||
rlRun "rpm -D \"_topdir ${TmpDir}\" -U \
|
||||
$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE}.$(arch))"
|
||||
rlRun "chown -R ${BUILD_USER}:users ${TmpDir}"
|
||||
rlRun -s "su -c \
|
||||
'rpmbuild -D \"_topdir ${TmpDir}\" -bc ${TmpDir}/SPECS/${PACKAGE}.spec' \
|
||||
${BUILD_USER}" 0-255
|
||||
rlFileSubmit "${rlRun_LOG}" "rpmbuild-${PACKAGE}.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Run upstream testsuite"
|
||||
BDIR=$(rpm -q --qf '%{name}-%{version}' ${PACKAGE}.$(arch))
|
||||
ARCHDIR="$(arch)-redhat-linux-gnu"
|
||||
if [[ -d "${TmpDir}/BUILD/${BDIR}/${ARCHDIR}" ]]; then
|
||||
# RHEL-9 builds
|
||||
WD="${TmpDir}/BUILD/${BDIR}/${ARCHDIR}/test"
|
||||
else
|
||||
# RHEL-8 builds
|
||||
WD="${TmpDir}/BUILD/${BDIR}/test"
|
||||
fi
|
||||
HDRLIB="$(ls -1 /usr/lib64/libhdr_histogram.so.[0-9]|head -1)"
|
||||
if rlRun "pushd ${WD}"; then
|
||||
rlRun "sed -i \
|
||||
's#\s\S*libhdr_histogram\S*\.a# ${HDRLIB}#g' \
|
||||
\$(find . -name link.txt)"
|
||||
rlRun -s "make clean all test"
|
||||
rlAssertGrep "100% tests passed" "${rlRun_LOG}"
|
||||
rlRun "popd"
|
||||
else
|
||||
rlFail "Error accessing ${WD} directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
if [[ "${del}" == "yes" ]]; then
|
||||
rlRun "pkill --signal SIGTERM -u ${BUILD_USER}" 0-255
|
||||
sleep 3
|
||||
rlRun "pkill --signal SIGKILL -u ${BUILD_USER}" 0-255
|
||||
sleep 1
|
||||
rlRun "userdel -rf ${BUILD_USER}" 0-255
|
||||
fi
|
||||
rlRun "popd"
|
||||
rlRun "rm -r ${TmpDir}" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@ -1,3 +0,0 @@
|
||||
contact: Jan Kuřík <jkurik@redhat.com>
|
||||
component: HdrHistogram_c
|
||||
framework: beakerlib
|
||||
Loading…
Reference in New Issue
Block a user