Import RHEL's test Sanity/rebuild-emacs

This commit is contained in:
Václav Kadlčík 2021-05-25 08:37:46 +02:00
parent f5c84aa932
commit 8d1431acf8
4 changed files with 231 additions and 0 deletions

View File

@ -0,0 +1,67 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/binutils/Regression/rebuild-emacs
# Description: rebuild-emacs
# 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/binutils/Regression/rebuild-emacs
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)
requires = alsa-lib-devel atk-devel binutils cairo-devel dbus-devel emacs fontconfig-devel freetype-devel \
GConf2-devel giflib-devel gnutls-devel gpm-devel gtk3-devel ImageMagick-devel libjpeg-devel \
liblockfile-devel libotf-devel libpng-devel librsvg2-devel libselinux-devel libtiff-devel \
libX11-devel libXau-devel libXdmcp-devel libXpm-devel libXrender-devel libXt-devel m17n-lib-devel \
ncurses-devel python2-devel texinfo xorg-x11-proto-devel pango pango-devel yum-utils
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: rebuild-emacs" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 24h" >> $(METADATA)
@echo "RunFor: binutils" >> $(METADATA)
$(foreach package, $(requires), echo "Requires: $(package)" >> $(METADATA);)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,21 @@
PURPOSE of /tools/binutils/Regression/rebuild-emacs
Description: rebuild-emacs
Author: Martin Cermak <mcermak@redhat.com>
From: Jeff Law
... stuff deleted ...
emacs is highly sensitive to the order and structure of executables
produced by the linker. This is an artifact of its undumping mechanism
(essentially starts emacs, loads a bunch of stuff, core dumps, then
turns the core dump into a new executable).
We've seen a lot of pain around this for ppc64le as well as after the
RELRO improvements we made to binutils/ld over the last 6 months.
ISTM that the testing plans for RHEL going forward ought to include a
test build of emacs with the new binutils installed. No further tests
are necessary since the build process for emacs exercises the
problematic bits.

View File

@ -0,0 +1,64 @@
summary: rebuild-emacs
description: |
From: Jeff Law
... stuff deleted ...
emacs is highly sensitive to the order and structure of executables
produced by the linker. This is an artifact of its undumping mechanism
(essentially starts emacs, loads a bunch of stuff, core dumps, then
turns the core dump into a new executable).
We've seen a lot of pain around this for ppc64le as well as after the
RELRO improvements we made to binutils/ld over the last 6 months.
ISTM that the testing plans for RHEL going forward ought to include a
test build of emacs with the new binutils installed. No further tests
are necessary since the build process for emacs exercises the
problematic bits.
contact: Martin Cermak <mcermak@redhat.com>
component:
- binutils
test: ./runtest.sh
framework: beakerlib
recommend:
- alsa-lib-devel
- atk-devel
- binutils
- cairo-devel
- dbus-devel
- emacs
- fontconfig-devel
- freetype-devel
- GConf2-devel
- giflib-devel
- gnutls-devel
- gpm-devel
- gtk3-devel
- ImageMagick-devel
- libjpeg-devel
- liblockfile-devel
- libotf-devel
- libpng-devel
- librsvg2-devel
- libselinux-devel
- libtiff-devel
- libX11-devel
- libXau-devel
- libXdmcp-devel
- libXpm-devel
- libXrender-devel
- libXt-devel
- m17n-lib-devel
- ncurses-devel
- python2-devel
- texinfo
- xorg-x11-proto-devel
- pango
- pango-devel
- yum-utils
- koji
- rpm-build
duration: 24h
extra-summary: /tools/binutils/Regression/rebuild-emacs
extra-task: /tools/binutils/Regression/rebuild-emacs

View File

@ -0,0 +1,79 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/binutils/Regression/rebuild-emacs
# Description: rebuild-emacs
# 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
PACKAGES="${PACKAGES:-binutils}"
REQUIRES="${REQUIRES:-emacs}"
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
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 "TMPD=$(mktemp -d)"
rlRun "pushd $TMPD"
rlRun "koji download-build --arch=src $(rpm -q emacs)"
rlRun "rpm --define='_topdir $TMPD' -Uvh *src.rpm"
rlRun "saved_randomize_va_space=$(cat /proc/sys/kernel/randomize_va_space)"
rlRun "echo '1' > /proc/sys/kernel/randomize_va_space"
rlPhaseEnd
rlPhaseStartTest
rlRun "dnf builddep -y SPECS/emacs.spec"
rlRun "rpmbuild --define='_topdir $TMPD' -bc SPECS/emacs.spec"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "echo \"$saved_randomize_va_space\" > /proc/sys/kernel/randomize_va_space"
rlRun "popd"
rlRun "rm -r $TMPD"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd