#13 Import another set of RHEL's regression tests
Merged 3 years ago by nickc. Opened 3 years ago by vkadlcik.
Unknown source rawhide  into  rawhide

@@ -0,0 +1,63 @@

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /tools/binutils/Regression/RELRO-protection-effective

+ #   Description: bz1174826

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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/.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ export TEST=/tools/binutils/Regression/RELRO-protection-effective

+ 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:           Martin Cermak <mcermak@redhat.com>" > $(METADATA)

+ 	@echo "Name:            $(TEST)" >> $(METADATA)

+ 	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)

+ 	@echo "Path:            $(TEST_DIR)" >> $(METADATA)

+ 	@echo "Description:     bz1174826" >> $(METADATA)

+ 	@echo "Type:            Regression" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          binutils" >> $(METADATA)

+ 	@echo "Requires:        binutils gcc" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2+" >> $(METADATA)

+ 	@echo "Confidential:    no" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 	@echo "Bug:             1174826" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,34 @@

+ PURPOSE of /tools/binutils/Regression/RELRO-protection-effective

+ Description: bz1174826

+ Author: Martin Cermak <mcermak@redhat.com>

+ Bug summary: RELRO is not read-only on PowerLE

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1174826

+ 

+ /*                                                                                 

+  * Test to exercise PIE and RELRO provided by Roland McGrath <roland@redhat.com>.

+  *                                                                                 

+  * Description:                                                                    

+  *   Simple test for RELRO, which happens to be a PIE too, but that's only         

+  *   because this kind of example has to be in PIC code to make RELRO relevant, 

+  *   and PIE makes it simpler to write a standalone one-file test than writing  

+  *   a DSO.                                                                        

+  *                                                                                 

+  *   The "const" makes "foo" .rodata material, and the init to an external symbol

+  *   reference makes it require a data relocation.  Enabling -z relro for this  

+  *   link puts that .rodata into a RELRO area.  This program will crash because 

+  *   the page containing "foo" has been made read-only when "main" runs.           

+  *   Without RELRO, it would let you modify "foo" even though it's supposed to  

+  *   be const.                                                                     

+  *                                                                                 

+  * Test with RELRO should fail:                                                    

+  *   $ gcc -pie -fPIE -g  -Wl,-z,relro -o relro relro.c                            

+  *   $ ./relro                                                                     

+  *   Segmentation fault (core dumped)                                              

+  *                                                                                 

+  * Test without RELRO should pass:                                                 

+  *   $ gcc -pie -fPIE -g  -Wl,-z,norelro -o no-relro relro.c                       

+  *   $ ./no-relro                                                                  

+  *                                                                                 

+ **/

+ 

+ 

@@ -0,0 +1,43 @@

+ summary: bz1174826

+ description: "Bug summary: RELRO is not read-only on PowerLE\nBugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1174826\n\

+     \n/*                                                                         \

+     \        \n * Test to exercise PIE and RELRO provided by Roland McGrath <roland@redhat.com>.\n\

+     \ *                                                                          \

+     \       \n * Description:                                                    \

+     \                \n *   Simple test for RELRO, which happens to be a PIE too,\

+     \ but that's only         \n *   because this kind of example has to be in PIC\

+     \ code to make RELRO relevant, \n *   and PIE makes it simpler to write a standalone\

+     \ one-file test than writing  \n *   a DSO.                                  \

+     \                                      \n *                                  \

+     \                                               \n *   The \"const\" makes \"\

+     foo\" .rodata material, and the init to an external symbol\n *   reference makes\

+     \ it require a data relocation.  Enabling -z relro for this  \n *   link puts\

+     \ that .rodata into a RELRO area.  This program will crash because \n *   the\

+     \ page containing \"foo\" has been made read-only when \"main\" runs.        \

+     \   \n *   Without RELRO, it would let you modify \"foo\" even though it's supposed\

+     \ to  \n *   be const.                                                       \

+     \              \n *                                                          \

+     \                       \n * Test with RELRO should fail:                    \

+     \                                \n *   $ gcc -pie -fPIE -g  -Wl,-z,relro -o relro\

+     \ relro.c                            \n *   $ ./relro                        \

+     \                                             \n *   Segmentation fault (core\

+     \ dumped)                                              \n *                  \

+     \                                                               \n * Test without\

+     \ RELRO should pass:                                                 \n *   $\

+     \ gcc -pie -fPIE -g  -Wl,-z,norelro -o no-relro relro.c                      \

+     \ \n *   $ ./no-relro                                                        \

+     \          \n *                                                              \

+     \                   \n**/\n\n\n"

+ contact: Martin Cermak <mcermak@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - gcc

+ duration: 5m

+ link:

+ -   relates: https://bugzilla.redhat.com/show_bug.cgi?id=1174826

