diff --git a/plans/build-gating.fmf b/plans/build-gating.fmf index b021104..7575d67 100644 --- a/plans/build-gating.fmf +++ b/plans/build-gating.fmf @@ -39,10 +39,10 @@ adjust+: discover: - how: fmf filter: "tag:gate-build" - exclude: '^/tests/Sanity/rebuild-kernel-and-reboot$' + exclude: '^/tests/rebuilds/kernel$' /kernel-rebuild: discover: - how: fmf filter: "tag:gate-build" - test: '^/tests/Sanity/rebuild-kernel-and-reboot$' + test: '^/tests/rebuilds/kernel$' diff --git a/tests/bugs/RELRO-protection-effective/main.fmf b/tests/bugs/RELRO-protection-effective/main.fmf new file mode 100644 index 0000000..1803d1e --- /dev/null +++ b/tests/bugs/RELRO-protection-effective/main.fmf @@ -0,0 +1,33 @@ +summary: Exercise PIE and RELRO provided +description: | + Test to exercise PIE and RELRO provided by Roland McGrath . + + Description: + Simple test for RELRO, which happens to be a PIE too, but that's only + because this kind of example has to be in PIC code to make RELRO relevant, + and PIE makes it simpler to write a standalone one-file test than writing + a DSO. + + The "const" makes "foo" .rodata material, and the init to an external symbol + reference makes it require a data relocation. Enabling -z relro for this + link puts that .rodata into a RELRO area. This program will crash because + the page containing "foo" has been made read-only when "main" runs. + Without RELRO, it would let you modify "foo" even though it's supposed to + be const. + + Test with RELRO should fail: + $ gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c + $ ./relro + Segmentation fault (core dumped) + + Test without RELRO should pass: + $ gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c + $ ./no-relro +contact: + - Milos Prchlik + - Martin Cermak +duration: 15m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1174826 diff --git a/tests/bugs/RELRO-protection-effective/test.sh b/tests/bugs/RELRO-protection-effective/test.sh new file mode 100755 index 0000000..39a1000 --- /dev/null +++ b/tests/bugs/RELRO-protection-effective/test.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Regression/RELRO-protection-effective +# Description: bz1174826 +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + + cat > relro.c <<-EOF +#include + +void *const foo = &stdout; + +int main (void) +{ + *(void **) &foo = &stderr; + return 0; +} +EOF + rlRun "gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c" + rlRun "gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c" + rlPhaseEnd + + rlPhaseStartTest + rlRun "./relro" 139 + rlRun "./no-relro" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf b/tests/bugs/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf similarity index 100% rename from tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf rename to tests/bugs/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf diff --git a/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh b/tests/bugs/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh similarity index 100% rename from tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh rename to tests/bugs/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh diff --git a/tests/dts-probe-binaries/main.fmf b/tests/dts-probe-binaries/main.fmf index e2a1517..30ef53d 100644 --- a/tests/dts-probe-binaries/main.fmf +++ b/tests/dts-probe-binaries/main.fmf @@ -1,5 +1,4 @@ summary: Toolset binutils on system/toolset built binaries. -description: "" tag: - collection-only duration: 15m diff --git a/tests/main.fmf b/tests/main.fmf index 7084991..ef08cce 100644 --- a/tests/main.fmf +++ b/tests/main.fmf @@ -1,3 +1,5 @@ +description: "" + contact: - Milos Prchlik framework: beakerlib diff --git a/tests/rebuild-coreutils/main.fmf b/tests/rebuilds/coreutils/main.fmf similarity index 78% rename from tests/rebuild-coreutils/main.fmf rename to tests/rebuilds/coreutils/main.fmf index 3e424a2..642c0b7 100644 --- a/tests/rebuild-coreutils/main.fmf +++ b/tests/rebuilds/coreutils/main.fmf @@ -1,5 +1,4 @@ summary: Rebuild coreutils -description: '' tag: - gate-build duration: 1h @@ -7,4 +6,3 @@ duration: 1h # Configurable fields require+: - coreutils - - rpm-build diff --git a/tests/rebuild-coreutils/test.sh b/tests/rebuilds/coreutils/test.sh similarity index 100% rename from tests/rebuild-coreutils/test.sh rename to tests/rebuilds/coreutils/test.sh diff --git a/tests/Sanity/rebuild-emacs/main.fmf b/tests/rebuilds/emacs/main.fmf similarity index 98% rename from tests/Sanity/rebuild-emacs/main.fmf rename to tests/rebuilds/emacs/main.fmf index b33d8e8..9eeb873 100644 --- a/tests/Sanity/rebuild-emacs/main.fmf +++ b/tests/rebuilds/emacs/main.fmf @@ -28,7 +28,6 @@ duration: 3h # Configurable fields require+: - emacs - - rpm-build environment+: REQUIRES: "emacs" diff --git a/tests/Sanity/rebuild-emacs/test.sh b/tests/rebuilds/emacs/test.sh similarity index 100% rename from tests/Sanity/rebuild-emacs/test.sh rename to tests/rebuilds/emacs/test.sh diff --git a/tests/Sanity/rebuild-kernel-and-reboot/main.fmf b/tests/rebuilds/kernel/main.fmf similarity index 99% rename from tests/Sanity/rebuild-kernel-and-reboot/main.fmf rename to tests/rebuilds/kernel/main.fmf index 5254bb7..d02e57f 100644 --- a/tests/Sanity/rebuild-kernel-and-reboot/main.fmf +++ b/tests/rebuilds/kernel/main.fmf @@ -25,7 +25,6 @@ duration: 20h require+: - yum-utils - rng-tools - - rpm-build - newt-devel - perl-ExtUtils-Embed - unifdef diff --git a/tests/Sanity/rebuild-kernel-and-reboot/test.sh b/tests/rebuilds/kernel/test.sh similarity index 100% rename from tests/Sanity/rebuild-kernel-and-reboot/test.sh rename to tests/rebuilds/kernel/test.sh diff --git a/tests/rebuilds/main.fmf b/tests/rebuilds/main.fmf new file mode 100644 index 0000000..9d5bdb9 --- /dev/null +++ b/tests/rebuilds/main.fmf @@ -0,0 +1,2 @@ +require+: + - rpm-build diff --git a/tests/Sanity/rebuild-wget/main.fmf b/tests/rebuilds/wget/main.fmf similarity index 80% rename from tests/Sanity/rebuild-wget/main.fmf rename to tests/rebuilds/wget/main.fmf index f25e9c1..9baf7dc 100644 --- a/tests/Sanity/rebuild-wget/main.fmf +++ b/tests/rebuilds/wget/main.fmf @@ -1,5 +1,4 @@ summary: Rebuild wget -description: '' tag: - gate-build duration: 1h @@ -7,7 +6,6 @@ duration: 1h # Configurable fields require+: - wget - - rpm-build # Adjust rules adjust+: [] diff --git a/tests/Sanity/rebuild-wget/test.sh b/tests/rebuilds/wget/test.sh similarity index 100% rename from tests/Sanity/rebuild-wget/test.sh rename to tests/rebuilds/wget/test.sh diff --git a/tests/Sanity/testsuite/main.fmf b/tests/testsuite/main.fmf similarity index 98% rename from tests/Sanity/testsuite/main.fmf rename to tests/testsuite/main.fmf index d1ece34..a279b49 100644 --- a/tests/Sanity/testsuite/main.fmf +++ b/tests/testsuite/main.fmf @@ -1,5 +1,4 @@ summary: Run binutils upstream test suite -description: '' tag: - gate-build duration: 3h diff --git a/tests/Sanity/testsuite/test-rhel-9.3.0.sh b/tests/testsuite/test-rhel-9.3.0.sh similarity index 100% rename from tests/Sanity/testsuite/test-rhel-9.3.0.sh rename to tests/testsuite/test-rhel-9.3.0.sh diff --git a/tests/Sanity/testsuite/test.sh b/tests/testsuite/test.sh similarity index 100% rename from tests/Sanity/testsuite/test.sh rename to tests/testsuite/test.sh