From 8d1431acf80980fe98a165d5642dda5cf0081cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kadl=C4=8D=C3=ADk?= Date: Tue, 25 May 2021 08:37:46 +0200 Subject: [PATCH] Import RHEL's test Sanity/rebuild-emacs --- tests/Sanity/rebuild-emacs/Makefile | 67 +++++++++++++++++++++++ tests/Sanity/rebuild-emacs/PURPOSE | 21 +++++++ tests/Sanity/rebuild-emacs/main.fmf | 64 ++++++++++++++++++++++ tests/Sanity/rebuild-emacs/runtest.sh | 79 +++++++++++++++++++++++++++ 4 files changed, 231 insertions(+) create mode 100644 tests/Sanity/rebuild-emacs/Makefile create mode 100644 tests/Sanity/rebuild-emacs/PURPOSE create mode 100644 tests/Sanity/rebuild-emacs/main.fmf create mode 100755 tests/Sanity/rebuild-emacs/runtest.sh diff --git a/tests/Sanity/rebuild-emacs/Makefile b/tests/Sanity/rebuild-emacs/Makefile new file mode 100644 index 0000000..71112f0 --- /dev/null +++ b/tests/Sanity/rebuild-emacs/Makefile @@ -0,0 +1,67 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/binutils/Regression/rebuild-emacs +# Description: rebuild-emacs +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 " > $(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) diff --git a/tests/Sanity/rebuild-emacs/PURPOSE b/tests/Sanity/rebuild-emacs/PURPOSE new file mode 100644 index 0000000..3c41ea0 --- /dev/null +++ b/tests/Sanity/rebuild-emacs/PURPOSE @@ -0,0 +1,21 @@ +PURPOSE of /tools/binutils/Regression/rebuild-emacs +Description: rebuild-emacs +Author: Martin Cermak + + +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. diff --git a/tests/Sanity/rebuild-emacs/main.fmf b/tests/Sanity/rebuild-emacs/main.fmf new file mode 100644 index 0000000..a2c8619 --- /dev/null +++ b/tests/Sanity/rebuild-emacs/main.fmf @@ -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 +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 diff --git a/tests/Sanity/rebuild-emacs/runtest.sh b/tests/Sanity/rebuild-emacs/runtest.sh new file mode 100755 index 0000000..bce7de7 --- /dev/null +++ b/tests/Sanity/rebuild-emacs/runtest.sh @@ -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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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