From c9bd2d012b417d97540af6eb380008507eca1eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Fri, 30 Jun 2023 14:01:35 +0200 Subject: [PATCH] tests: bootstrap test coverage There's a "standard" plan for the gating, plus a small fix of gating.yaml, and a beginning of non-gating coverage for migrated tests. --- .fmf/version | 1 + gating.yaml | 2 +- plans/build-gating.fmf | 28 +++ plans/testsuite.fmf | 26 +++ .../Sanity/rebuild-kernel-and-reboot/main.fmf | 68 +++++++ .../rebuild-kernel-and-reboot/runtest.sh | 180 ++++++++++++++++++ tests/Sanity/rebuild-wget/main.fmf | 20 ++ tests/Sanity/rebuild-wget/runtest.sh | 64 +++++++ tests/Sanity/testsuite/main.fmf | 28 +++ tests/Sanity/testsuite/runtest.sh | 114 +++++++++++ .../main.fmf | 22 +++ .../poc | Bin 0 -> 95720 bytes .../runtest.sh | 56 ++++++ 13 files changed, 608 insertions(+), 1 deletion(-) create mode 100644 .fmf/version create mode 100644 plans/build-gating.fmf create mode 100644 plans/testsuite.fmf create mode 100644 tests/Sanity/rebuild-kernel-and-reboot/main.fmf create mode 100755 tests/Sanity/rebuild-kernel-and-reboot/runtest.sh create mode 100644 tests/Sanity/rebuild-wget/main.fmf create mode 100755 tests/Sanity/rebuild-wget/runtest.sh create mode 100644 tests/Sanity/testsuite/main.fmf create mode 100755 tests/Sanity/testsuite/runtest.sh create mode 100644 tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/main.fmf create mode 100644 tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/poc create mode 100755 tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml index eb21986..7873a84 100644 --- a/gating.yaml +++ b/gating.yaml @@ -7,7 +7,7 @@ rules: - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} --- !Policy product_versions: - - rhel-9 + - rhel-8 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans/build-gating.fmf b/plans/build-gating.fmf new file mode 100644 index 0000000..a43a222 --- /dev/null +++ b/plans/build-gating.fmf @@ -0,0 +1,28 @@ +# +# Build/PR gating tests for binutils +# + +summary: binutils tests for build/PR gating + +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-8 + prepare+: + - how: shell + script: + - dnf config-manager --set-enabled rhel-CRB + - dnf config-manager --set-enabled rhel-buildroot + +discover: + how: fmf + filter: "tag:gate-build" + +execute: + how: tmt diff --git a/plans/testsuite.fmf b/plans/testsuite.fmf new file mode 100644 index 0000000..e172bcf --- /dev/null +++ b/plans/testsuite.fmf @@ -0,0 +1,26 @@ +# +# Build/PR gating tests for binutils +# + +summary: binutils tests + +adjust: + - because: "Plan to be ran when executed locally." + when: >- + trigger is defined + enabled: false + + - because: "CRB and Buildroot repositories must be enabled for various BuildRequires" + when: distro == rhel-8 + prepare+: + - how: shell + script: + - dnf config-manager --set-enabled rhel-CRB + # - dnf config-manager --set-enabled rhel-Buildroot + +discover: + how: fmf + filter: "tag:-gate-build" + +execute: + how: tmt diff --git a/tests/Sanity/rebuild-kernel-and-reboot/main.fmf b/tests/Sanity/rebuild-kernel-and-reboot/main.fmf new file mode 100644 index 0000000..8b4f246 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/main.fmf @@ -0,0 +1,68 @@ +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 + Author: Marek Polacek +contact: +- Milos Prchlik +component: +- gcc-toolset-13-binutils +tag: +- gate-build +test: scl enable gcc-toolset-13 ./runtest.sh +framework: beakerlib +require: +- gcc-toolset-13-binutils +- gcc +- yum-utils +- rng-tools +- rpm-build +- newt-devel +- python3-devel +- perl-ExtUtils-Embed +- unifdef +- elfutils-libelf-devel +- elfutils-devel +- pciutils-devel +- wget +- hmaccalc +- binutils-devel +- glibc-static +- texinfo +- gdb +- 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 + + - because: "ecj is available for rhel-8 only" + when: distro == rhel + require+: + - ecj + +# 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 diff --git a/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh b/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh new file mode 100755 index 0000000..946b185 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh @@ -0,0 +1,180 @@ +#!/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 . +# +# Rebuild kernel, install it, reboot, and check if we're running the correct +# kernel. Tailored specificaly for binutils buildroot testing process. +# +# Author: Milos Prchlik +# +# Based on gcc/Sanity/rebuild-kernel by: +# Author: Michal Nowak +# Author: Marek Polacek + +# 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 diff --git a/tests/Sanity/rebuild-wget/main.fmf b/tests/Sanity/rebuild-wget/main.fmf new file mode 100644 index 0000000..57e09af --- /dev/null +++ b/tests/Sanity/rebuild-wget/main.fmf @@ -0,0 +1,20 @@ +summary: Rebuild wget +description: "" +contact: +- Milos Prchlik +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 diff --git a/tests/Sanity/rebuild-wget/runtest.sh b/tests/Sanity/rebuild-wget/runtest.sh new file mode 100755 index 0000000..b37282a --- /dev/null +++ b/tests/Sanity/rebuild-wget/runtest.sh @@ -0,0 +1,64 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 diff --git a/tests/Sanity/testsuite/main.fmf b/tests/Sanity/testsuite/main.fmf new file mode 100644 index 0000000..91ee103 --- /dev/null +++ b/tests/Sanity/testsuite/main.fmf @@ -0,0 +1,28 @@ +summary: The test rebuilds binutils.src.rpm and runs the suite. +description: '' +contact: +- Milos Prchlik +component: +- gcc-toolset-13-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 diff --git a/tests/Sanity/testsuite/runtest.sh b/tests/Sanity/testsuite/runtest.sh new file mode 100755 index 0000000..eeeb170 --- /dev/null +++ b/tests/Sanity/testsuite/runtest.sh @@ -0,0 +1,114 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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.tgz + rlFileSubmit buildroot.tgz + rlRun "popd" # $TmpDir + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/main.fmf b/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/main.fmf new file mode 100644 index 0000000..b9ea394 --- /dev/null +++ b/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/main.fmf @@ -0,0 +1,22 @@ +summary: "objdump SEGV in concat_filename() at dwarf2.c:2060" + +description: "" + +contact: + - Milos Prchlik + +component: + - gcc-toolset-13-binutils + +test: scl enable gcc-toolset-13 ./runtest.sh + +framework: beakerlib + +require: + - gcc-toolset-13-binutils + +duration: 15m + +link: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2188582 + - verifies: https://sourceware.org/bugzilla/show_bug.cgi?id=29936 diff --git a/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/poc b/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/poc new file mode 100644 index 0000000000000000000000000000000000000000..6e629204514f937475a7573a6101d21b4faf373f GIT binary patch literal 95720 zcmeI*J#W)M7yw|qZPFq>+KI40kr09|$Qv7Cfrs}=R0t5&UAV7cs0RjXF5FkK+009C7&XvG9yB8YwgyWWPy8U}Q9*3{gLV0U= zt-LGT=pSZTijBudI~{d+Q3&h}t!0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72uuq+c(J|p@zv(e?#sRGp#FSoYk&Jw-FmmP zyPZwv%+orUBb{~g{fGUNICGX|c|49=RSfAK6Y=HFzLb%2s4HQ)c{{rjOS|I(Xk{vTBlGpD^AKK=vZK&SHn literal 0 HcmV?d00001 diff --git a/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/runtest.sh b/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/runtest.sh new file mode 100755 index 0000000..cdf4866 --- /dev/null +++ b/tests/objdump-SEGV-in-concat_filename-at-dwarf2.c-2060/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 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:-}" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "REQUIRES=$REQUIRES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + + rlAssertRpm --all + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp poc $TmpDir/" + + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartSetup "Run the test" + rlRun -s "objdump -S poc" + rlRun "cp $rlRun_LOG ./output.txt" + rlPhaseEnd + + rlPhaseStartCleanup + rlFileSubmit "$TmpDir/output.txt" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd