From 8d1431acf80980fe98a165d5642dda5cf0081cd0 Mon Sep 17 00:00:00 2001 From: Václav Kadlčík Date: May 25 2021 06:37:46 +0000 Subject: [PATCH 2/4] Import RHEL's test Sanity/rebuild-emacs --- 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 From 518691547f150d3bd56de28975972d7c94955fae Mon Sep 17 00:00:00 2001 From: Václav Kadlčík Date: May 25 2021 06:38:34 +0000 Subject: [PATCH 3/4] Import RHEL's test Sanity/rebuild-wget --- diff --git a/tests/Sanity/rebuild-wget/Makefile b/tests/Sanity/rebuild-wget/Makefile new file mode 100644 index 0000000..12427cb --- /dev/null +++ b/tests/Sanity/rebuild-wget/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/binutils/Sanity/rebuild-wget +# Description: Rebuild wget +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/binutils/Sanity/rebuild-wget +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) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Milos Prchlik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Rebuild wget" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: binutils" >> $(METADATA) + @echo "Requires: binutils" >> $(METADATA) + @echo "Requires: wget rpm-build gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/rebuild-wget/PURPOSE b/tests/Sanity/rebuild-wget/PURPOSE new file mode 100644 index 0000000..cc87a45 --- /dev/null +++ b/tests/Sanity/rebuild-wget/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/binutils/Sanity/rebuild-wget +Description: Rebuild wget +Author: Milos Prchlik diff --git a/tests/Sanity/rebuild-wget/main.fmf b/tests/Sanity/rebuild-wget/main.fmf new file mode 100644 index 0000000..ce54e36 --- /dev/null +++ b/tests/Sanity/rebuild-wget/main.fmf @@ -0,0 +1,16 @@ +summary: Rebuild wget +description: '' +contact: Milos Prchlik +component: +- binutils +test: ./runtest.sh +framework: beakerlib +recommend: +- binutils +- wget +- koji +- rpm-build +- gcc +duration: 1h +extra-summary: /tools/binutils/Sanity/rebuild-wget +extra-task: /tools/binutils/Sanity/rebuild-wget diff --git a/tests/Sanity/rebuild-wget/runtest.sh b/tests/Sanity/rebuild-wget/runtest.sh new file mode 100755 index 0000000..2016bf5 --- /dev/null +++ b/tests/Sanity/rebuild-wget/runtest.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/binutils/Sanity/rebuild-wget +# Description: Rebuild wget +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +LD="${LD:-$(which ld)}" +GCC="${GCC:-$(which gcc)}" + +BINUTILS_PACKAGE="$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)" +GCC_PACKAGE="$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)" + +PACKAGES="${PACKAGES:-$BINUTILS_PACKAGE}" +REQUIRES="${REQUIRES:-$GCC_PACKAGE wget}" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "REQUIRES=$REQUIRES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "LD=$LD" + rlLogInfo "GCC=$GCC" + 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 "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + rlRun "koji download-build --arch=src $(rpm -q wget)" + rlRun "SRPM=`find . -name 'wget-*.src.rpm'`" + rlRun "SRPM_SPECDIR=`rpm --eval=%_specdir`" + rlRun "rpm -Uvh $SRPM" + rlRun "dnf builddep -y $SRPM" + rlPhaseEnd + + rlPhaseStartTest + rlRun "rpmbuild -bb --clean $SRPM_SPECDIR/wget.spec" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd From 8b9a64065db1f38b268866eba49025d06e7d03e2 Mon Sep 17 00:00:00 2001 From: Václav Kadlčík Date: May 25 2021 06:38:59 +0000 Subject: [PATCH 4/4] Import RHEL's test Sanity/rebuild-coreutils --- diff --git a/tests/Sanity/rebuild-coreutils/Makefile b/tests/Sanity/rebuild-coreutils/Makefile new file mode 100644 index 0000000..94e48e9 --- /dev/null +++ b/tests/Sanity/rebuild-coreutils/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/binutils/Sanity/rebuild-coreutils +# Description: Rebuild coreutils +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/binutils/Sanity/rebuild-coreutils +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) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Milos Prchlik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Rebuild coreutils" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: binutils" >> $(METADATA) + @echo "Requires: binutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/rebuild-coreutils/PURPOSE b/tests/Sanity/rebuild-coreutils/PURPOSE new file mode 100644 index 0000000..15bec7c --- /dev/null +++ b/tests/Sanity/rebuild-coreutils/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/binutils/Sanity/rebuild-coreutils +Description: Rebuild coreutils +Author: Milos Prchlik diff --git a/tests/Sanity/rebuild-coreutils/main.fmf b/tests/Sanity/rebuild-coreutils/main.fmf new file mode 100644 index 0000000..b11ef5e --- /dev/null +++ b/tests/Sanity/rebuild-coreutils/main.fmf @@ -0,0 +1,14 @@ +summary: Rebuild coreutils +description: '' +contact: Milos Prchlik +component: +- binutils +test: ./runtest.sh +framework: beakerlib +recommend: +- binutils +- koji +- rpm-build +duration: 1h +extra-summary: /tools/binutils/Sanity/rebuild-coreutils +extra-task: /tools/binutils/Sanity/rebuild-coreutils diff --git a/tests/Sanity/rebuild-coreutils/runtest.sh b/tests/Sanity/rebuild-coreutils/runtest.sh new file mode 100755 index 0000000..06b886a --- /dev/null +++ b/tests/Sanity/rebuild-coreutils/runtest.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/Sanity/rebuild-coreutils +# Description: Rebuild coreutils +# Author: Milos Prchlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="binutils" +REQUIRES="${REQUIRES:-coreutils}" +TEST_USER="${TEST_USER:-jouda}" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + rlRun "koji download-build --arch=src $(rpm -q coreutils)" + rlRun "SRPM=`find . -name 'coreutils-*.src.rpm'`" + rlRun "dnf builddep -y $SRPM" + + rlRun "userdel -r $TEST_USER" 0,6 + rlRun "useradd -m -d /home/$TEST_USER $TEST_USER" + rlRun "cp $SRPM /home/$TEST_USER" + rlRun "su - $TEST_USER -c 'rpm -Uvh $SRPM'" + rlPhaseEnd + + rlPhaseStartTest + rlRun "su - $TEST_USER -c 'rpmbuild -bb --clean \$(rpm --eval=%_specdir)/coreutils.spec'" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "userdel -r $TEST_USER" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd