Import RHEL's regression test for #1172766

This commit is contained in:
Václav Kadlčík 2021-04-28 08:25:53 +02:00
parent 4504773204
commit 31a5e2d113
4 changed files with 175 additions and 0 deletions

View File

@ -0,0 +1,65 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
# Description: Test for BZ#1172766 (ppc64 segv in libbfd)
# 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.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: Milos Prchlik <mprchlik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#1172766 (ppc64 segv in libbfd)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 30m" >> $(METADATA)
@echo "RunFor: binutils" >> $(METADATA)
@echo "Requires: binutils kernel-debuginfo xz" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: yes" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1172766" >> $(METADATA)
@echo "Releases: RHEL7" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,5 @@
PURPOSE of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
Description: Test for BZ#1172766 (ppc64 segv in libbfd)
Author: Milos Prchlik <mprchlik@redhat.com>
Bug summary: ppc64: segv in libbfd
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1172766

View File

@ -0,0 +1,20 @@
summary: Test for BZ#1172766 (ppc64 segv in libbfd)
description: |
Bug summary: ppc64: segv in libbfd
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1172766
contact: Milos Prchlik <mprchlik@redhat.com>
component:
- binutils
test: ./runtest.sh
framework: beakerlib
recommend:
- binutils
- elfutils
- koji
- kernel-debuginfo
- xz
duration: 30m
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1172766
extra-summary: /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
extra-task: /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd

View File

@ -0,0 +1,85 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
# Description: Test for BZ#1172766 (ppc64 segv in libbfd)
# 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="binutils"
REQUIRES="${REQUIRES:-kernel-debuginfo}"
__have_kernel_debuginfo () {
local RELEASE ARCH TEMPDIR
rlRun "RELEASE=$(uname -r)"
rlRun "ARCH=$(uname -i)"
if ! rpm -q kernel-debuginfo-$RELEASE &>/dev/null; then
rlLogInfo 'kernel-debuginfo not present, trying to install it'
rlRun "TEMPDIR=$(mktemp -d -p $HOME)" # $HOME to avoid "small" tmpfs
rlRun "pushd '$TEMPDIR'"
rlRun "koji download-build -q --debuginfo kernel-$RELEASE --arch $ARCH"
rlRun "dnf -y install ./kernel-debuginfo-*.rpm"
rlRun 'popd'
rlRun "rm -rf '$TEMPDIR'"
fi
rlAssertRpm kernel-debuginfo-$RELEASE
}
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "KERNEL=$(uname -a)"
__have_kernel_debuginfo
rlAssertRpm --all
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "KERNEL_RELEASE=$(uname -r)"
rlRun "KMOD=/usr/lib/modules/$KERNEL_RELEASE/kernel/fs/nfsd/nfsd.ko"
rlRun "KMOD_XZ=$KMOD.xz"
rlRun "KMOD_DEBUG=/usr/lib/debug/$KMOD.debug"
rlAssertExists "$KMOD_DEBUG"
rlAssertExists "$KMOD_XZ"
[[ -e "$KMOD" ]] || rlRun "unxz -k $KMOD_XZ"
rlAssertExists "$KMOD"
rlPhaseEnd
rlPhaseStartTest
rlRun "eu-unstrip $KMOD $KMOD_DEBUG --output=$TmpDir/unstripped.ko"
rlRun "objdump -drS $TmpDir/unstripped.ko &> /dev/null"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd