#10 Import 3 regression tests from RHEL
Merged 3 years ago by mcermak. Opened 3 years ago by vkadlcik.
Unknown source rawhide  into  rawhide

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

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

+ #

+ #   Makefile of /tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

+ #   Description: Test for BZ#1624776 (binutils ld removes some R_X86_64_JUMP_SLOT)

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2018 Red Hat, Inc.

+ #

+ #   This program is free software: you can redistribute it and/or

+ #   modify it under the terms of the GNU General Public License as

+ #   published by the Free Software Foundation, either version 2 of

+ #   the License, or (at your option) any later version.

+ #

+ #   This program is distributed in the hope that it will be

+ #   useful, but WITHOUT ANY WARRANTY; without even the implied

+ #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

+ #   PURPOSE.  See the GNU General Public License for more details.

+ #

+ #   You should have received a copy of the GNU General Public License

+ #   along with this program. If not, see http://www.gnu.org/licenses/.

+ #

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

+ 

+ export TEST=/tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE reloc.s

+ 

+ .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:           Edjunior Machado <emachado@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for BZ#1624776 (binutils ld removes some R_X86_64_JUMP_SLOT)" >> $(METADATA)

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

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

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

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

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

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

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

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

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

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

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

+ 

+ 	rhts-lint $(METADATA)

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

+ PURPOSE of /tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

+ Description: Test for BZ#1624776 (binutils ld removes some R_X86_64_JUMP_SLOT)

+ Author: Edjunior Machado <emachado@redhat.com>

+ Bug summary: binutils: ld removes some R_X86_64_JUMP_SLOT relocations

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

@@ -0,0 +1,15 @@

+ summary: Test for BZ#1624776 (binutils ld removes some R_X86_64_JUMP_SLOT)

+ description: |

+     Bug summary: binutils: ld removes some R_X86_64_JUMP_SLOT relocations

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

+ contact: Edjunior Machado <emachado@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - sed

+ duration: 5m

+ extra-summary: /tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

+ extra-task: /tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

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

+ .text

+ mov malloc@GOTPCREL(%rip), %rax

+ jmp malloc@plt

@@ -0,0 +1,59 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/binutils/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT

+ #   Description: Test for BZ#1624776 (binutils ld removes some R_X86_64_JUMP_SLOT)

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2018 Red Hat, Inc.

+ #

+ #   This program is free software: you can redistribute it and/or

+ #   modify it under the terms of the GNU General Public License as

+ #   published by the Free Software Foundation, either version 2 of

+ #   the License, or (at your option) any later version.

+ #

+ #   This program is distributed in the hope that it will be

+ #   useful, but WITHOUT ANY WARRANTY; without even the implied

+ #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

+ #   PURPOSE.  See the GNU General Public License for more details.

+ #

+ #   You should have received a copy of the GNU General Public License

+ #   along with this program. If not, see http://www.gnu.org/licenses/.

+ #

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

+ 

+ # Include Beaker environment

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

+ 

+ PACKAGE="$(rpm -qf $(which ld))"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

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

+         rlRun "cp reloc.s $TmpDir"

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "as -o reloc.o reloc.s"

+         rlAssertExists "reloc.o"

+         rlRun "ld -o reloc.so -shared reloc.o"

+         rlAssertExists "reloc.so"

+         # Conserve the non-zero return value through the pipe

+         set -o pipefail

+         rlRun "readelf -rW reloc.so |& tee readelf.out" 0 "Checking out reloc.so relocation section"

+         rlRun "sed -n '/.rela.dyn/,/^$/p' readelf.out | grep R_X86_64_GLOB_DAT" 0 "Relocation section .rela.dyn should contain R_X86_64_GLOB_DAT entry"

+         rlRun "sed -n '/.rela.plt/,/^$/p' readelf.out | grep R_X86_64_JUMP_SLOT" 0 "Relocation section .rela.plt should contain R_X86_64_JUMP_SLOT entry"

+         rlFileSubmit readelf.out

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,64 @@

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

+ #

+ #   Makefile of /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

+ #   Description: Test for BZ#1693661 (rhel8 gold does not resolve the address of main())

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2019 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/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE main.c foo.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:           Edjunior Machado <emachado@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for BZ#1693661 (rhel8 gold does not resolve the address of main())" >> $(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:             1693661" >> $(METADATA)

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

+ 

+ 	rhts-lint $(METADATA)

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

+ PURPOSE of /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

+ Description: Test for BZ#1693661 (rhel8 gold does not resolve the address of main())

+ Author: Edjunior Machado <emachado@redhat.com>

+ Bug summary: rhel8 gold does not resolve the address of main() when it is in a shared library in aarch64

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

@@ -0,0 +1,4 @@

+ int __attribute__ ((noinline)) foo(int x, int y)

+ {

+     return x & y;

+ }

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

+ #include <stdio.h>

+ extern int foo(int, int);

+ 

+ int main()

+ {

+   printf("%d\n", foo(1, 3));

+   return 0;

+ }

@@ -0,0 +1,15 @@

+ summary: Test for BZ#1693661 (rhel8 gold does not resolve the address of main())

+ description: |

+     Bug summary: rhel8 gold does not resolve the address of main() when it is in a shared library in aarch64

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

+ contact: Edjunior Machado <emachado@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - gcc

+ duration: 5m

+ extra-summary: /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

+ extra-task: /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

@@ -0,0 +1,94 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/binutils/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main

+ #   Description: Test for BZ#1693661 (rhel8 gold does not resolve the address of main())

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

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

+ 

+ LD="${LD:-$(which ld.gold)}"

+ GCC="${GCC:-$(which gcc)}"

+ 

+ PACKAGE="${PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)}"

+ GCC_PACKAGE="${GCC_PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)}"

+ 

+ PACKAGES="${PACKAGES:-$PACKAGE}"

+ REQUIRES="${REQUIRES:-$GCC_PACKAGE}"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlLogInfo "PACKAGES=$PACKAGES"

+         rlLogInfo "REQUIRES=$REQUIRES"

+         rlLogInfo "COLLECTIONS=$COLLECTIONS"

+         rlLogInfo "PACKAGE=$PACKAGE"

+         rlLogInfo "LD=$LD"

+         rlLogInfo "GCC=$GCC"

+ 

+         rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK"

+ 

+         # We optionally need to skip checking for the presence of the metapackage

+         # because that would pull in all the dependent toolset subrpms.  We do not

+         # always want that, especially in CI.

+         _COLLECTIONS="$COLLECTIONS"

+         if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then

+             for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do

+                 rlLogInfo "ignoring metapackage check for collection $c"

+                 export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/})

+             done

+         fi

+ 

+         rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS"

+ 

+         rlAssertRpm --all

+ 

+         export COLLECTIONS="$_COLLECTIONS"

+ 

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

+         rlRun "cp main.c foo.c $TmpDir/"

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "gcc -o main.o -fPIC -c main.c"

+         rlRun "gcc -shared -o libmain.so main.o"

+         rlRun "gcc -o foo.o -c foo.c"

+ 

+         rlLogInfo "Linking with gold..."

+         rlRun "gcc -fuse-ld=gold -o gold.out -lmain -L$PWD -Wl,-v,-rpath=$PWD foo.o"

+         rlAssertExists "gold.out"

+         rlRun "./gold.out" # On bz#1693661, it segfaults

+ 

+         rlLogInfo "Linking with bfd..."

+         rlRun "gcc -fuse-ld=bfd -o bfd.out -lmain -L$PWD -Wl,-v,-rpath=$PWD foo.o"

+         rlAssertExists "bfd.out"

+         rlRun "./bfd.out"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

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

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

+ #

+ #   Makefile of /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections

+ #   Description: Test for BZ#1785294 (binutils support secondary relocation sections)

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2020 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/bz1785294-binutils-support-secondary-relocation-sections

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE kpatch-3_10_0-1062-1-15.x86_64.ko kpatch-3_10_0-1062-1-15.ppc64le.ko

+ 

+ .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:           Edjunior Machado <emachado@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for BZ#1785294 (binutils support secondary relocation sections)" >> $(METADATA)

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

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

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

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

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

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

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

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

+ 	@echo "Bug:             1785294 1804151 1804149 1804148 1801879" >> $(METADATA)

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

+ 	@echo "Architectures:   ppc64le x86_64" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

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

+ PURPOSE of /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections

+ Description: Test for BZ#1785294 (binutils support secondary relocation sections)

+ Author: Edjunior Machado <emachado@redhat.com>

+ Bug summary: binutils: support secondary relocation sections [rhel 7.9]

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

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

+ summary: Test for BZ#1785294 (binutils support secondary relocation sections)

+ description: |

+     Bug summary: binutils: support secondary relocation sections [rhel 7.9]

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

+ contact: Edjunior Machado <emachado@redhat.com>

+ component:

+ - binutils

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - binutils

+ - grep

+ - gawk

+ duration: 10m

+ extra-summary: /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections

+ extra-task: /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections

@@ -0,0 +1,110 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /tools/binutils/Regression/bz1785294-binutils-support-secondary-relocation-sections

