tests: switch to upstream tests from fedora repo

This commit is contained in:
Miloš Prchlík 2023-08-29 15:51:30 +02:00 committed by Miloš Prchlík
parent e3f989747f
commit b5dd44ebce
8 changed files with 14 additions and 490 deletions

View File

@ -13,4 +13,3 @@ rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}

View File

@ -2,29 +2,24 @@
# Build/PR gating tests for binutils
#
summary: binutils tests for build/PR gating
/common:
plan:
import:
url: https://src.fedoraproject.org/tests/binutils.git
ref: main
name: /plans/build-gating/common
adjust:
/kernel-rebuild:
plan:
import:
url: https://src.fedoraproject.org/tests/binutils.git
ref: main
name: /plans/build-gating/kernel-rebuild
adjust+:
- because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR."
when: >-
trigger is defined
and trigger != commit
and trigger != build
enabled: false
- because: "CRB and Buildroot repositories must be enabled for various BuildRequires"
when: distro == rhel-9
prepare+:
- how: shell
script: dnf config-manager --set-enabled rhel-CRB
# This is probably not needed anymore.
# - how: shell
# script: dnf config-manager --set-enabled rhel-Buildroot
discover:
how: fmf
filter: "tag:gate-build"
execute:
how: tmt

View File

@ -1,64 +0,0 @@
summary: Check whether newly built kernel boots correctly
description: |
Rebuild kernel, install it, reboot, and check if we're running the correct
kernel. Tailored specificaly for binutils buildroot testing process.
A strong machine is recommended:
- kernel rebuild is very resoruce-intensive task, and having more powerful
boxes for it is simply good,
- this task will get its own boxes, not clobbered by additional kernel packages
that are usually installed by other tasks in the same run. E.g.kernel-debuginfo,
when installed, will conflict with freshly build kernel packages. This should
workaround such situations,
- this tasks reboots its boxes - should such reboot break something, don't ruin
the whole run by it, right?
Based on gcc/Sanity/rebuild-kernel by:
Author: Michal Nowak <mnowak@redhat.com>
Author: Marek Polacek <polacek@redhat.com>
contact:
- Milos Prchlik <mprchlik@redhat.com>
component:
- gcc-toolset-13-binutils
tag:
- gate-build
test: ./runtest.sh
framework: beakerlib
require:
- gcc-toolset-13-binutils
- gcc
- yum-utils
- rng-tools
- rpm-build
- newt-devel
- python-devel
- perl-ExtUtils-Embed
- unifdef
- elfutils-libelf-devel
- elfutils-devel
- pciutils-devel
- wget
- hmaccalc
- binutils-devel
- glibc-static
- texinfo
- gdb
- ecj
- graphviz
- gmp-devel
- mpfr-devel
- xmlto
- asciidoc
- net-tools
duration: 20h
adjust:
- because: "pesign is available for some architectures only"
when: distro == rhel and arch != ppc64le and arch != s390x
require+:
- pesign
# Dropping TCMS integration, these links should not be needed anymore.
# extra-summary: /tools/binutils/Sanity/rebuild-kernel-and-reboot
# extra-task: /tools/binutils/Sanity/rebuild-kernel-and-reboot

View File

