#1 Add CI tests using the standard test interface
Closed 6 years ago by sturivny. Opened 6 years ago by sturivny.
git://fedorapeople.org/~sturivny/elfutils new_tests  into  master

Add CI tests using the standard test interface
Serhii Turivny • 6 years ago  
tests/README.md
file added
+3
@@ -0,0 +1,3 @@

+ # elfutils

+ 

+ tests for the elfutils package 

\ No newline at end of file

tests/Stack-overflow-in-dwarf-getsrclines/Makefile
file added
+63
@@ -0,0 +1,63 @@

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

+ #

+ #   Makefile of /tools/elfutils/Stack-overflow-in-dwarf-getsrclines

+ #   Description: Test for Stack overflow in dwarf_getsrclines)

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/elfutils/Stack-overflow-in-dwarf-getsrclines

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE vpoolengineUS.bz2

+ 

+ .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:           Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for Stack overflow in dwarf_getsrclines" >> $(METADATA)

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

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

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

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

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/Stack-overflow-in-dwarf-getsrclines/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/Stack-overflow-in-dwarf-getsrclines

+ Description: Test for Stack overflow in dwarf_getsrclines

+ Author: Dagmar Prokopova <dprokopo@redhat.com>

+ Bug summary: Stack overflow in dwarf_getsrclines

tests/Stack-overflow-in-dwarf-getsrclines/runtest.sh
file added
+57
@@ -0,0 +1,57 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/Stack-overflow-in-dwarf-getsrclines

+ #   Description: Test for Stack overflow in dwarf_getsrclines

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ # This was fixed in elfutils-0.155-7.

+ 

+ PACKAGE="elfutils"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

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

+         # We need the reproducer.

+         cp -v vpoolengineUS.bz2 $TmpDir

+         rlRun "pushd $TmpDir"

+         rlRun "bunzip2 vpoolengineUS.bz2"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         # No segfault should appear.

+         rlRun "eu-addr2line -e vpoolengineUS 0x6682f7" 0

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/Stack-overflow-in-dwarf-getsrclines/vpoolengineUS.bz2
file added
empty or binary file added
tests/Support-64-bit-SYM64-symbol-table/Makefile
file added
+63
@@ -0,0 +1,63 @@

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

+ #

+ #   Makefile of /tools/elfutils/Support-64-bit-SYM64-symbol-table

+ #   Description: Test for Support of 64-bit /SYM64/ symbol table

+ #   Author: Vaclav Kadlcik <vkadlcik@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/elfutils/Support-64-bit-SYM64-symbol-table

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE libantlr.a.bz2

+ 

+ .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:           Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for Support of 64-bit /SYM64/ symbol table" >> $(METADATA)

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

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

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

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

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

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/Support-64-bit-SYM64-symbol-table/PURPOSE
file added
+11
@@ -0,0 +1,11 @@

+ PURPOSE of /tools/elfutils/Support-64-bit-SYM64-symbol-table

+ Description: Test for Support 64-bit /SYM64/ symbol table

+ Author: Vaclav Kadlcik <vkadlcik@redhat.com>

+ Bug summary: Support 64-bit /SYM64/ symbol table

+ 

+ Verify that a 64-bit symbol table produced on s390x is readable by elfutils

+ tools. The test is based on Ed Santiago's examples in Bugzilla; a test file

+ (libantlr.a) is taken from antlr-C++-2.7.7-30.el7.s390x.rpm. Mark Wielaard

+ mentioned another test included in the upstream; it gets processed within

+ ../../testsuite (which runs the complete upstream testsuite) so its omission

+ here is intentional.

tests/Support-64-bit-SYM64-symbol-table/libantlr.a.bz2
file added
empty or binary file added
tests/Support-64-bit-SYM64-symbol-table/runtest.sh
file added
+65
@@ -0,0 +1,65 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/Support-64-bit-SYM64-symbol-table

+ #   Description: Test for Support for 64-bit /SYM64/ symbol table

+ #   Author: Vaclav Kadlcik <vkadlcik@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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="elfutils"

+ 

+ TEST_ARCHIVE_1='libantlr.a' # see PURPOSE & Bugzilla

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

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

+         rlRun "cp ${TEST_ARCHIVE_1}.bz2 $TmpDir" 0 "Copying test files"

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+ 

+         rlRun "bunzip2 ${TEST_ARCHIVE_1}.bz2"

+         rlAssertExists "$TEST_ARCHIVE_1"

+ 

+         rlRun -s "eu-ar t $TEST_ARCHIVE_1" 0 "Checking eu-ar runs"

+         rlAssertExists "$rlRun_LOG"

+         rlAssertGrep '^/SYM64/$' "$rlRun_LOG"

+         rlAssertGrep '^ANTLRUtil\.o$' "$rlRun_LOG"

+ 

+         rlRun -s "eu-readelf -a $TEST_ARCHIVE_1" 0 "Checking eu-readelf runs"

+         rlAssertExists "$rlRun_LOG"

+         rlAssertGrep '^ELF Header:$' "$rlRun_LOG"

+ 

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/When-linking-statically-only-against-elfutils/Makefile
file added
+64
@@ -0,0 +1,64 @@

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

+ #

+ #   Makefile of /tools/elfutils/When-linking-statically-only-against-elfutils

+ #   Description: Test for linking statically only against elfutils

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/elfutils/When-linking-statically-only-against-elfutils

+ 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:           Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for linking statically only against elfutils" >> $(METADATA)

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

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

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

+ 	@echo "Requires:        elfutils gcc glibc glibc-static elfutils-libelf elfutils-libelf-devel" >> $(METADATA)

+ 	@echo "Requires:        elfutils-libs" >> $(METADATA)

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/When-linking-statically-only-against-elfutils/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/When-linking-statically-only-against-elfutils

+ Description: Test for linking statically only against elfutils

+ Author: Dagmar Prokopova <dprokopo@redhat.com>

+ Bug summary: When linking statically only against elfutils libs, one needs to provide complete path to static library

tests/When-linking-statically-only-against-elfutils/runtest.sh
file added
+73
@@ -0,0 +1,73 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/When-linking-statically-only-against-elfutils

+ #   Description: Test for linking statically only against elfutils

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGES=(elfutils elfutils-libs elfutils-libelf elfutils-libelf-devel gcc)

+ 

+ # Set the variabile UNDER_DTS on non-empty string, when run under devtoolset

+ if $( echo `which gcc` | grep -qE '/opt/rh/' ); then

+   UNDER_DTS="true"

+   # Set the actual version of DTS

+   DTS=`which gcc | awk 'BEGIN { FS="/" } { print $4 }'`

+ fi

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         

+         for p in "${PACKAGES[@]}"; do

+           rlAssertRpm "$p" || yum install -y $p

+         done; unset p

+ 

+         if [ -z ${UNDER_DTS} ]; then

+             # Under base elfutils we need elfutils-libelf-devel-static to be installed.

+             yum install -y elfutils-libelf-devel-static

+             rlAssertRpm elfutils-libelf-devel-static

+         else

+             # We don't want it to be installed when run under DTS.

+             yum remove -y elfutils-libelf-devel-static

+             rlAssertNotRpm elfutils-libelf-devel-static

+         fi

+  

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

+         rlRun "pushd $TmpDir"

+ 

+    rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "echo 'int main(void) { return 0; }' | gcc -static -lelf -xc -" 0 "Compile reproducer and link it with libelf (-static)."

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/abrt-faf-elfutils-IO-default-xsputn/Makefile
file added
+62
@@ -0,0 +1,62 @@

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

+ #

+ #   Makefile of /tools/elfutils/abrt-faf-elfutils-IO-default-xsputn

+ #   Description: abrt-faf-elfutils-IO-default-xsputn

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

+ #

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

+ #

+ #   Copyright (c) 2015 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/elfutils/abrt-faf-elfutils-IO-default-xsputn

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE eu-readelf-n-crash.core.xz

+ 

+ .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:     abrt-faf-elfutils-IO-default-xsputn" >> $(METADATA)

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

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

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

+ 	@echo "Requires:        elfutils xz" >> $(METADATA)

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/abrt-faf-elfutils-IO-default-xsputn/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/abrt-faf-elfutils-IO-default-xsputn

+ Description: abrt-faf-elfutils-IO-default-xsputn

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

+ Bug summary: [abrt] [faf] elfutils: _IO_default_xsputn(): /usr/bin/eu-readelf killed by 11

tests/abrt-faf-elfutils-IO-default-xsputn/eu-readelf-n-crash.core.xz
file added
empty or binary file added
tests/abrt-faf-elfutils-IO-default-xsputn/runtest.sh
file added
+48
@@ -0,0 +1,48 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/abrt-faf-elfutils-IO-default-xsputn

+ #   Description: abrt-faf-elfutils-IO-default-xsputn

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

+ #

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

+ #

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

+     rlPhaseStartSetup

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

+         rlRun "cp eu-readelf-n-crash.core.xz $TMPD/"

+         rlRun "pushd $TMPD"

+         rlRun "unxz eu-readelf-n-crash.core.xz"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "eu-readelf -n ./eu-readelf-n-crash.core"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

+         rlRun "rm -r $TMPD"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/eu-stack-killed-by-SIGABRT-processing-gcore/Makefile
file added
+64
@@ -0,0 +1,64 @@

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

+ #

+ #   Makefile of /tools/elfutils/eu-stack-killed-by-SIGABRT-processing-gcore

+ #   Description: Test for eu-stack killed by SIGABRT processing gcore

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

+ #

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

+ #

+ #   Copyright (c) 2017 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/elfutils/eu-stack-killed-by-SIGABRT-processing-gcore

+ 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 eu-stack killed by SIGABRT processing gcore" >> $(METADATA)

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

+ 	@echo "TestTime:        48h" >> $(METADATA)

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

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

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

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

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

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

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

+ 	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

tests/eu-stack-killed-by-SIGABRT-processing-gcore/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/eu-stack-killed-by-SIGABRT-processing-gcore

+ Description: Test for eu-stack killed by SIGABRT processing gcore

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

+ Bug summary: eu-stack killed by SIGABRT processing gcore created core file

tests/eu-stack-killed-by-SIGABRT-processing-gcore/runtest.sh
file added
+66
@@ -0,0 +1,66 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/eu-stack-killed-by-SIGABRT-processing-gcore

+ #   Description: Test for eu-stack killed by SIGABRT processing gcore

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

+ #

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

+ #

+ #   Copyright (c) 2017 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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlRun "rpm -q elfutils"

+         rlRun "rpm -q gdb"

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

+         rlRun "pushd $TMPD"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         sleep 1000 &

+         SLEEP_PID=$!

+         rlRun "gcore $SLEEP_PID"

+         # On some arches, such as aarch64, or s390x, eu-stack doesn't end at some

+         # reasonable point, when printing the trace, and goes across main, to

+         # __libc_start_main and even higher and then finally complains about

+         # "no matching address range".  But we don't want to be so strict to check

+         # for this right now.  Mark Wielaard says it is okay, so I trust him ...

+         # Following assert fails when we get SEGV, which would be a bug, which

+         # reproduces e.g. on f25 using elfutils-0.166-2.fc25, or on rhel-7.3

+         # using elfutils-0.166-2.el7.

+         rlRun "eu-stack --executable=$(which sleep) --core=core.$SLEEP_PID > output.txt" 0,1

+         # Print the output.  Yeah, this could be done using tee or something in

+         # the above line and play games with exitcodes within a pipe chain, but

+         # this actually is https://en.wikipedia.org/wiki/KISS_principle :)

+         rlRun "cat output.txt"

+         # ... we do want to check at least that "main" was listed in the trace.

+         rlRun "awk {'print \$3'} output.txt | grep ^main$"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

+         rlRun "rm -r $TMPD"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/eu-strip-invalid-section-alignment-while/Makefile
file added
+64
@@ -0,0 +1,64 @@

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

+ #

+ #   Makefile of /tools/elfutils/eu-strip-invalid-section-alignment-while

+ #   Description: eu-strip-invalid-section-alignment-while

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

+ #

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

+ #

+ #   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/.

+ #

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

+ 

+ export TEST=/tools/elfutils/eu-strip-invalid-section-alignment-while

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE testprog.c testprog2.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:           Martin Cermak <mcermak@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     eu-strip-invalid-section-alignment-while" >> $(METADATA)

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

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

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

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

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

+ 	@echo "Requires:        libaio-devel which" >> $(METADATA)

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/eu-strip-invalid-section-alignment-while/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/eu-strip-invalid-section-alignment-while

+ Description: eu-strip-invalid-section-alignment-while

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

+ Bug summary: eu-strip: invalid section alignment while stripping debuginfo from executables

tests/eu-strip-invalid-section-alignment-while/runtest.sh
file added
+66
@@ -0,0 +1,66 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/eu-strip-invalid-section-alignment-while

+ #   Description: eu-strip-invalid-section-alignment-while

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

+ #

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

+ #

+ #   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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="elfutils"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         for p in gcc eu-strip; do

+             rlRun "which $p"

+             rlRun "rpm -qf $( which $p )"

+         done

+         rlRun "tmp=$(mktemp -d)"

+         rlRun "cp testprog.c testprog2.c $tmp" 

+         rlRun "pushd $tmp"

+     rlPhaseEnd

+ 

+     if rpm -q libaio-devel; then

+         rlPhaseStart FAIL customer-testcase

+             rlRun "gcc testprog.c -laio -g -o testprog"

+             rlRun "eu-strip testprog"

+         rlPhaseEnd

+     fi

+ 

+     rlPhaseStart FAIL upstream-testcase

+         rlRun "gcc -g testprog2.c -o testprog2"

+         # Testcase for this fix should at some point reach the upstream and

+         # the rhel package too. After that this QE testcase should be obsoleted.

+         # Please, refer to:

+         # https://lists.fedorahosted.org/archives/list/elfutils-devel@lists.fedorahosted.org/message/OP6AXOW5PF6GPB4KN7XQZSZ5JY6RK52U/

+         rlRun "eu-strip testprog2"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

+         rlRun "rm -r $tmp"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/eu-strip-invalid-section-alignment-while/testprog.c
file added
+115
@@ -0,0 +1,115 @@

+ /*

+  *   aio-dio-subblock-eof-read - test AIO read of last block of DIO file

+  *   Copyright (C) 2005 Jeff Moyer

+  *

+  *   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, write to the Free Software

+  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

+  */

+  

+ /*

+  *  Code taken from an example posted to linux-aio at kvack.org

+  *  http://marc.info/?l=linux-aio&m=112263621431161&w=2

+  *  Original Author: Drangon Zhou

+  *  Munged & rewritten by Jeff Moyer.

+  *

+  *  Description:  This source code implements a test to ensure that an AIO

+  *  read of the last block in a file opened with O_DIRECT returns the proper

+  *  amount of data.  In the past, there was a bug that resulted in a return

+  *  value of the requested block size, when in fact there was only a fraction

+  *  of that data available.  Thus, if the last data block contained 300 bytes

+  *  worth of data, and the user issued a 4k read, we want to ensure that

+  *  the return value is 300, not 4k.

+  */

+ #define _GNU_SOURCE

+ #include <stdio.h>

+ #include <stdlib.h>

+ #include <libaio.h>

+ #include <fcntl.h>

+ #include <unistd.h>

+ #include <errno.h>

+ 

+ /* Create a file of a size that is not a multiple of block size */

+ #define FILE_SIZE 300

+ 

+ #define fail(fmt , args...) \

+ do {\

+ printf(fmt , ##args);\

+ exit(1);\

+ } while (0)

+ 

+ static unsigned char buffer[4096] __attribute((aligned (4096)));

+ 

+ int

+ main(int argc, char **argv)

+ {

+ int ret;

+ int fd;

+ const char *filename;

+ struct iocb myiocb;

+ struct iocb *cb = &myiocb;

+ io_context_t ioctx;

+ struct io_event ie;

+     

+ if (argc != 2)

+ fail("only arg should be file name");

+ 

+ filename = argv[1];

+ fd = open(filename, O_CREAT|O_RDWR|O_DIRECT, 0600);

+ if (fd < 0)

+ fail("open returned error %d\n", errno);

+ 

+ ret = ftruncate(fd, FILE_SIZE);

+ if (ret < 0)

+ fail("truncate returned error %d\n", errno);

+ 

+ /* <1> use normal disk read, this should be ok */

+ ret = read(fd, buffer, 4096);

+ if (ret != FILE_SIZE)

+ fail("buffered read returned %d, should be 300\n", ret);

+ 

+ /* <2> use AIO disk read, it sees error. */

+ memset(&myiocb, 0, sizeof(myiocb));

+ cb->data = 0;

+ cb->key = 0;

+ cb->aio_lio_opcode = IO_CMD_PREAD;

+ cb->aio_reqprio = 0; 

+ cb->aio_fildes = fd; 

+ cb->u.c.buf = buffer;

+ cb->u.c.nbytes = 4096;

+ cb->u.c.offset = 0;

+     

+ ret = io_queue_init(1, &ioctx);

+ if (ret != 0)

+ fail("io_queue_init returned error %d\n", ret);

+ 

+ ret = io_submit(ioctx, 1, &cb);

+ if (ret != 1)

+ fail("io_submit returned error %d\n", ret);

+ 

+ ret = io_getevents(ioctx, 1, 1, &ie, NULL);

+ if (ret != 1)

+ fail("io_getevents returned %d\n", ret);

+ 

+ /*

+  *  If all goes well, we should see 300 bytes read.  If things

+  *  are broken, we may very well see a result of 4k.

+  */

+ if (ie.res != FILE_SIZE)

+ fail("AIO read of last block in file returned %ld bytes, "

+      "expected %d\n", ie.res, FILE_SIZE);

+ 

+ printf("AIO read of last block in file succeeded.\n");

+ return 0;

+ }

+ 

tests/eu-strip-invalid-section-alignment-while/testprog2.c
file added
+12
@@ -0,0 +1,12 @@

+ static unsigned char buffer[4096] __attribute((aligned (4096)));

+ char

+ f (int i)

+ {

+     return buffer[i];

+ }

+ 

+ int

+ main (int argc, char **argv)

+ {

+     return buffer[argc] == 0;

+ }

tests/eu-unstrip-M-abort-on-socket-line/Makefile
file added
+63
@@ -0,0 +1,63 @@

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

+ #

+ #   Makefile of /tools/elfutils/eu-unstrip-M-abort-on-socket-line

+ #   Description: Test for eu-unstrip -M abort on socket line)

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/elfutils/eu-unstrip-M-abort-on-socket-line

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE proc_maps.txt

+ 

+ .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:           Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for eu-unstrip -M abort on socket line)" >> $(METADATA)

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

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

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

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

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/eu-unstrip-M-abort-on-socket-line/PURPOSE
file added
+15
@@ -0,0 +1,15 @@

+ PURPOSE of /tools/elfutils/eu-unstrip-M-abort-on-socket-line

+ Description: Test for  eu-unstrip -M abort on socket line)

+ Author: Dagmar Prokopova <dprokopo@redhat.com>

+ Bug summary: [RHDT] eu-unstrip -M abort on socket: line

+ Cause: 

+ libdwfl would reject any lines from /proc/pid/maps, that didn't look like either a file mapping, or certain non-file mappings.  The pattern of lines corresponding to sockets was not recognized, and caused a failure of internal consistency check.

+ 

+ Consequence:

+ libdwfl would crash when processing /proc/pid/maps.

+ 

+ Fix:

+ Pattern for recognizing file and non-file mappings was extended to capture socket lines (and other types of non-file lines).

+ 

+ Result:

+ libdwfl never crashes due to malformed /proc/pid/maps.

tests/eu-unstrip-M-abort-on-socket-line/proc_maps.txt
file added
+82
@@ -0,0 +1,82 @@

+ 00400000-024aa000 r-xp 00000000 08:02 159659                             /opt/MessageRouter/bin/msgrouter_dbg

+ 026aa000-026b2000 rwxp 020aa000 08:02 159659                             /opt/MessageRouter/bin/msgrouter_dbg

+ 026b2000-026bf000 rwxp 00000000 00:00 0

+ 0335a000-03e6f000 rwxp 00000000 00:00 0                                  [heap]

+ 2b7b2d6fa000-2b7b2d71a000 r-xp 00000000 08:02 128802                     /lib64/ld-2.12.so

+ 2b7b2d71a000-2b7b2d89c000 rwxp 00000000 00:00 0

+ 2b7b2d919000-2b7b2d91a000 r-xp 0001f000 08:02 128802                     /lib64/ld-2.12.so

+ 2b7b2d91a000-2b7b2d91b000 rwxp 00020000 08:02 128802                     /lib64/ld-2.12.so

+ 2b7b2d91b000-2b7b2d91c000 rwxp 00000000 00:00 0