+ #   Description: Test for BZ#1785294 (binutils support secondary relocation sections)

+ #   Author: Edjunior Machado <emachado@redhat.com>

+ #

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

+ #

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

+ 

+ OBJCOPY="${OBJCOPY:-$(which objcopy)}"

+ READELF="${READELF:-$(which readelf)}"

+ PACKAGE=$(rpm --qf '%{name}\n' -qf $(which $READELF) | head -1)

+ PACKAGES=${PACKAGE}

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlLogInfo "PACKAGES=$PACKAGES"

+         rlLogInfo "COLLECTIONS=$COLLECTIONS"

+         rlLogInfo "OBJCOPY=$OBJCOPY"

+         rlLogInfo "READELF=$READELF"

+         rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK"

+ 

+         # We optionally need to skip checking for the presence of the metapackage

+         # because that would pull in all the dependent toolset subrpms.  We do not

+         # always want that, especially in CI.

+         _COLLECTIONS="$COLLECTIONS"

+         if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then

+             for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do

+                 rlLogInfo "ignoring metapackage check for collection $c"

+                 export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/})

+             done

+         fi

+ 

+         rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS"

+ 

+         rlAssertRpm --all

+ 

+         export COLLECTIONS="$_COLLECTIONS"

+ 

+         rlRun "SOURCE_DIR=$(pwd)"

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

+         rlRun "pushd $TmpDir"

+     rlPhaseEnd

+ 

+     rlPhaseStart FAIL "Check support"

+         rlRun "ARCH=$(arch)"

+         case "$ARCH" in

+             x86_64 | ppc64le)

+                 KO_FILE="${SOURCE_DIR}/kpatch-3_10_0-1062-1-15.${ARCH}.ko"

+                 rlLogInfo "KO_FILE=$KO_FILE"

+                 HAS_SUPPORT=1

+                 ;;

+             *)

+                 rlLogWarning "Feature not supported on $ARCH"

+                 HAS_SUPPORT=0

+                 ;;

+         esac

+     rlPhaseEnd

+ 

+ if [ $HAS_SUPPORT = 1 ]; then

+     rlPhaseStartTest

+         rlAssertExists $KO_FILE

+         rlRun "set -o pipefail" 0 "Conserve the non-zero return value through the pipe"

+ 

+         # As suggested by nickc@redhat.com:

+         rlRun "objcopy $KO_FILE copy.ko"

+         rlRun "readelf --wide --section-headers copy.ko |& tee readelf_headers.out"

+         rlRun -l "grep \".klp.rela.vmlinux.*\ RELA\ \" readelf_headers.out"

+ 

+         # And as suggested by joe.lawrence@redhat.com:

+         rlRun "readelf --wide --relocs $KO_FILE |& tee readelf_relocs.out"

+         rlRun -l "awk \"/^Relocation section '.klp/\" RS='\n\n' ORS='\n\n' readelf_relocs.out"

+         rlRun -l "grep \"^Relocation section '.klp\" readelf_relocs.out"

+ 

+         rlRun "readelf --wide --symbols $KO_FILE |& tee readelf_symbols.out"

+         # Section index for these symbols must be SHN_LIVEPATCH (0xff20)

+         rlRun -l "grep '\[0xff20\]\ \.klp\.sym' readelf_symbols.out"

+ 

+         rlRun "tar czvf readelf_outputs.tar.gz readelf_headers.out readelf_relocs.out readelf_symbols.out"

+         rlFileSubmit readelf_outputs.tar.gz "${PACKAGE}-readelf_outputs.tar.gz"

+     rlPhaseEnd

+ fi

+ 

+     rlPhaseStartCleanup

+         rlRun "popd"

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

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

Import 3 regression tests from RHEL

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 mcermak

3 years ago
Metadata
Changes Summary 17
+65
file added
tests/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT/Makefile
+5
file added
tests/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT/PURPOSE
+15
file added
tests/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT/main.fmf
+3
file added
tests/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT/reloc.s
+59
file added
tests/Regression/bz1624776-binutils-ld-removes-some-R-X86-64-JUMP-SLOT/runtest.sh
+64
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/Makefile
+5
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/PURPOSE
+4
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/foo.c
+8
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/main.c
+15
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/main.fmf
+94
file added
tests/Regression/bz1693661-rhel8-gold-does-not-resolve-the-address-of-main/runtest.sh
+65
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/Makefile
+5
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/PURPOSE
+0
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.ppc64le.ko
+0
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/kpatch-3_10_0-1062-1-15.x86_64.ko
+16
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/main.fmf
+110
file added
tests/Regression/bz1785294-binutils-support-secondary-relocation-sections/runtest.sh