Import RHEL's regression test for #748927

This commit is contained in:
Václav Kadlčík 2021-04-28 13:38:57 +02:00
parent 06dff1c717
commit aa0db47566
4 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/binutils/Regression/bz748927-SystemTap-affected-by-stapsdt-base-1
# Description: Make sure there is .stapsdt.base field
# Author: Michal Nowak <mnowak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2011 Red Hat, Inc. All rights reserved.
#
# 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/bz748927-SystemTap-affected-by-stapsdt-base-1
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: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Make sure there is .stapsdt.base field" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: binutils glibc systemtap" >> $(METADATA)
@echo "Requires: binutils glibc.i386 glibc.x86_64 glibc.ppc glibc.ppc64 glibc.s390 glibc.s390x glibc.ia64 glibc.i686" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: yes" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 748927" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,8 @@
PURPOSE of /tools/binutils/Regression/bz748927-SystemTap-affected-by-stapsdt-base-1
Description: Make sure there is .stapsdt.base field
Author: Michal Nowak <mnowak@redhat.com>
arch = s390,s390x && distro = rhel-7: False
arch = ppc64 && distro = rhel-7: False
arch = aarch64: False
arch = ppc64le: False

View File

@ -0,0 +1,28 @@
summary: Make sure there is .stapsdt.base field
description: |
arch = s390,s390x && distro = rhel-7: False
arch = ppc64 && distro = rhel-7: False
arch = aarch64: False
arch = ppc64le: False
contact: Michal Nowak <mnowak@redhat.com>
component:
- binutils
- glibc
- systemtap
test: ./runtest.sh
framework: beakerlib
recommend:
- binutils
- glibc.i386
- glibc.x86_64
- glibc.ppc
- glibc.ppc64
- glibc.s390
- glibc.s390x
- glibc.ia64
- glibc.i686
duration: 5m
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=748927
extra-summary: /tools/binutils/Regression/bz748927-SystemTap-affected-by-stapsdt-base-1
extra-task: /tools/binutils/Regression/bz748927-SystemTap-affected-by-stapsdt-base-1

View File

@ -0,0 +1,59 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/binutils/Regression/bz748927-SystemTap-affected-by-stapsdt-base-1
# Description: Make sure there is .stapsdt.base field
# Author: Michal Nowak <mnowak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2011 Red Hat, Inc. All rights reserved.
#
# 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="binutils"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlCheckRpm glibc
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "grep -q CONFIG_UTRACE /boot/config-$( uname -r )" 0,1 || rlLogWarning "Uprobes disabled"
rlPhaseEnd
for ld in $( ls {/emul/ia32-linux,}/lib*/ld-2* 2> /dev/null); do
rlPhaseStartTest "${ld} from $( rpmquery -f ${ld} )"
filename="$( basename ${ld} ).readline"
rlRun "readelf -S ${ld} > $filename" 0 "[$( basename ${ld} )] Write section headers of ${ld}"
if ! [[ "$( rlGetArch )" == "ia64" && ! "${ld}" =~ "emul" ]]; then
rlAssertGrep ".stapsdt.base " $filename || rlLogError "This may be problem for SystemTap"
fi
rlAssertNotGrep ".stapsdt.base.1" $filename || rlLogError "This may be problem for SystemTap"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd