init FMF CI gating
This commit is contained in:
parent
8bed92113e
commit
67e502ea95
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
20
gating.yaml
Normal file
20
gating.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}
|
6
plans/ci.fmf
Normal file
6
plans/ci.fmf
Normal file
@ -0,0 +1,6 @@
|
||||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
directory: tests
|
||||
execute:
|
||||
how: beakerlib
|
63
tests/boost-testsuite-sanity/Makefile
Normal file
63
tests/boost-testsuite-sanity/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/boost/Sanity/boost-testsuite-sanity
|
||||
# Description: boost testing by upstream testsuite
|
||||
# Author: Michal Kolar <mkolar@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2021 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/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/boost/Sanity/boost-testsuite-sanity
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE tests
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Michal Kolar <mkolar@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: boost testing by upstream testsuite" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 1h" >> $(METADATA)
|
||||
@echo "RunFor: boost" >> $(METADATA)
|
||||
@echo "Requires: boost dnf-utils rpm-build boost-b2" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
3
tests/boost-testsuite-sanity/PURPOSE
Normal file
3
tests/boost-testsuite-sanity/PURPOSE
Normal file
@ -0,0 +1,3 @@
|
||||
PURPOSE of /tools/boost/Sanity/boost-testsuite-sanity
|
||||
Description: boost testing by upstream testsuite
|
||||
Author: Michal Kolar <mkolar@redhat.com>
|
16
tests/boost-testsuite-sanity/main.fmf
Normal file
16
tests/boost-testsuite-sanity/main.fmf
Normal file
@ -0,0 +1,16 @@
|
||||
summary: boost testing by upstream testsuite
|
||||
description: ''
|
||||
contact:
|
||||
- Michal Kolar <mkolar@redhat.com>
|
||||
component:
|
||||
- boost
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- boost
|
||||
- dnf-utils
|
||||
- rpm-build
|
||||
- boost-b2
|
||||
duration: 1h
|
||||
extra-summary: /tools/boost/Sanity/boost-testsuite-sanity
|
||||
extra-task: /tools/boost/Sanity/boost-testsuite-sanity
|
90
tests/boost-testsuite-sanity/runtest.sh
Executable file
90
tests/boost-testsuite-sanity/runtest.sh
Executable file
@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/boost/Sanity/boost-testsuite-sanity
|
||||
# Description: boost testing by upstream testsuite
|
||||
# Author: Michal Kolar <mkolar@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2021 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
|
||||
|
||||
BUILD_USER=${BUILD_USER:-bstbld}
|
||||
TESTS_COUNT_MIN=${TESTS_COUNT_MIN:-100}
|
||||
PACKAGE="boost"
|
||||
REQUIRES="$PACKAGE rpm-build boost-b2"
|
||||
if rlIsFedora; then
|
||||
REQUIRES="$REQUIRES dnf-utils"
|
||||
else
|
||||
REQUIRES="$REQUIRES yum-utils"
|
||||
fi
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlShowRunningKernel
|
||||
rlAssertRpm --all
|
||||
rlRun "TmpDir=`mktemp -d /home/boost.XXXXXXXXXX`" # work in /home due to high demands on disk space
|
||||
rlRun "cp tests $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlFetchSrcForInstalled $PACKAGE
|
||||
rlRun "useradd -M -N $BUILD_USER" 0,9
|
||||
[ "$?" == "0" ] && rlRun "del=yes"
|
||||
rlRun "chown -R $BUILD_USER:users $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartSetup "build boost"
|
||||
rlRun "rpm -D \"_topdir $TmpDir\" -U *.src.rpm"
|
||||
rlRun "dnf builddep -y $TmpDir/SPECS/*.spec"
|
||||
rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER"
|
||||
rlRun "rlFileSubmit $TmpDir/rpmbuild.log"
|
||||
rlRun "cd $TmpDir/BUILD/boost*"
|
||||
rlRun "su -c './bootstrap.sh &>$TmpDir/bootstrap.log' $BUILD_USER"
|
||||
rlRun "rlFileSubmit $TmpDir/bootstrap.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "run testsuite"
|
||||
while read test_path; do
|
||||
if [ -f $TmpDir/BUILD/boost*/libs/$test_path/test/Jamfile* ]; then
|
||||
rlRun "cd $TmpDir/BUILD/boost*/libs/$test_path/test"
|
||||
rlRun "su -c '/usr/bin/b2 -d1 --build-dir=$TmpDir/test-build &>>$TmpDir/testsuite.log' $BUILD_USER"
|
||||
rm -fr $TmpDir/test-build
|
||||
else
|
||||
rlLogInfo "$test_path/Jamfile* not found, skipping"
|
||||
fi
|
||||
done <$TmpDir/tests
|
||||
rlRun "rlFileSubmit $TmpDir/testsuite.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "evaluate results"
|
||||
rlRun "cd $TmpDir"
|
||||
rlRun "grep -E '\.\.\.failed .+$TmpDir/test-build' testsuite.log" 1 "There should be no failure"
|
||||
rlRun "tests_count=\$(grep -E '\*\*passed\*\*.+$TmpDir/test-build' testsuite.log | wc -l)"
|
||||
[ "$tests_count" -ge "$TESTS_COUNT_MIN" ] && rlLogInfo "Test counter: $tests_count" || rlFail "Test counter $tests_count should be greater than or equal to $TESTS_COUNT_MIN"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir"
|
||||
[ "$del" == "yes" ] && rlRun "userdel $BUILD_USER"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
5
tests/boost-testsuite-sanity/tests
Normal file
5
tests/boost-testsuite-sanity/tests
Normal file
@ -0,0 +1,5 @@
|
||||
integer
|
||||
random
|
||||
rational
|
||||
regex
|
||||
timer
|
Loading…
Reference in New Issue
Block a user