Reshuffle tests into more fitting namespaces

This commit is contained in:
Miloš Prchlík 2023-08-31 14:29:10 +02:00
commit c985a6ff53
19 changed files with 102 additions and 10 deletions

View file

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

View file

@ -0,0 +1,33 @@
summary: Exercise PIE and RELRO provided
description: |
Test to exercise PIE and RELRO provided by Roland McGrath <roland@redhat.com>.
Description:
Simple test for RELRO, which happens to be a PIE too, but that's only
because this kind of example has to be in PIC code to make RELRO relevant,
and PIE makes it simpler to write a standalone one-file test than writing
a DSO.
The "const" makes "foo" .rodata material, and the init to an external symbol
reference makes it require a data relocation. Enabling -z relro for this
link puts that .rodata into a RELRO area. This program will crash because
the page containing "foo" has been made read-only when "main" runs.
Without RELRO, it would let you modify "foo" even though it's supposed to
be const.
Test with RELRO should fail:
$ gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c
$ ./relro
Segmentation fault (core dumped)
Test without RELRO should pass:
$ gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c
$ ./no-relro
contact:
- Milos Prchlik <mprchlik@redhat.com>
- Martin Cermak <mcermak@redhat.com>
duration: 15m
# Configurable fields
link+:
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1174826

View file

@ -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 <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
. "$TMT_TREE/tests/lib.sh" || exit 1
rlJournalStart
rlPhaseStartSetup
buTestHeader
buEnterTmpDir
cat > relro.c <<-EOF
#include <stdio.h>
void *const foo = &stdout;
int main (void)
{
*(void **) &foo = &stderr;
return 0;
}
EOF
rlRun "gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c"
rlRun "gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c"
rlPhaseEnd
rlPhaseStartTest
rlRun "./relro" 139
rlRun "./no-relro"
rlPhaseEnd
rlPhaseStartCleanup
buExitTmpDir
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,5 +1,4 @@
summary: Toolset binutils on system/toolset built binaries.
description: ""
tag:
- collection-only
duration: 15m

View file

@ -1,3 +1,5 @@
description: ""
contact:
- Milos Prchlik <mprchlik@redhat.com>
framework: beakerlib

View file

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

View file

@ -28,7 +28,6 @@ duration: 3h
# Configurable fields
require+:
- emacs
- rpm-build
environment+:
REQUIRES: "emacs"

View file

@ -25,7 +25,6 @@ duration: 20h
require+:
- yum-utils
- rng-tools
- rpm-build
- newt-devel
- perl-ExtUtils-Embed
- unifdef

2
tests/rebuilds/main.fmf Normal file
View file

@ -0,0 +1,2 @@
require+:
- rpm-build

View file

@ -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+: []

View file

@ -1,5 +1,4 @@
summary: Run binutils upstream test suite
description: ''
tag:
- gate-build
duration: 3h