diff --git a/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/main.fmf b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/main.fmf new file mode 100644 index 0000000..453f4b4 --- /dev/null +++ b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/main.fmf @@ -0,0 +1,6 @@ +summary: "relocation truncated to fit: R_AARCH64_CALL26 (veneers not inserted)" +duration: 15m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1243559 diff --git a/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/reproducer.c b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/reproducer.c new file mode 100644 index 0000000..cd3c523 --- /dev/null +++ b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/reproducer.c @@ -0,0 +1,2 @@ +void foo (); +int main () {foo();} diff --git a/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/test.sh b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/test.sh new file mode 100755 index 0000000..6a0b384 --- /dev/null +++ b/tests/bugs/aarch64-binutils-relocation-truncated-to-fit/test.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1243559-aarch64-binutils-relocation-truncated-to-fit +# Description: Test for BZ#1243559 ([aarch64][binutils] relocation truncated to fit) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers reproducer.c + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -Wl,--defsym=foo=0x80000000 -o reproducer reproducer.c" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/a.cpp b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/a.cpp new file mode 100644 index 0000000..dc6f974 --- /dev/null +++ b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/a.cpp @@ -0,0 +1,4 @@ +int f() +{ +return 0; +} diff --git a/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/main.fmf b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/main.fmf new file mode 100644 index 0000000..b5a02bc --- /dev/null +++ b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/main.fmf @@ -0,0 +1,9 @@ +summary: ar SEGFAULT when creating static library with lto +duration: 15m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1248929 + +adjust+: + - when: arch != x86_64 + enabled: false diff --git a/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/test.sh b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/test.sh new file mode 100755 index 0000000..c52a6a8 --- /dev/null +++ b/tests/bugs/ar-SEGFAULT-when-creating-static-library-with-lto/test.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1248929-ar-SEGFAULT-when-creating-static-library-with-lto +# Description: Test for BZ#1248929 (ar SEGFAULT when creating static library with lto) +# 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. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + buEnterTmpDir + buCopyReproducers a.cpp + rlPhaseEnd + + rlPhaseStartTest + rlRun "g++ -march=native -O3 -flto -c a.cpp" + rlRun "gcc-ar cq a.a a.o" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/main.fmf b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/main.fmf new file mode 100644 index 0000000..c2d8f88 --- /dev/null +++ b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/main.fmf @@ -0,0 +1,9 @@ +summary: binutils ld silently produces broken PIE binaries +duration: 15m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1406430 + +adjust+: + - when: arch != s390x + enabled: false diff --git a/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/pie.c b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/pie.c new file mode 100644 index 0000000..3eb3ff3 --- /dev/null +++ b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/pie.c @@ -0,0 +1,5 @@ +int +main (int argc, char **argv) +{ + return strcmp (argv[0], "string") == 0; +} diff --git a/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/test.sh b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/test.sh new file mode 100755 index 0000000..9bbab1f --- /dev/null +++ b/tests/bugs/binutils-ld-silently-produces-broken-PIE-binaries/test.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/binutils/Regression/bz1406430-binutils-ld-silently-produces-broken-PIE-binaries +# Description: Test for BZ#1406430 (binutils ld silently produces broken PIE binaries) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + buEnterTmpDir + + buCopyReproducers "pie.c" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -c pie.c" + rlRun "gcc -pie -o pie pie.o" 1 + rlAssertNotExists "pie" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/main.fmf b/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/main.fmf new file mode 100644 index 0000000..9bf58fd --- /dev/null +++ b/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/main.fmf @@ -0,0 +1,44 @@ +summary: dwz applied to a dts-compiled binary complains +contact: + - Milos Prchlik + - Sergey Kolosov +duration: 2h + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1366145 + +adjust+: + # DWZ is not available in RHEL-6 - unless you have collection installed, + # then you can use (and test) dwz from collection package. + - when: distro == rhel-6 and collection is not defined + enabled: false + + - when: collection is not defined + require+: + - dwz + environment+: + REQUIRES: dwz + + - when: collection == gcc-toolset-13 + require+: + - gcc-toolset-13-dwz + environment+: + REQUIRES: gcc-toolset-13-dwz + + - when: collection == gcc-toolset-12 + require+: + - gcc-toolset-12-dwz + environment+: + REQUIRES: gcc-toolset-12-dwz + + - when: collection == gcc-toolset-11 + require+: + - gcc-toolset-11-dwz + environment+: + REQUIRES: gcc-toolset-11-dwz + + - when: collection == devtoolset-13 + require+: + - devtoolset-13-dwz + environment+: + REQUIRES: devtoolset-13-dwz diff --git a/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/test.sh b/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/test.sh new file mode 100755 index 0000000..417df7a --- /dev/null +++ b/tests/bugs/dwz-applied-to-a-dts-compiled-binary-complains/test.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1366145-dwz-applied-to-a-dts-compiled-binary-complains +# Description: Test for BZ#1366145 (dwz applied to a dts-compiled binary complains) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + buEnterTmpDir + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo 'int main(void){return 0;}' > test.c" 0 "Generating simple source" + rlRun "gcc test.c -g -o test" + rlRun "md5sum ./test > t_before_dwz" + rlRun "./test" 0 "Test binary is running" + rlRun "dwz ./test" 0 "DWZ returns correct result" + rlRun "md5sum ./test > t_after_dwz" + rlAssertDiffer t_before_dwz t_after_dwz + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/main.fmf b/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/main.fmf new file mode 100644 index 0000000..3a6e10a --- /dev/null +++ b/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/main.fmf @@ -0,0 +1,15 @@ +summary: objdump -S disassembly code doesn't follow +require+: + - strace + - coreutils + - glibc-debuginfo + - coreutils-debuginfo +duration: 15m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1311352 + +adjust+: + - because: "TODO: Debuginfo repos on Fedora are weird" + when: distro == fedora + enabled: false diff --git a/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/test.sh b/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/test.sh new file mode 100755 index 0000000..a958604 --- /dev/null +++ b/tests/bugs/objdump-S-disassembly-code-doesn-t-follow/test.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1311352-objdump-S-disassembly-code-doesn-t-follow +# Description: Test for BZ#1311352 (objdump -S disassembly code doesn't follow) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + buEnterTmpDir + rlPhaseEnd + + rlPhaseStartTest + rlRun "strace -e trace=open,openat -o strace.out objdump -drS /usr/bin/ls &> out" + rlRun "grep '/usr/lib/debug' strace.out" + + # Check whether objdump output contains source code snippets. + # ls sources can change in time, but it's likely there always + # will be at least one "int i;". + rlRun "grep 'int i' out > /dev/null" 0 "Checking for source code snippets in objdump output" + + rlLogInfo "$(head -n20 out)" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/ppc64-segv-in-libbfd/main.fmf b/tests/bugs/ppc64-segv-in-libbfd/main.fmf index f2eaeef..152b351 100644 --- a/tests/bugs/ppc64-segv-in-libbfd/main.fmf +++ b/tests/bugs/ppc64-segv-in-libbfd/main.fmf @@ -9,3 +9,8 @@ duration: 30m link+: - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2225130 + +adjust+: + - because: "TODO: Debuginfo repos on Fedora are weird" + when: distro == fedora + enabled: false diff --git a/tests/lib.sh b/tests/lib.sh index 841ec48..d8ffe1f 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -37,6 +37,7 @@ function buTestHeader () { rlLogInfo "COLLECTION_PACKAGES=$COLLECTION_PACKAGES" rlLogInfo "LD=$_LD" rlLogInfo "GCC=$_GCC" + rlLogInfo "ARCH=$(arch)" rlLogInfo "BU_TMPDIR_PARENT=$BU_TMPDIR_PARENT" rlLogInfo "BU_AS_TEST_USER=$BU_AS_TEST_USER" @@ -116,9 +117,9 @@ function buBuildSRPM () { if [ ! -z "$BU_AS_TEST_USER" ]; then username="${1:-$BU_TEST_USER}" - rlRun "su - $username -c 'rpmbuild -bb --define=\"_topdir $TmpDir\" $SPECFILE'" + rlRun "su - $username -c 'rpmbuild -bc --define=\"_topdir $TmpDir\" $SPECFILE'" else - rlRun " rpmbuild -bb --define=\"_topdir $TmpDir\" $SPECFILE" + rlRun " rpmbuild -bc --define=\"_topdir $TmpDir\" $SPECFILE" fi } diff --git a/tests/main.fmf b/tests/main.fmf index 0de1503..8fb4034 100644 --- a/tests/main.fmf +++ b/tests/main.fmf @@ -197,6 +197,8 @@ adjust+: - when: distro == fedora-rawhide and collection is not defined require+: - binutils + - binutils-devel + - binutils-gold - gcc - gcc-c++ - annobin-plugin-gcc @@ -210,6 +212,8 @@ adjust+: - when: distro == fedora-39 and collection is not defined require+: - binutils + - binutils-devel + - binutils-gold - gcc - gcc-c++ - annobin-plugin-gcc @@ -223,6 +227,8 @@ adjust+: - when: distro == fedora-38 and collection is not defined require+: - binutils + - binutils-devel + - binutils-gold - gcc - gcc-c++ - annobin-plugin-gcc