+ extra-summary: /tools/binutils/Regression/RELRO-protection-effective

+ extra-task: /tools/binutils/Regression/RELRO-protection-effective

@@ -0,0 +1,65 @@

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /tools/binutils/Regression/RELRO-protection-effective

+ #   Description: bz1174826

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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

+ 

+ PACKAGE="binutils"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+         touch /tmp/disable-qe-abrt

+         rlRun "TMPD=\$(mktemp -d)"

+         rlRun "pushd $TMPD"

+         cat > relro.c <<-EOF

+ #include <stdio.h>

+ 

+ void *const foo = &stdout;

+ 

+ int main (void)

+ {

+   *(void **) &foo = &stderr;

+   return 0;

+ }

+ EOF

+         rlRun "gcc -pie -fPIE -g  -Wl,-z,relro -o relro relro.c"

+         rlRun "gcc -pie -fPIE -g  -Wl,-z,norelro -o no-relro relro.c"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "./relro" 139

+         rlRun "./no-relro"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

+         rlRun "rm -r $TMPD"

+         rm -f /tmp/disable-qe-abrt

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,63 @@

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

+ #   Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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/.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ export TEST=/tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

+ 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:           Martin Cermak <mcermak@redhat.com>" > $(METADATA)

+ 	@echo "Name:            $(TEST)" >> $(METADATA)

+ 	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)

+ 	@echo "Path:            $(TEST_DIR)" >> $(METADATA)

+ 	@echo "Description:     Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)" >> $(METADATA)

+ 	@echo "Type:            Regression" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          binutils" >> $(METADATA)

+ 	@echo "Requires:        binutils" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2+" >> $(METADATA)

+ 	@echo "Confidential:    no" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 	@echo "Bug:             1080077" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,5 @@

+ PURPOSE of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

+ Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)

+ Author: Martin Cermak <mcermak@redhat.com>

+ Bug summary: [RFE] - Please configure ld.bfd to allow --sysroot

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1080077

@@ -0,0 +1,16 @@

+ summary: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)

+ description: |

+     Bug summary: [RFE] - Please configure ld.bfd to allow --sysroot

+     Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1080077

+ contact: Martin Cermak <mcermak@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ duration: 5m

+ link:

+ -   relates: https://bugzilla.redhat.com/show_bug.cgi?id=1080077

+ extra-summary: /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

+ extra-task: /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

@@ -0,0 +1,39 @@

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot

+ #   Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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

+ 

+ rlJournalStart

+     rlPhaseStartTest

+         LD_BDF=$(which ld.bfd)

+         RPM=$(rpm -qf $LD_BDF)

+         rlLogInfo "ld.bfd is $LD_BDF of $RPM"

+         rlRun "ld.bfd --sysroot=/tmp |& grep 'not configured to use sysroots'" 1

+         rlRun "ld.bfd --sysroot=/tmp |& grep 'no input files'"

+     rlPhaseEnd

+ rlJournalEnd

@@ -0,0 +1,65 @@

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

+ #   Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)

+ #   Author: Milos Prchlik <mprchlik@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE libtest.tar.gz

+ 

+ .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#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)" >> $(METADATA)

+ 	@echo "Type:            Regression" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          binutils" >> $(METADATA)

+ 	@echo "Requires:        binutils" >> $(METADATA)

+ 	@echo "Requires:        devtoolset-3.0-tools-devtoolset-3.0-Install-latest" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    yes" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 	@echo "Bug:             1117458" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,5 @@

+ PURPOSE of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

+ Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)

+ Author: Milos Prchlik <mprchlik@redhat.com>

+ Bug summary: ld from devtoolset copies SONAME to DT_NEEDED without checking if it’s empty

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1117458

@@ -0,0 +1,3 @@

+ int foo(void) {

+ 	return 10;

+ }

@@ -0,0 +1,17 @@

+ summary: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)

+ description: |

+     Bug summary: ld from devtoolset copies SONAME to DT_NEEDED without checking if it’s empty

+     Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1117458

+ contact: Milos Prchlik <mprchlik@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - gcc

+ duration: 5m

+ link:

+ -   relates: https://bugzilla.redhat.com/show_bug.cgi?id=1117458

+ extra-summary: /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

+ extra-task: /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

@@ -0,0 +1,63 @@

+ #!/bin/bash

+ # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED

+ #   Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)

+ #   Author: Milos Prchlik <mprchlik@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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="binutils"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+ 

+         rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"

+         rlRun "cp user.c libfoo.c $TmpDir/" 

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "gcc -fPIC -g -c libfoo.c"

+         rlAssertExists "libfoo.o"

+         rlRun "gcc -shared -Wl,-soname, -o libfoo.so -lc libfoo.o 2>&1 | tee out" 0

+         rlAssertExists "libfoo.so"

+         rlLogInfo "gcc output:"

+         rlLogInfo "$(cat out)"

+         rlAssertGrep "SONAME must not be empty string; ignored" out

+         rlRun "objdump -p libfoo.so | grep SONAME | awk '{print \$2}' > soname"

+         if [ "`stat -c '%s' soname`" != "0" ]; then

+             rlLogInfo "SONAME='$(cat soname)'"

+             rlFail "Detected SONAME is empty"

+         fi

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd" # $TmpDir

+         rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,9 @@

+ #include <stdio.h>

+ 

+ extern int foo(void);

+ 

+ int main(void) {

+ 	int a = foo();

+ 	printf("a is %d\n", a);

+ 	return 0;

+ }

@@ -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)

@@ -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

@@ -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

@@ -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

@@ -0,0 +1,65 @@

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

+ #   Description: Test for BZ#959422 (TLS variable wrongly relocated on .debug_info)

+ #   Author: Milos Prchlik <mprchlik@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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=/CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE ld-fail.c

+ 

+ .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#959422 (TLS variable wrongly relocated on .debug_info)" >> $(METADATA)

+ 	@echo "Type:            Regression" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          binutils" >> $(METADATA)

+ 	@echo "Requires:        binutils" >> $(METADATA)

+ 	@echo "Architectures:   s390x" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    yes" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 	@echo "Bug:             959422" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,5 @@

+ PURPOSE of /CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

+ Description: Test for BZ#959422 (TLS variable wrongly relocated on .debug_info)

+ Author: Milos Prchlik <mprchlik@redhat.com>

+ Bug summary: TLS variable wrongly relocated on .debug_info

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=959422

@@ -0,0 +1,8 @@

+ #include <pthread.h>

+ 

+ __thread const char *tls_var = "hello";

+ 

+ int main ()

+ {

+   return 0;

+ }

@@ -0,0 +1,18 @@

+ summary: Test for BZ#959422 (TLS variable wrongly relocated on .debug_info)

+ description: |

+     Bug summary: TLS variable wrongly relocated on .debug_info

+     Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=959422

+ contact: Milos Prchlik <mprchlik@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - gcc

+ - gdb

+ duration: 5m

+ link:

+ -   relates: https://bugzilla.redhat.com/show_bug.cgi?id=959422

+ extra-summary: /CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

+ extra-task: /CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

@@ -0,0 +1,57 @@

+ #!/bin/bash

+ # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /CoreOS/binutils/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info

+ #   Description: Test for BZ#959422 (TLS variable wrongly relocated on .debug_info)

+ #   Author: Milos Prchlik <mprchlik@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2014 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="binutils"

+ 

+ GCC=${GCC:-"gcc"}

+ GDB=${GDB:-"gdb"}

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+         rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"

+         rlRun "cp ld-fail.c $TmpDir/"

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "$GCC -lpthread -g3 -O0 ld-fail.c -o ld-fail"

+         rlRun "$GDB ./ld-fail -q -ex start -ex 'print tls_var' -ex cont -ex quit &> gdb.log"

+         rlLogInfo "$(cat gdb.log)"

+         rlRun "grep -P '\\\$1 = 0x[0-9a-f]{1,16} \"hello\"' gdb.log"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

+         rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

no initial comment

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been merged by nickc

3 years ago
Metadata
Changes Summary 23
+63
file added
tests/Regression/RELRO-protection-effective/Makefile
+34
file added
tests/Regression/RELRO-protection-effective/PURPOSE
+43
file added
tests/Regression/RELRO-protection-effective/main.fmf
+65
file added
tests/Regression/RELRO-protection-effective/runtest.sh
+63
file added
tests/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot/Makefile
+5
file added
tests/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot/PURPOSE
+16
file added
tests/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot/main.fmf
+39
file added
tests/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot/runtest.sh
+65
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/Makefile
+5
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/PURPOSE
+3
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/libfoo.c
+17
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/main.fmf
+63
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/runtest.sh
+9
file added
tests/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/user.c
+65
file added
tests/Regression/bz1172766-ppc64-segv-in-libbfd/Makefile
+5
file added
tests/Regression/bz1172766-ppc64-segv-in-libbfd/PURPOSE
+20
file added
tests/Regression/bz1172766-ppc64-segv-in-libbfd/main.fmf
+85
file added
tests/Regression/bz1172766-ppc64-segv-in-libbfd/runtest.sh
+65
file added
tests/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info/Makefile
+5
file added
tests/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info/PURPOSE
+8
file added
tests/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info/ld-fail.c
+18
file added
tests/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info/main.fmf
+57
file added
tests/Regression/bz959422-TLS-variable-wrongly-relocated-on-debug-info/runtest.sh