+ 2b7b2d91c000-2b7b2d933000 r-xp 00000000 08:02 128833                     /lib64/libpthread-2.12.so

+ 2b7b2d933000-2b7b2db32000 ---p 00017000 08:02 128833                     /lib64/libpthread-2.12.so

+ 2b7b2db32000-2b7b2db33000 r-xp 00016000 08:02 128833                     /lib64/libpthread-2.12.so

+ 2b7b2db33000-2b7b2db34000 rwxp 00017000 08:02 128833                     /lib64/libpthread-2.12.so

+ 2b7b2db34000-2b7b2db39000 rwxp 00000000 00:00 0

+ 2b7b2db39000-2b7b2db40000 r-xp 00000000 08:02 128837                     /lib64/librt-2.12.so

+ 2b7b2db40000-2b7b2dd3f000 ---p 00007000 08:02 128837                     /lib64/librt-2.12.so

+ 2b7b2dd3f000-2b7b2dd40000 r-xp 00006000 08:02 128837                     /lib64/librt-2.12.so

+ 2b7b2dd40000-2b7b2dd41000 rwxp 00007000 08:02 128837                     /lib64/librt-2.12.so

+ 2b7b2dd41000-2b7b2dd43000 r-xp 00000000 08:02 128815                     /lib64/libdl-2.12.so

+ 2b7b2dd43000-2b7b2df43000 ---p 00002000 08:02 128815                     /lib64/libdl-2.12.so

+ 2b7b2df43000-2b7b2df44000 r-xp 00002000 08:02 128815                     /lib64/libdl-2.12.so

+ 2b7b2df44000-2b7b2df45000 rwxp 00003000 08:02 128815                     /lib64/libdl-2.12.so

+ 2b7b2df45000-2b7b2e032000 r-xp 00000000 08:02 276647                     /usr/lib64/libboost_regex.so.5

+ 2b7b2e032000-2b7b2e232000 ---p 000ed000 08:02 276647                     /usr/lib64/libboost_regex.so.5

+ 2b7b2e232000-2b7b2e239000 rwxp 000ed000 08:02 276647                     /usr/lib64/libboost_regex.so.5

+ 2b7b2e239000-2b7b2e23a000 rwxp 00000000 00:00 0

+ 2b7b2e23a000-2b7b2e322000 r-xp 00000000 08:02 260385                     /usr/lib64/libstdc++.so.6.0.13

+ 2b7b2e322000-2b7b2e522000 ---p 000e8000 08:02 260385                     /usr/lib64/libstdc++.so.6.0.13

+ 2b7b2e522000-2b7b2e529000 r-xp 000e8000 08:02 260385                     /usr/lib64/libstdc++.so.6.0.13

+ 2b7b2e529000-2b7b2e52b000 rwxp 000ef000 08:02 260385                     /usr/lib64/libstdc++.so.6.0.13

+ 2b7b2e52b000-2b7b2e540000 rwxp 00000000 00:00 0

+ 2b7b2e540000-2b7b2e5c3000 r-xp 00000000 08:02 128817                     /lib64/libm-2.12.so

+ 2b7b2e5c3000-2b7b2e7c2000 ---p 00083000 08:02 128817                     /lib64/libm-2.12.so

+ 2b7b2e7c2000-2b7b2e7c3000 r-xp 00082000 08:02 128817                     /lib64/libm-2.12.so

+ 2b7b2e7c3000-2b7b2e7c4000 rwxp 00083000 08:02 128817                     /lib64/libm-2.12.so

+ 2b7b2e7c4000-2b7b2e7da000 r-xp 00000000 08:02 136724                     /lib64/libgcc_s-4.4.6-20110824.so.1

+ 2b7b2e7da000-2b7b2e9d9000 ---p 00016000 08:02 136724                     /lib64/libgcc_s-4.4.6-20110824.so.1

+ 2b7b2e9d9000-2b7b2e9da000 rwxp 00015000 08:02 136724                     /lib64/libgcc_s-4.4.6-20110824.so.1

+ 2b7b2e9da000-2b7b2e9db000 rwxp 00000000 00:00 0

+ 2b7b2e9db000-2b7b2eb72000 r-xp 00000000 08:02 128809                     /lib64/libc-2.12.so

+ 2b7b2eb72000-2b7b2ed72000 ---p 00197000 08:02 128809                     /lib64/libc-2.12.so

+ 2b7b2ed72000-2b7b2ed76000 r-xp 00197000 08:02 128809                     /lib64/libc-2.12.so

+ 2b7b2ed76000-2b7b2ed77000 rwxp 0019b000 08:02 128809                     /lib64/libc-2.12.so

+ 2b7b2ed77000-2b7b2ed7c000 rwxp 00000000 00:00 0

+ 2b7b2ed7c000-2b7b2eebb000 r-xp 00000000 08:02 276645                     /usr/lib64/libicuuc.so.42.1

+ 2b7b2eebb000-2b7b2f0bb000 ---p 0013f000 08:02 276645                     /usr/lib64/libicuuc.so.42.1

+ 2b7b2f0bb000-2b7b2f0cc000 rwxp 0013f000 08:02 276645                     /usr/lib64/libicuuc.so.42.1

+ 2b7b2f0cc000-2b7b2f0ce000 rwxp 00000000 00:00 0

+ 2b7b2f0ce000-2b7b2f256000 r-xp 00000000 08:02 276635                     /usr/lib64/libicui18n.so.42.1

+ 2b7b2f256000-2b7b2f456000 ---p 00188000 08:02 276635                     /usr/lib64/libicui18n.so.42.1

+ 2b7b2f456000-2b7b2f463000 rwxp 00188000 08:02 276635                     /usr/lib64/libicui18n.so.42.1

+ 2b7b2f463000-2b7b2f465000 rwxp 00000000 00:00 0

+ 2b7b2f465000-2b7b303aa000 r-xp 00000000 08:02 276633                     /usr/lib64/libicudata.so.42.1

+ 2b7b303aa000-2b7b305a9000 ---p 00f45000 08:02 276633                     /usr/lib64/libicudata.so.42.1

+ 2b7b305a9000-2b7b305aa000 rwxp 00f44000 08:02 276633                     /usr/lib64/libicudata.so.42.1

+ 2b7b305aa000-2b7b313f5000 rwxp 00000000 00:00 0

+ 2b7b313f5000-2b7b313f6000 ---p 00000000 00:00 0

+ 2b7b313f6000-2b7b31df6000 rwxp 00000000 00:00 0

+ 2b7b31df6000-2b7b31df7000 ---p 00000000 00:00 0

+ 2b7b31df7000-2b7b327f7000 rwxp 00000000 00:00 0

+ 2b7b34000000-2b7b34021000 rwxp 00000000 00:00 0

+ 2b7b34021000-2b7b38000000 ---p 00000000 00:00 0

+ 2b7b38000000-2b7b38282000 rwxp 00000000 00:00 0

+ 2b7b38282000-2b7b38302000 rwxs 00000000 00:06 493872                     socket:[493872]

+ 2b7b38302000-2b7b38312000 rwxs 00000000 00:06 493872                     socket:[493872]