@ -1,180 +0,0 @@
#!/bin/bash
# Copyright (c) 2009, 2012 Red Hat, Inc. All rights reserved.
#
# 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 3 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/>.
#
# Rebuild kernel, install it, reboot, and check if we're running the correct
# kernel. Tailored specificaly for binutils buildroot testing process.
#
# Author: Milos Prchlik <mprchlik@redhat.com>
#
# Based on gcc/Sanity/rebuild-kernel by:
# Author: Michal Nowak <mnowak@redhat.com>
# Author: Marek Polacek <polacek@redhat.com>
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
export AVC_ERROR='+no_avc_check'
case "$JUST_BUILD" in
0|[Ff][Aa][Ll][Ss][Ee]|[Nn][Oo])
JUST_BUILD=no
;;
*)
JUST_BUILD=yes
;;
esac
PACKAGES="${PACKAGES:-gcc-toolset-13-binutils}"
# Kernel package - usualy "kernel", but some trees may use different package
# name (e.g. kernel-PAE).
KERNEL="${KERNEL:-kernel}"
REQUIRES="${REQUIRES:-$KERNEL gcc glibc}"
RPM_BUILD_ID="${RPM_BUILD_ID:-.LimeKitten}"
# Workaround possible restraint issues - restraint may fail to set REBOOTCOUNT properly.
REBOOT_FLAG=/.rebuild-kernel-and-reboot.flag
REBOOTCOUNT="${REBOOTCOUNT:-0}"
unset ARCH
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "LD=$LD"
rlLogInfo "GCC=$GCC"
rlLogInfo "KERNEL=$KERNEL"
rlLogInfo "JUST_BUILD=$JUST_BUILD"
# We'll use a lot of disk space (tens of GBs at least). The root FS
# often is the most beefy one in CI environemnts. Let's use it but also
# let's log what's actually available.
export TMPDIR=/test_tmp_root
rlRun "mkdir -p $TMPDIR"
rlLogInfo "TMPDIR=$TMPDIR"
rlLogInfo 'Disk space:'
df -h | while read line; do
rlLogInfo " $line"
done
rlAssertRpm --all
rlRun "AFTER_REBOOT=no"
if [ "$REBOOTCOUNT" != "0" ]; then
rlLogInfo "Reboot count envvar is non-zero, update our flag"
rlRun "AFTER_REBOOT=yes"
elif [ -f "$REBOOT_FLAG" ]; then
rlLogInfo "FS reboot flag exists, update our flag"
rlRun "AFTER_REBOOT=yes"
fi
if [ "$AFTER_REBOOT" = "no" ]; then
# We optionally need to skip checking for the presence of the metapackage
# because that would pull in all the dependent toolset subrpms. We do not
# always want that, especially in CI.
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
# Speed up keygen.
rlRun "rngd -r /dev/hwrandom || rngd -r /dev/urandom"
# Get the SRPM.
rlFetchSrcForInstalled "$KERNEL"
rlRun "SRPM=`find . -name '*.src.rpm'`"
rlRun "SPECDIR=`rpm --define=\"_topdir $TmpDir\" --eval=%_specdir`"
rlRun "rpm -ivh --define=\"_topdir $TmpDir\" $SRPM"
rlRun "SPECFILE=`find $SPECDIR/ -name '*.spec'`"
builddep_options="--nobest"
rlRun "yum-builddep -y $builddep_options $SPECFILE"
fi
rlPhaseEnd
if [ "$AFTER_REBOOT" = "no" ]; then
rlPhaseStartTest "Build"
if [ "$RPM_BUILD_ID" != "" ]; then
rlRun "sed -i \"s/# % define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE"
rlRun "sed -i \"s/# define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE"
fi
if [ "`rlGetPrimaryArch`" == "ppc64" ]; then
TARGET="--target=ppc64"
else
TARGET="--target=$(uname -m)"
fi
if rlRun "CC=$GCC rpmbuild --define=\"_topdir $TmpDir\" -bb $TARGET --clean $SPECFILE &> BUILD_LOG"; then
rlRun "RPMBUILD_OK=yes"
else
rlLogInfo "rpmbuild kernel failed"
rlRun "RPMBUILD_OK=no"
fi
rlBundleLogs "Build-log" BUILD_LOG
rlPhaseEnd
# Install and boot the new kernel only if it's requested *and* the build was successful
if [ "$JUST_BUILD" = 'no' ] && [ "$RPMBUILD_OK" = "yes" ]; then
rlPhaseStartTest "Install"
RPMS="$(ls -1 $TmpDir/RPMS/*/*.rpm | grep -v kernel-selftests-internal | tr '\n' ' ')"
rlRun "yum localinstall -y --disablerepo=\* $RPMS"
rlLogInfo "$(rpm -qa | grep kernel | sort)"
# Update the boot configuration
if [ "$(arch)" = "s390x" ]; then
rlRun "grubby --info=ALL"
rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)"
rlRun "KERNEL_FILE=$(ls -1 /boot/vmlinuz-*${RPM_BUILD_ID}."$(arch)")"
rlRun "ls -al $KERNEL_FILE"
rlRun "grubby --set-default $KERNEL_FILE"
rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)"
rlRun "zipl"
else
rlRun "grub2-set-default 2"
fi
rlPhaseEnd
rlPhaseStartTest "Reboot"
rlRun "touch $REBOOT_FLAG"
rlLog "Rebooting ..."
rhts-reboot
rlPhaseEnd
fi
fi
# Verify the build ID only if its install and boot were requested
if [ "$JUST_BUILD" = 'no' ]; then
rlPhaseStartTest "Test"
if ! [ "$AFTER_REBOOT" = 'yes' ]; then
rlFail 'Not rebooted. Probably rhts-reboot did not work.'
fi
rlLogInfo "$(uname -a)"
rlRun "uname -r | grep $RPM_BUILD_ID"
rlPhaseEnd
fi
rlPhaseStartCleanup
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,20 +0,0 @@
summary: Rebuild wget
description: ""
contact:
- Milos Prchlik <mprchlik@redhat.com>
component:
- gcc-toolset-13-binutils
tag:
- gate-build
test: scl enable gcc-toolset-13 ./runtest.sh
framework: beakerlib
require:
- gcc-toolset-13-binutils
- wget
- rpm-build
#- gcc-toolset-13-gcc
duration: 1h
# Dropping TCMS integration, these links should not be needed anymore.
# extra-summary: /tools/binutils/Sanity/rebuild-wget
# extra-task: /tools/binutils/Sanity/rebuild-wget

View File

