diff --git a/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/gprof.file.c b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/gprof.file.c new file mode 100644 index 0000000..005c451 --- /dev/null +++ b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/gprof.file.c @@ -0,0 +1,4 @@ +static void fun2(){int i=0;} + void fun1(){int i=0;} + void fun3(){} + int main(){ fun1(); fun2(); return 0;} diff --git a/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/main.fmf b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/main.fmf new file mode 100644 index 0000000..b71316c --- /dev/null +++ b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/main.fmf @@ -0,0 +1,7 @@ +summary: "[FJ7.4 Bug] [REG] The results of gprof command" +description: | + [FJ7.4 Bug]: [REG] The results of gprof command with some options differ between RHEL7.4 beta and RHEL7.3. +duration: 5m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1465318 diff --git a/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/test.sh b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/test.sh new file mode 100755 index 0000000..7140dac --- /dev/null +++ b/tests/bugs/FJ7-4-Bug-REG-The-results-of-gprof-command/test.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/binutils/Regression/bz1465318-FJ7-4-Bug-REG-The-results-of-gprof-command +# Description: Test for BZ#1465318 ([FJ7.4 Bug] [REG] The results of gprof command) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers gprof.file.c + rlRun "gcc -pg -g gprof.file.c -o gprof.file" + rlRun "./gprof.file" + rlAssertExists "gmon.out" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gprof -A gprof.file > option-large_A" + rlRun "gprof -C gprof.file > option-large_C" + rlRun "gprof -l gprof.file > option-l" + + rlLogInfo "$(cat option-large_A)" + rlLogInfo "$(cat option-large_C)" + rlLogInfo "$(cat option-l)" + + rlRun "grep -E '##### -> +void fun3\(\)\{\}' option-large_A" + rlRun "grep -E '1 -> +void fun1\(\)\{int i=0;\}' option-large_A" + + rlRun "grep -E 'gprof.file.c:2: \(fun1:0x[0-9a-z]+\) 1 executions' option-large_C" + + rlRun "grep -E '0.00 +0.00 +0.00 +1 +0.00 +0.00 +fun1 \(gprof.file.c:2 @ [0-9a-z]+\)' option-l" + rlRun "grep -E '\[1\] +0.0 +0.00 +0.00 +1 +fun1 \(gprof.file.c:2 @ [0-9a-z]+\) \[1\]' option-l" + rlRun "grep -E '\[1\] fun1 \(gprof.file.c:2 @ [0-9a-z]+\) \[2\] fun2 \(gprof.file.c:1 @ [0-9a-z]+\)' option-l" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.c b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.c new file mode 100644 index 0000000..aee9e2e --- /dev/null +++ b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.c @@ -0,0 +1,4 @@ +int main(int argc, char **argv) +{ + return 0; +} diff --git a/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.fmf b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.fmf new file mode 100644 index 0000000..a8e2161 --- /dev/null +++ b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/main.fmf @@ -0,0 +1,7 @@ +summary: "[LLNL 7.5 FEAT] RFE create an option to" +description: | + [LLNL 7.5 FEAT] RFE create an option to permanently link in audit library into an executable (glibc) +duration: 15m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1439350 diff --git a/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/test.sh b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/test.sh new file mode 100755 index 0000000..371f982 --- /dev/null +++ b/tests/bugs/LLNL-7-5-FEAT-RFE-create-an-option-to/test.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1439350-LLNL-7-5-FEAT-RFE-create-an-option-to +# Description: Test for BZ#1439350 ([LLNL 7.5 FEAT] RFE create an option to) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers main.c + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o main main.c -Wl,-Paudit.so.1 -z globalaudit &> gcc.out" + rlLogInfo "$(cat gcc.out)" + rlRun "egrep 'globalaudit ignored' gcc.out" 1 + rlRun "readelf -d main | grep AUDIT &> readelf.out" + rlLogInfo "$(cat readelf.out)" + rlRun "egrep 'Dependency audit library: \[audit.so.1\]' readelf.out" + rlRun "egrep 'Flags: GLOBAUDIT' readelf.out" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/Rust-TLS-accesses-are-badly-initialized/main.fmf b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/main.fmf new file mode 100644 index 0000000..465bb48 --- /dev/null +++ b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/main.fmf @@ -0,0 +1,7 @@ +summary: Rust TLS accesses are badly initialized +description: | + Rust TLS accesses are badly initialized +duration: 15m + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1433075 diff --git a/tests/bugs/Rust-TLS-accesses-are-badly-initialized/repr.c b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/repr.c new file mode 100644 index 0000000..fc4873d --- /dev/null +++ b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/repr.c @@ -0,0 +1,13 @@ +#include +#include + +static __thread int a; +static int *c; + +int main(int argc, char *argv[]) +{ + a = 2; + c = &a; + printf("c=%d\n", *c); + return 0; +} diff --git a/tests/bugs/Rust-TLS-accesses-are-badly-initialized/test.sh b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/test.sh new file mode 100755 index 0000000..8fd0fcc --- /dev/null +++ b/tests/bugs/Rust-TLS-accesses-are-badly-initialized/test.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/binutils/Regression/bz1433075-Rust-TLS-accesses-are-badly-initialized +# Description: Test for BZ#1433075 (Rust TLS accesses are badly initialized) +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers repr.c + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o repr1 -fPIC repr.c" + rlRun "./repr1" + + rlRun "gcc -o repr2 -fPIC -pie repr.c" + rlRun "./repr2" + + rlRun "gcc -o repr3 -ftls-model=local-dynamic -fPIC repr.c" + rlRun "./repr3" + + rlRun "gcc -o repr4 -ftls-model=local-dynamic -fPIC -pie repr.c" + rlRun "./repr4" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/main.fmf b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/main.fmf new file mode 100644 index 0000000..7d1c980 --- /dev/null +++ b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/main.fmf @@ -0,0 +1,14 @@ +summary: binutils ld removes some R_X86_64_JUMP_SLOT +description: | + ld removes some R_X86_64_JUMP_SLOT relocations +contact: + - Milos Prchlik + - Edjunior Machado +duration: 5m + +# Configurable fields +recommend: + - sed + +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1624776 diff --git a/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/reloc.s b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/reloc.s new file mode 100644 index 0000000..f417f5b --- /dev/null +++ b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/reloc.s @@ -0,0 +1,3 @@ +.text +mov malloc@GOTPCREL(%rip), %rax +jmp malloc@plt diff --git a/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/test.sh b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/test.sh new file mode 100755 index 0000000..90ee6a2 --- /dev/null +++ b/tests/bugs/binutils-ld-removes-some-R-X86-64-JUMP-SLOT/test.sh @@ -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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers reloc.s + 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 + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf b/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf index ea13ad8..d706d72 100644 --- a/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf +++ b/tests/bugs/binutils-support-secondary-relocation-sections/main.fmf @@ -1,7 +1,6 @@ -summary: Test for BZ#1785294 (binutils support secondary relocation sections) +summary: 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 + support secondary relocation sections contact: - Milos Prchlik - Edjunior Machado diff --git a/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh index b56df29..3f0fe77 100755 --- a/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh +++ b/tests/bugs/fpie-pie-does-not-appear-to-work-with-__thread-variables/test.sh @@ -35,10 +35,9 @@ rlJournalStart rlPhaseStartSetup buTestHeader - testdir="$(pwd)" buEnterTmpDir - rlRun "cp -v $testdir/w.c $TmpDir" + buCopyReproducers w.c rlPhaseEnd rlPhaseStartTest diff --git a/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/main.fmf b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/main.fmf new file mode 100644 index 0000000..2b6f97f --- /dev/null +++ b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/main.fmf @@ -0,0 +1,8 @@ +summary: "ld should allow 'lea foo@GOT, %ecx'" +description: | + ld should allow "lea foo@GOT, %ecx" +duration: 15m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1573872 diff --git a/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/reproducer.S b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/reproducer.S new file mode 100644 index 0000000..602f760 --- /dev/null +++ b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/reproducer.S @@ -0,0 +1,17 @@ + .text + .globl bar + .type bar, @function +bar: + call __x86.get_pc_thunk.ax + addl $_GLOBAL_OFFSET_TABLE_, %eax + lea foo@GOT, %ecx + mov (%eax,%ecx,1), %eax + ret + .section .text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat + .globl __x86.get_pc_thunk.ax + .hidden __x86.get_pc_thunk.ax + .type __x86.get_pc_thunk.ax, @function +__x86.get_pc_thunk.ax: + movl (%esp), %eax + ret + .section .note.GNU-stack,"",@progbits diff --git a/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/test.sh b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/test.sh new file mode 100755 index 0000000..bb4b742 --- /dev/null +++ b/tests/bugs/ld-should-allow-lea-foo-GOT-ecx/test.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/bz1573872-ld-should-allow-lea-foo-GOT-ecx +# Description: Test for BZ#1573872 (ld should allow "lea foo@GOT, %ecx") +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + buCopyReproducers reproducer.S + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -B./ -m32 -c -o reproducer.o reproducer.S" + rlRun "ld -melf_i386 -shared -o libx.so reproducer.o" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh index 11bcd11..54de2e6 100755 --- a/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh +++ b/tests/bugs/rhel8-gold-does-not-resolve-the-address-of-main/test.sh @@ -34,10 +34,9 @@ rlJournalStart rlPhaseStartSetup buTestHeader - testdir="$(pwd)" buEnterTmpDir - rlRun "cp -v $testdir/main.c $testdir/foo.c $TmpDir" + buCopyReproducers "main.c foo.c" rlPhaseEnd rlPhaseStartTest diff --git a/tests/dts-probe-binaries/test.sh b/tests/dts-probe-binaries/test.sh index 3992e63..32280cb 100755 --- a/tests/dts-probe-binaries/test.sh +++ b/tests/dts-probe-binaries/test.sh @@ -62,11 +62,10 @@ rlJournalStart rlLogInfo "SIZE=$SIZE" rlLogInfo "STRINGS=$STRINGS" - testdir="$(pwd)" buEnterTmpDir # Copy the GDB commands file and testcase. - rlRun "cp -v $testdir/check-localplt.c $testdir/m.c $testdir/popcnt.c $testdir/virtual2.C $TmpDir" + buCopyReproducers "check-localplt.c m.c popcnt.c virtual2.C" rlPhaseEnd rlPhaseStartTest "Prepare a DTS binary." diff --git a/tests/lib.sh b/tests/lib.sh index cbf6496..841ec48 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -5,6 +5,8 @@ BU_TMPDIR_PARENT="${BU_TMPDIR_PARENT:-/tmp}" BU_TEST_USER="${BU_TEST_USER:-buUser}" +BU_SOURCE_DIR="${BU_SOURCE_DIR:-$(pwd)}" + function buEnterTestUser () { username="${1:-$BU_TEST_USER}" @@ -119,3 +121,10 @@ function buBuildSRPM () { rlRun " rpmbuild -bb --define=\"_topdir $TmpDir\" $SPECFILE" fi } + + +function buCopyReproducers () { + for filename in $1; do + rlRun "cp $BU_SOURCE_DIR/$filename $TmpDir/" + done +}