+ 2b7b38312000-2b7b38b12000 r-xs 00000000 00:06 493872                     socket:[493872]

+ 2b7b38b12000-2b7b38b22000 rwxs 00000000 00:06 493872                     socket:[493872]

+ 2b7b38b22000-2b7b39322000 rwxs 00000000 00:06 493872                     socket:[493872]

+ 2b7b39322000-2b7b39323000 ---p 00000000 00:00 0

+ 2b7b39323000-2b7b39d23000 rwxp 00000000 00:00 0

+ 2b7b3c000000-2b7b3c021000 rwxp 00000000 00:00 0

+ 2b7b3c021000-2b7b40000000 ---p 00000000 00:00 0

+ 2b7b40000000-2b7b40021000 rwxp 00000000 00:00 0

+ 2b7b40021000-2b7b44000000 ---p 00000000 00:00 0

+ 2b7b44010000-2b7b4401c000 r-xp 00000000 08:02 128825                     /lib64/libnss_files-2.12.so

+ 2b7b4401c000-2b7b4421c000 ---p 0000c000 08:02 128825                     /lib64/libnss_files-2.12.so

+ 2b7b4421c000-2b7b4421d000 r-xp 0000c000 08:02 128825                     /lib64/libnss_files-2.12.so

+ 2b7b4421d000-2b7b4421e000 rwxp 0000d000 08:02 128825                     /lib64/libnss_files-2.12.so

+ 2b7b4439f000-2b7b45ea1000 rwxp 00000000 00:00 0

+ 7fff26cf7000-7fff26d0c000 rwxp 00000000 00:00 0                          [stack]

+ 7fff26dff000-7fff26e00000 r-xp 00000000 00:00 0                          [vdso]

+ ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

tests/eu-unstrip-M-abort-on-socket-line/runtest.sh
file added
+54
@@ -0,0 +1,54 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/eu-unstrip-M-abort-on-socket-line

+ #   Description: Test for eu-unstrip -M abort on socket line

+ #   Author: Dagmar Prokopova <dprokopo@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2013 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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="elfutils"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

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

+         # We need a reproducer.

+         cp -v proc_maps.txt $TmpDir

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         #No Abort here.

+         rlRun "eu-unstrip -n -M proc_maps.txt " 0

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/eu-unstrip-unwilling-to-reassembled-corrupted/Makefile
file added
+62
@@ -0,0 +1,62 @@

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

+ #

+ #   Makefile of /tools/elfutils/eu-unstrip-unwilling-to-reassembled-corrupted

+ #   Description: Test for eu-unstrip unwilling to reassembled corrupted

+ #   Author: Vaclav Kadlcik <vkadlcik@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/elfutils/eu-unstrip-unwilling-to-reassembled-corrupted

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE ld.bz2 ld.debug.bz2

+ 

+ .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:           Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for eu-unstrip unwilling to reassembled corrupted" >> $(METADATA)

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

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

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

+ 	@echo "Requires:        elfutils bzip2 file" >> $(METADATA)

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/eu-unstrip-unwilling-to-reassembled-corrupted/PURPOSE
file added
+8
@@ -0,0 +1,8 @@

+ PURPOSE of /tools/elfutils/eu-unstrip-unwilling-to-reassembled-corrupted

+ Description: Test for eu-unstrip unwilling to reassembled corrupted

+ Author: Vaclav Kadlcik <vkadlcik@redhat.com>

+ Bug summary: eu-unstrip unwilling to reassembled corrupted separate debuginfo

+ 

+ Make sure eu-unstrip can merge (when forced) a stripped binary and a separate

+ debuginfo in spite of the debuginfo was produced by a buggy version of binutils 

+ The test is based on Mark Wielaard's suggestion in Bugzilla.

tests/eu-unstrip-unwilling-to-reassembled-corrupted/ld.bz2
file added
empty or binary file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/ld.debug.bz2
file added
empty or binary file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/runtest.sh
file added
+75
@@ -0,0 +1,75 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/eu-unstrip-unwilling-to-reassembled-corrupted

+ #   Description: Test for eu-unstrip unwilling to reassembled corrupted

+ #   Author: Vaclav Kadlcik <vkadlcik@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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="elfutils"

+ 

+ TEST_STRIPPED='ld' # see PURPOSE

+ TEST_DEBUGIFO='ld.debug' # ditto

+ TEST_MERGED='ld-debug'

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

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

+         rlRun "cp ${TEST_STRIPPED}.bz2 ${TEST_DEBUGIFO}.bz2 $TmpDir" 0 "Copying test files"

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+ 

+         rlRun "bunzip2 ${TEST_STRIPPED}.bz2" 0

+         rlRun "bunzip2 ${TEST_DEBUGIFO}.bz2" 0

+         rlAssertExists "$TEST_STRIPPED"

+         rlAssertExists "$TEST_DEBUGIFO"

+ 

+         rlRun -t -s "eu-unstrip -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 1 'unstrip with corrupted debuginfo'

+         rlAssertNotExists "$TEST_MERGED"

+         rlAssertGrep '^STDERR:.*ELF header identification.*different, use --force' "$rlRun_LOG"

+ 

+         rlRun -t -s "eu-unstrip --force -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 0 'Forced unstrip with corrupted debuginfo'

+         rlAssertExists "$TEST_MERGED"

+         rlAssertGrep '^STDERR:.*WARNING:.*ELF header identification.*different' "$rlRun_LOG"

+ 

+         rlRun -t -s "file $TEST_MERGED" 0 'Detecting type of merged file'

+         rlAssertGrep '^STDOUT:.*not stripped$' "$rlRun_LOG"

+ 

+         rlRun -s "eu-objdump -s $TEST_MERGED" 0 'Running objdump on merged file'

+         rlAssertGrep '^Contents of section .debug_info:' "$rlRun_LOG"

+         rlAssertGrep '^Contents of section .debug_line:' "$rlRun_LOG"

+ 

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/readelf-segfault-tests/Makefile
file added
+65
@@ -0,0 +1,65 @@

+ # Makefile - readelf-segfault-tests 

+ # Author: Petr Muller <pmuller@redhat.com>

+ # Location: /tools/elfutils/readelf-segfault-tests/Makefile

+ 

+ # Description: Tests various ELFs on various utils, looking for segfaults

+ 

+ # Copyright (c) 2008 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 v.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.

+  

+ 

+ 

+ TOPLEVEL_NAMESPACE=/tools

+ PACKAGE_NAME=elfutils

+ RELATIVE_PATH=/readelf-segfault-tests

+ 

+ export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ testcases.tar.gz:

+ 	tar cfz testcases.tar.gz binaries/*

+ 

+ FILES=$(METADATA) runtest.sh Makefile testcases.tar.gz testprog.c

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	chmod a+x ./runtest.sh

+ 

+ clean:

+ 	rm -f *~ $(BUILT_FILES)

+ 

+ 

+ include /usr/share/rhts/lib/rhts-make.include

+ 

+ 

+ $(METADATA): Makefile

+ 	@touch $(METADATA)

+ 	@echo "Owner:        Petr Muller <pmuller@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:  Tests various ELFs on various utils, looking for segfaults" >> $(METADATA)

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

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

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

tests/readelf-segfault-tests/PURPOSE
file added
+10
@@ -0,0 +1,10 @@

+ Test Name: readelf-segfault-tests

+ Author: Petr Muller <pmuller@redhat.com>

+ Location: /tools/elfutils/readelf-segfault-tests

+ 

+ Short Description: Tests various ELFs on various utils, looking for segfaults

+ 

+ 

+ Long Description:

+ 

+ Tests various ELFs on various utils, looking for segfaults

tests/readelf-segfault-tests/runtest.sh
file added
+160
@@ -0,0 +1,160 @@

+ #!/bin/bash

+ # runtest.sh - readelf-segfault-tests

+ # Author: Petr Muller <pmuller@redhat.com>

+ # Location: /tools/elfutils/readelf-segfault-tests/runtest.sh

+ 

+ # Description: Tests various ELFs on various utils, looking for segfaults

+ 

+ # Copyright (c) 2008 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 v.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.

+ 

+ test_binary(){

+   command="$1"

+   args="$2"

+   expected="$3"

+   comment="$4"

+ 

+   echo $command >> $TESTED

+   rlRun "$command $args > /dev/null" $expected "$comment"

+   excode=$?

+   if [ $excode -gt 127 ]

+   then

+     rlLog "Unusual exit code: $excode"

+   fi

+ }

+ 

+ PACKAGE=elfutils

+ 

+ . /usr/share/beakerlib/beakerlib.sh

+ 

+ rlJournalStart

+ 

+ rlPhaseStartSetup "Setting up testcases"

+   tar xfz testcases.tar.gz

+   rlAssertExists binaries

+   export TESTED=`mktemp`

+   export TOBE=`mktemp`

+ 

+   rlRun "gcc -o binaries/testprog -g testprog.c"

+ 

+   for file in $(rpm -ql `rpm -qa | grep elfutils` | grep 'bin' | grep -v '\.')

+   do

+     NAME=`basename $file`

+     if [ "$NAME" != "bin" ]

+     then

+       basename $file >> $TOBE

+     fi

+   done

+   sort $TOBE -o $TOBE

+ rlPhaseEnd

+ 

+ pushd binaries &> /dev/null

+ for arch in i386  ia64 ppc ppc64 s390 s390x x86_64

+ do

+   rlPhaseStartTest "Testing $arch binary inputs"

+     if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7

+     then

+       test_binary "eu-elfcmp" "eu-readelf-$arch eu-readelf-$arch" 0 "Testing eu-elfcmp on identical files"

+     fi

+ 

+     test_binary "eu-elflint" "eu-readelf-$arch" 0,1 "Testing elflint without --gnu-ld"

+     test_binary "eu-elflint" "eu-readelf-$arch -q --gnu-ld" 0,1 "Testing elflint with --gnu-ld"

+     test_binary "eu-nm" "eu-readelf-$arch" 1 "Testing nm"

+     test_binary "eu-nm" "-D eu-readelf-$arch" 0 "Testing nm -D"

+ 

+     if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7

+     then

+       test_binary "eu-objdump" "-ds eu-readelf-$arch" 0,1 "Testing objdump -ds"

+     fi

+ 

+     options="-A0 -d0 -h0 -I0 -l0 -n0 -r0 -s0 -S0 -V0 -w1"

+     options="-a0 $options"

+ 

+     if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7

+     then

+       options="$options -c1 -p0"

+     fi

+ 

+     for option in $options

+     do

+       opt=${option:0:2}

+       exp=${option:2}

+       test_binary "eu-readelf" "$opt eu-readelf-$arch" $exp "Testing readelf $opt"

+     done

+     test_binary "eu-size" "eu-readelf-$arch" 0 "Testing eu-size"

+     if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7

+     then

+       test_binary "eu-strings" "eu-readelf-$arch" 0 "Testing eu-strings"

+     fi

+     test_binary "eu-strip" "eu-readelf-$arch" 0 "Testing eu-strip"

+ 

+     test_binary "eu-ar" "rcs test.a eu-readelf-$arch" 0 "Testing eu-ar - creating an archive"

+     test_binary "eu-ar" "pv test.a" 0 "Testing eu-ar - print the list of modules"

+     test_binary "eu-ar" "tv test.a" 0 "Testing eu-ar - print the file table"

+ 

+     test_binary "eu-ranlib" "test.a" 0 "Testing eu-ranlib"

+ 

+     # This test should be done better - eu-make-debug-archive should do real things

+     test_binary "eu-make-debug-archive" "--kernel test.a" 0,1 "Testing eu-make-debug-archive"

+ 

+     # This test should be done better - eu-findtextrel should do real things

+     test_binary "eu-findtextrel" "eu-readelf-$arch" 0,1 "Testing eu-findtextrel"

+ 

+     test_binary "eu-addr2line" "stderr -A -f -e eu-readelf-$arch" 0 "Testing eu-addr2line"

+ 

+ 	rlRun "objcopy --only-keep-debug testprog testprog.debuginfo"

+ 	rlRun "eu-strip --strip-debug -o testprog.stripped testprog"

+     test_binary "eu-unstrip" "-o testprog.restored testprog.stripped testprog.debuginfo" 0 "Testing eu-unstrip"

+ 

+   rlPhaseEnd

+ done

+ 

+ rlPhaseStart FAIL "eu-stack specific asserts (in elfutils since 0.158)"

+     if grep -q '^eu-stack$' $TOBE

+     then

+         test_binary "eu-stack" "-p 1" 0,1 "Testing eu-stack"

+     fi

+ rlPhaseEnd

+ 

+ rlPhaseStart FAIL "eu-elfcompress specific asserts (in elfutils since 0.165)"

+     # eu-elfcompress

+     if grep -q '^eu-elfcompress$' $TOBE

+     then

+         for i in zlib zlib-gabi gnu zlib-gnu; do

+             test_binary "eu-elfcompress" "-o testprog.compressed.$i -t $i testprog" 0 "Testing eu-elfcompress ($i)"

+             rlRun "eu-elfcmp testprog testprog.compressed.$i"

+             test_binary "eu-elfcompress" "-o testprog.uncompressed -t none testprog" 0 "Testing eu-elfcompress (none)"

+             rlRun "eu-elfcmp testprog testprog.uncompressed"

+         done

+     fi

+ rlPhaseEnd

+ 

+ popd &> /dev/null

+ 

+ rlPhaseStartTest "Testing if complete elfutils were tested"

+   sort -u $TESTED -o $TESTED

+   for file in `cat $TOBE`

+   do

+     rlLog "Checking if $file was tested"

+     rlAssertGrep $file $TESTED

+   done

+ rlPhaseEnd

+ 

+ rlPhaseStartCleanup

+   rm -rf binaries $TOBE $TESTED

+   rm -f test.a testprog testprog.debuginfo testprog.stripped testprog.restored

+   rlAssertNotExists binaries

+ rlPhaseEnd

+ 

+ rlJournalPrintText

+ rlJournalEnd

tests/readelf-segfault-tests/testcases.tar.gz
file added
empty or binary file added
tests/readelf-segfault-tests/testprog.c
file added
+21
@@ -0,0 +1,21 @@

+ #include <stdlib.h>

+ #include <stdio.h>

+ 

+ int addfunc(int a, int b)

+ {

+ 	return a + b;

+ }

+ 

+ int main(int argc, char **argv)

+ {

+ 	int p, q, res;

+ 	

+ 	scanf("%i", &p);

+ 	scanf("%i", &q);

+ 	

+ 	res = addfunc(p, q);

+ 	

+ 	printf("%i\n", res);

+ 	

+ 	return 0;

+ }

tests/tests.yml
file added
+33
@@ -0,0 +1,33 @@

+ - hosts: localhost

+   tags:

+   - classic

+   - container

+   - atomic

+   roles:

+   - role: standard-test-beakerlib

+     tests:

+     - Stack-overflow-in-dwarf-getsrclines

+     - Support-64-bit-SYM64-symbol-table

+     - When-linking-statically-only-against-elfutils

+     - abrt-faf-elfutils-IO-default-xsputn

+     - eu-stack-killed-by-SIGABRT-processing-gcore

+     - eu-strip-invalid-section-alignment-while

+     - eu-unstrip-M-abort-on-socket-line

+     - eu-unstrip-unwilling-to-reassembled-corrupted

+     - readelf-segfault-tests

+     - yama-scope

+     required_packages:

+     - bzip2

+     - elfutils

+     - elfutils-libelf

+     - elfutils-libelf-devel

+     - elfutils-libs

+     - file

+     - gcc

+     - gdb

+     - glibc

+     - glibc-static

+     - libaio-devel

+     - which

+     - xz

+ 

tests/yama-scope/Makefile
file added
+65
@@ -0,0 +1,65 @@

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

+ #

+ #   Makefile of /tools/elfutils/yama-scope

+ #   Description: yama-scope

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

+ #

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

+ #

+ #   Copyright (c) 2017 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/elfutils/yama-scope

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE ptrace-scope-test.sh

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	test -x runtest.sh || chmod a+x runtest.sh

+ 	cp ptrace-scope-test.sh /tmp/

+ 	test -x /tmp/ptrace-scope-test.sh || chmod a+x /tmp/ptrace-scope-test.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:     yama-scope" >> $(METADATA)

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

+ 	@echo "TestTime:        48h" >> $(METADATA)

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

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

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

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

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

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

+ 	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

tests/yama-scope/PURPOSE
file added
+4
@@ -0,0 +1,4 @@

+ PURPOSE of /tools/elfutils/yama-scope

+ Description: yama-scope

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

+ Bug summary: Enable provide_yama_scope for rhel >= 7.4

tests/yama-scope/ptrace-scope-test.sh
file added
+8
@@ -0,0 +1,8 @@

+ #!/bin/bash

+ 

+ RETVAL=0

+ OUT=$(mktemp)

+ eu-stack -p $$ |& tee $OUT

+ grep -i 'operation not permitted' $OUT && RETVAL=1

+ rm $OUT

+ exit $RETVAL

tests/yama-scope/runtest.sh
file added
+118
@@ -0,0 +1,118 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/elfutils/yama-scope

+ #   Description: yama-scope

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

+ #

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

+ #

+ #   Copyright (c) 2017 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/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="elfutils"

+ MY_USER="ptrace_scope_testuser"

+ TESTCASE="/tmp/ptrace-scope-test.sh"

+ PROCFILE='/proc/sys/kernel/yama/ptrace_scope'

+ 

+ if [[ ! -x $TESTCASE ]] ; then

+     cp ptrace-scope-test.sh $TESTCASE

+     chmod a+x $TESTCASE

+ fi

+ 

+ test_root()

+ {

+     $TESTCASE

+ }

+ 

+ test_user()

+ {

+     su - $MY_USER -c $TESTCASE

+ }

+ 

+ rlJournalStart

+     rlPhaseStartTest

+         if test -f $PROCFILE; then

+ 

+ # This can easily be tested with strace. Just cycle through the settings:

+ 

+ # 0 - Default attach security permissions.

+ # 1 - Restricted attach. Only child processes plus normal permissions.

+ # 2 - Admin-only attach. Only executables with CAP_SYS_PTRACE.

+ # 3 - No attach. No process may call ptrace at all. Irrevocable.

+ 

+ # echo 0 > /proc/sys/kernel/yama/ptrace_scope

+ 

+ # With 0, strace works against any process with your uid. For example, strace -p 2190.

+ # With 1, strace errors when doing the same as in 0: strace: attach: ptrace(PTRACE_SEIZE, 3180): Operation not permitted. However, you can strace any program you run from strace, "strace /bin/ls" or example.

+ # With 2, you can only strace from the root account. You can no longer strace commands run from strace.

+ # With 3, even root cannot strace.

+ 

+ # ---

+ 

+ 

+ # ---

+ 

+             rlRun "useradd $MY_USER" 0,9

+ 

+             rlRun "ORIGVAL=$( cat $PROCFILE )"

+ 

+             # First, test the default behaviour, which is "no restriction"

+             # from the ptrace perspective. Here we assume that

+             # elfutils-default-yama-scope.rpm is installed and so the default

+             # yama policy is set to 0 instead of 1 which would otherwise be set

+             # as a kernel default (security/yama/yama_lsm.c ---> YAMA_SCOPE_RELATIONAL)

+             rlRun test_root

+             rlRun test_user

+ 

+             rlRun "echo 0 > $PROCFILE"

+             rlRun test_root

+             rlRun test_user

+             rlRun "echo 1 > $PROCFILE"

+             rlRun test_root

+             rlRun test_user 1

+             rlRun "echo 2 > $PROCFILE"

+             rlRun test_root

+             rlRun test_user 1

+             # Following subtest would be irrevertible (till next reboot)

+             # rlRun "echo 3 > $PROCFILE"

+             # rlRun test_root 1

+             # rlRun test_user 1

+ 

+             rlRun "userdel -f $MY_USER"

+ 

+ # This testcase could be more complex - using child and non-child processes and

+ # performing reboots.  But let's keep this simple, since we are not testing the

+ # kernel facility, but merely an elfutils "plugin" for it, whose purpose is to

+ # set the default yama policy as such.

+ 

+             rlRun "echo $ORIGVAL > $PROCFILE"

+ 

+         else

+             # Yama had been enabled in rhel-7.4 kernel within

+             # dist-git commit 9f3dff2c9ce3a6607c6342fc00b8fc82c6167ec6

+             # which is kernel-3.10.0-677.el7.

+             rlLogInfo "Not a YAMA enabled kernel"

+         fi

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

no initial comment

Justification

Adds tests according to the CI wiki specifically the standard test interface in the spec.

The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Classic and Container. Test logs are stored in the artifacts directory.

The following steps are used to execute the tests using the standard test interface:

Test enveronment

Make sure you have installed packages from the spec

# rpm -q ansible python2-dnf libselinux-python standard-test-roles \
ansible-2.3.2.0-1.fc26.noarch \
python2-dnf-2.6.3-11.fc26.noarch \
libselinux-python-2.6-7.fc26.x86_64 \
standard-test-roles-2.4-1.fc26.noarch

Run tests for Classic

# export TEST_SUBJECTS=
# sudo ansible-playbook --tags classic tests.yml

Snip of the example test run for Classic tests:

TASK [standard-test-beakerlib : Check the results] ******************************************************************************************************************************************************************
changed: [localhost]

PLAY RECAP **********************************************************************************************************************************************************************************************************
localhost                  : ok=15   changed=8    unreachable=0    failed=0   

PASS Stack-overflow-in-dwarf-getsrclines
PASS Support-64-bit-SYM64-symbol-table
PASS When-linking-statically-only-against-elfutils
PASS abrt-faf-elfutils-IO-default-xsputn
PASS eu-stack-killed-by-SIGABRT-processing-gcore
PASS eu-strip-invalid-section-alignment-while
PASS eu-unstrip-M-abort-on-socket-line
PASS eu-unstrip-unwilling-to-reassembled-corrupted
PASS readelf-segfault-tests
PASS yama-scope

Run tests for Container

# export TEST_SUBJECTS=docker:docker.io/library/fedora:26
# sudo ansible-playbook --tags=container tests.yml

Snip of the example test run for Container tests:

fatal: [e73b92ef99063e2952ed73239904f70928bb3df38ecd414b491570d379f7261b]: FAILED! => {"changed": true, "cmd": "grep \"^FAIL\" /tmp/artifacts/test.log", "delta": "0:00:00.117040", "end": "2017-10-23 11:10:00.966163", "failed": true, "failed_when_result": true, "rc": 0, "start": "2017-10-23 11:10:00.849123", "stderr": "", "stderr_lines": [], "stdout": "FAIL readelf-segfault-tests\nFAIL yama-scope", "stdout_lines": ["FAIL readelf-segfault-tests", "FAIL yama-scope"]}
        to retry, use: --limit @/home/fedora/tests/elfutils/tests.retry

PLAY RECAP **********************************************************************************************************************************************************************************************************
e73b92ef99063e2952ed73239904f70928bb3df38ecd414b491570d379f7261b : ok=14   changed=10   unreachable=0    failed=1   

PASS Stack-overflow-in-dwarf-getsrclines
PASS Support-64-bit-SYM64-symbol-table
PASS When-linking-statically-only-against-elfutils
PASS abrt-faf-elfutils-IO-default-xsputn
PASS eu-stack-killed-by-SIGABRT-processing-gcore
PASS eu-strip-invalid-section-alignment-while
PASS eu-unstrip-M-abort-on-socket-line
PASS eu-unstrip-unwilling-to-reassembled-corrupted
PASS readelf-segfault-tests
PASS yama-scope

Snip of the example test run for Atomic tests:

TASK [standard-test-beakerlib : Pull out the logs] ******************************************************************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Check the results] ******************************************************************************************************************************************************************
changed: [localhost]

PLAY RECAP **********************************************************************************************************************************************************************************************************
localhost                  : ok=15   changed=8    unreachable=0    failed=0 

Notes

Tests will be enabled in CI, yet gating is currently disabled, so nothing will change. Tests will run on each dist-git commit, they are not triggered on koji builds and if you are using FMN, it should notify you of failures normally.

The RH QE maintainer contact in case you have questions: sturivny @redhat.com
The idea is that these tests become yours just as you're maintaining the package, there will of course be people around if you have questions or troubles.

Pull-Request has been closed by sturivny

6 years ago
Metadata
Changes Summary 43
+3
file added
tests/README.md
+63
file added
tests/Stack-overflow-in-dwarf-getsrclines/Makefile
+4
file added
tests/Stack-overflow-in-dwarf-getsrclines/PURPOSE
+57
file added
tests/Stack-overflow-in-dwarf-getsrclines/runtest.sh
+0
file added
tests/Stack-overflow-in-dwarf-getsrclines/vpoolengineUS.bz2
+63
file added
tests/Support-64-bit-SYM64-symbol-table/Makefile
+11
file added
tests/Support-64-bit-SYM64-symbol-table/PURPOSE
+0
file added
tests/Support-64-bit-SYM64-symbol-table/libantlr.a.bz2
+65
file added
tests/Support-64-bit-SYM64-symbol-table/runtest.sh
+64
file added
tests/When-linking-statically-only-against-elfutils/Makefile
+4
file added
tests/When-linking-statically-only-against-elfutils/PURPOSE
+73
file added
tests/When-linking-statically-only-against-elfutils/runtest.sh
+62
file added
tests/abrt-faf-elfutils-IO-default-xsputn/Makefile
+4
file added
tests/abrt-faf-elfutils-IO-default-xsputn/PURPOSE
+0
file added
tests/abrt-faf-elfutils-IO-default-xsputn/eu-readelf-n-crash.core.xz
+48
file added
tests/abrt-faf-elfutils-IO-default-xsputn/runtest.sh
+64
file added
tests/eu-stack-killed-by-SIGABRT-processing-gcore/Makefile
+4
file added
tests/eu-stack-killed-by-SIGABRT-processing-gcore/PURPOSE
+66
file added
tests/eu-stack-killed-by-SIGABRT-processing-gcore/runtest.sh
+64
file added
tests/eu-strip-invalid-section-alignment-while/Makefile
+4
file added
tests/eu-strip-invalid-section-alignment-while/PURPOSE
+66
file added
tests/eu-strip-invalid-section-alignment-while/runtest.sh
+115
file added
tests/eu-strip-invalid-section-alignment-while/testprog.c
+12
file added
tests/eu-strip-invalid-section-alignment-while/testprog2.c
+63
file added
tests/eu-unstrip-M-abort-on-socket-line/Makefile
+15
file added
tests/eu-unstrip-M-abort-on-socket-line/PURPOSE
+82
file added
tests/eu-unstrip-M-abort-on-socket-line/proc_maps.txt
+54
file added
tests/eu-unstrip-M-abort-on-socket-line/runtest.sh
+62
file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/Makefile
+8
file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/PURPOSE
+0
file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/ld.bz2
+0
file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/ld.debug.bz2
+75
file added
tests/eu-unstrip-unwilling-to-reassembled-corrupted/runtest.sh
+65
file added
tests/readelf-segfault-tests/Makefile
+10
file added
tests/readelf-segfault-tests/PURPOSE
+160
file added
tests/readelf-segfault-tests/runtest.sh
+0
file added
tests/readelf-segfault-tests/testcases.tar.gz
+21
file added
tests/readelf-segfault-tests/testprog.c
+33
file added
tests/tests.yml
+65
file added
tests/yama-scope/Makefile
+4
file added
tests/yama-scope/PURPOSE
+8
file added
tests/yama-scope/ptrace-scope-test.sh
+118
file added
tests/yama-scope/runtest.sh