@ -1,64 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/binutils/Sanity/rebuild-wget
# Description: Rebuild wget
# Author: Milos Prchlik <mprchlik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGES="${PACKAGES:-gcc-toolset-13-binutils}"
REQUIRES="${REQUIRES:-gcc wget}"
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "LD=$LD"
rlLogInfo "GCC=$GCC"
rlAssertRpm --all
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlFetchSrcForInstalled "wget"
rlRun "SRPM=`find . -name 'wget-*.src.rpm'`"
rlRun "rpm -ivh --define='_topdir $TmpDir' $SRPM"
rlRun "SPECFILE=`find $TmpDir/ -name '*.spec'`"
rlRun "dnf builddep -y $SPECFILE"
rlPhaseEnd
rlPhaseStartTest
rlRun "rpmbuild --define='_topdir $TmpDir' -bb --clean $SPECFILE"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,28 +0,0 @@
summary: The test rebuilds binutils.src.rpm and runs the suite.
description: ''
contact:
- Milos Prchlik <mprchlik@redhat.com>
component:
- binutils
tag:
- gate-build
test: ./runtest.sh
framework: beakerlib
require:
- gcc-toolset-13-binutils
- texinfo
- glibc-static
- dejagnu
- bison
- flex
- zlib-static
- sharutils
- yum-utils
- libstdc++-static
- rpm-build
- gcc
duration: 3h
# Dropping TCMS integration, these links should not be needed anymore.
# extra-summary: /tools/binutils/Sanity/testsuite
# extra-task: /tools/binutils/Sanity/testsuite

View File

@ -1,114 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/binutils/Sanity/testsuite
#
# Description: The test rebuilds binutils.src.rpm and runs the suite.
# The test is based on /tools/binutils/testsuite, but it had to be
# rewritten.
#
# Author: Michael Petlan <mpetlan@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="${PACKAGE:-gcc-toolset-13-binutils}"
PACKAGES="${PACKAGES:-$PACKAGE}"
REQUIRES="${REQUIRES:-gcc glibc}"
rlJournalStart
rlPhaseStartSetup
ARCH="$(rlGetPrimaryArch)"
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "LD=$LD"
rlLogInfo "GCC=$GCC"
rlLogInfo "ARCH=$ARCH"
rlAssertRpm --all
rlRun "TESTDIR=$PWD"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "LOGDIR=$TmpDir/LOGS"
rlRun "BUILDDIR=$(rpm --define='_topdir $TmpDir' --eval=%_builddir)"
rlRun "CURRENT_BUILD=${BUILDDIR}/binutils-$(rpmquery "$PACKAGE" --queryformat=%{VERSION})"
rlRun "mkdir $LOGDIR"
rlRun "pushd $TmpDir"
# fetch'n'build the source
rlFetchSrcForInstalled "$PACKAGE"
rlRun "yum-builddep -y *.src.rpm"
rlRun "SRPM=$(find . -name 'gcc-toolset-13-binutils-*.src.rpm')"
rlRun "rpm -ivh --define='_topdir $TmpDir' $SRPM"
rlRun "SPECFILE=$(find "$TmpDir/" -name '*.spec')"
rlRun "dnf builddep -y $SPECFILE"
rlPhaseEnd
rlPhaseStartSetup "Rebuild binutils"
rlRun "rpmbuild -bc --define='_topdir $TmpDir' $SPECFILE"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/binutils/binutils.log $LOGDIR/binutils-$ARCH.log"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/binutils/binutils.sum $LOGDIR/binutils-$ARCH.sum"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/ld/ld.log $LOGDIR/ld-$ARCH.log"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/ld/ld.sum $LOGDIR/ld-$ARCH.sum"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/gas/testsuite/gas.log $LOGDIR/gas-$ARCH.log"
rlRun "cp $CURRENT_BUILD/build-${ARCH}-redhat-linux/gas/testsuite/gas.sum $LOGDIR/gas-$ARCH.sum"
rlPhaseEnd
for TOOL in binutils ld gas; do
tool_label="$TOOL / $ARCH"
tool_log="$LOGDIR/$TOOL-$ARCH"
rlPhaseStartTest "$tool_label"
rlLogInfo "$tool_label Summary"
rlLogInfo "$(grep -A 50 '=== .* Summary ===' "$tool_log.sum")"
rlRun "awk \"/=== $TOOL tests ===/,/=== $TOOL Summary ===/\" $tool_log.sum > $tool_log.tests" 0,1 "Save results of all tests"
rlRun "grep -E '^FAIL: ' $tool_log.tests | sort > $tool_log.failed" 0,1 "Save failures"
rlRun "grep '# of unexpected failures' $tool_log.sum" 0,1 "Checking number of unexpected failures"
rlLogInfo "$(sort < "$tool_log.failed")"
rlLogInfo "$(grep -E '^[A-Z]+:' "$tool_log.tests" | sort)"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "tar czf $TmpDir/logs.tgz $LOGDIR/*.sum $LOGDIR/*.log $LOGDIR/*.tests $LOGDIR/*.failed"
rlRun "tar czf $TmpDir/buildroot.tgz $CURRENT_BUILD/"
rlFileSubmit logs.tar.gz
rlFileSubmit buildroot.tgz
rlRun "popd" # $TmpDir
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd