From 20788990a8145e53f80a113a6ece42dc3efa0033 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Tue, 20 Oct 2020 07:42:43 -0700 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/rng-tools#e438127b78cb794a9ce4d31c481eba1d6b1627d1 --- .gitignore | 13 ++ jitterentropy-remove-install.patch | 20 +++ pkcs11-path.patch | 51 +++++++ rng-tools.spec | 227 +++++++++++++++++++++++++++++ rngd-exit-code-for-list.patch | 21 +++ rngd-shutdown.patch | 35 +++++ rngd.service | 8 + sources | 1 + tests/README | 2 + tests/inventory | 3 + tests/selftest/Makefile | 64 ++++++++ tests/selftest/PURPOSE | 4 + tests/selftest/runtest.sh | 75 ++++++++++ tests/tests.yml | 16 ++ 14 files changed, 540 insertions(+) create mode 100644 jitterentropy-remove-install.patch create mode 100644 pkcs11-path.patch create mode 100644 rng-tools.spec create mode 100644 rngd-exit-code-for-list.patch create mode 100644 rngd-shutdown.patch create mode 100644 rngd.service create mode 100644 sources create mode 100644 tests/README create mode 100644 tests/inventory create mode 100644 tests/selftest/Makefile create mode 100644 tests/selftest/PURPOSE create mode 100755 tests/selftest/runtest.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..020e6bb 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,13 @@ +rng-tools-3.tar.gz +/rng-tools-4.tar.gz +/rng-tools-5.tar.gz +/rng-tools-6.tar.gz +/rng-tools-6.1.tar.gz +/rng-tools-6.2.tar.gz +/rng-tools-6.3.tar.gz +/jitterentropy-library-d95c1a2.tar.gz +/rng-tools-6.3.1.tar.gz +/jitterentropy-library-3f7b6cc.tar.gz +/rng-tools-6.7.tar.gz +/rng-tools-6.9.tar.gz +/rng-tools-6.10.tar.gz diff --git a/jitterentropy-remove-install.patch b/jitterentropy-remove-install.patch new file mode 100644 index 0000000..f0dd90f --- /dev/null +++ b/jitterentropy-remove-install.patch @@ -0,0 +1,20 @@ +diff -up ./jitterentropy-library/Makefile.makefile ./jitterentropy-library/Makefile +--- ./jitterentropy-library/Makefile.makefile 2018-07-09 13:23:31.000000000 -0400 ++++ ./jitterentropy-library/Makefile 2018-07-16 11:36:25.543791453 -0400 +@@ -44,13 +44,10 @@ scan: $(OBJS) + scan-build --use-analyzer=/usr/bin/clang $(CC) -shared -Wl,-soname,lib$(NAME).so.$(LIBMAJOR) -o lib$(NAME).so.$(LIBVERSION) $(OBJS) $(LDFLAGS) + + install: +- install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3 +- install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/ +- gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3 +- install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) +- install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/ ++ ++clean: ++ @- $(RM) $(NAME) + $(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR) +- ln -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR) + + clean: + @- $(RM) $(NAME) diff --git a/pkcs11-path.patch b/pkcs11-path.patch new file mode 100644 index 0000000..fb2feb7 --- /dev/null +++ b/pkcs11-path.patch @@ -0,0 +1,51 @@ +diff --git a/.travis.yml b/.travis.yml +index be3bf06..b6acd39 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -1,6 +1,10 @@ + language: c + dist: trusty + ++arch: ++ - amd64 ++ - arm64 ++ + compiler: + - clang + - gcc +diff --git a/Makefile.am b/Makefile.am +index db4fcfc..5917023 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -31,9 +31,10 @@ rngd_LDADD = librngd.a -lsysfs $(LIBS) ${libp11_LIBS} ${libcrypto_LIBS} ${libcur + + if PKCS11 + rngd_SOURCES += rngd_pkcs11.c ++pkcs11_ENGINE = -DDEFAULT_PKCS11_ENGINE=\"$(PKCS11_ENGINE)\" + endif + +-rngd_CFLAGS = ${pkcs11_CFLAGS} ${libp11_CFLAGS} ${libcrypto_CFLAGS} ${libxml2_CFLAGS} ${openssl_CFLAGS} $(PTHREAD_CFLAGS) ++rngd_CFLAGS = ${pkcs11_CFLAGS} ${pkcs11_ENGINE} ${libp11_CFLAGS} ${libcrypto_CFLAGS} ${libxml2_CFLAGS} ${openssl_CFLAGS} $(PTHREAD_CFLAGS) + rngd_LDFLAGS = $(PTHREAD_CFLAGS) + + rngtest_SOURCES = exits.h stats.h stats.c rngtest.c +diff --git a/configure.ac b/configure.ac +index f252d03..616d8fa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -111,6 +111,15 @@ AS_IF( + PKG_CHECK_MODULES([libp11], [libp11], [], [AC_MSG_ERROR([libp11 is required])]) + PKG_CHECK_MODULES([libcrypto], [libcrypto], [], [AC_MSG_ERROR([libcrypto is required])]) + AC_DEFINE([HAVE_PKCS11],1,[Enable PKCS11]) ++ AS_CASE([$host_cpu], ++ [i?86|armv7hl], ++ [ ++ PKCS11_ENGINE=/usr/lib/opensc-pkcs11.so ++ ], ++ [ ++ PKCS11_ENGINE=/usr/lib64/opensc-pkcs11.so ++ ]) ++ AC_SUBST([PKCS11_ENGINE]) + ] + ) + diff --git a/rng-tools.spec b/rng-tools.spec new file mode 100644 index 0000000..cbbb4a6 --- /dev/null +++ b/rng-tools.spec @@ -0,0 +1,227 @@ +%global _hardened_build 1 +%global _sbindir /sbin +%if 0%{?rhel} && 0%{?rhel} >= 9 +%bcond_with pkcs11 +%else +%bcond_without pkcs11 +%endif + + +Summary: Random number generator related utilities +Name: rng-tools +Version: 6.10 +Release: 6%{?dist} +License: GPLv2+ +URL: https://github.com/nhorman/rng-tools +Source0: https://github.com/nhorman/rng-tools/archive/rng-tools-%{version}.tar.gz +Source1: rngd.service + +# https://sourceforge.net/p/gkernel/patches/111/ + +BuildRequires: gcc make +BuildRequires: gettext +BuildRequires: systemd-units +BuildRequires: libgcrypt-devel +BuildRequires: autoconf automake +BuildRequires: libsysfs-devel libcurl-devel +BuildRequires: libxml2-devel openssl-devel +BuildRequires: jitterentropy-devel +BuildRequires: jansson-devel +BuildRequires: rtl-sdr-devel +%if %{with pkcs11} +BuildRequires: libp11-devel +%endif + +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +Provides: jitterentropy-rngd + +%description +Hardware random number generation tools. + +%prep +%autosetup + +%build +./autogen.sh +%if %{with pkcs11} +%configure +%else +%configure --without-pkcs11 +%endif +%make_build + +%install +%make_install + +# install systemd unit file +install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1} + +%post +%systemd_post rngd.service + +%preun +%systemd_preun rngd.service + +%postun +%systemd_postun_with_restart rngd.service + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc AUTHORS NEWS README +%{_bindir}/rngtest +%{_sbindir}/rngd +%{_mandir}/man1/rngtest.1.* +%{_mandir}/man8/rngd.8.* +%attr(0644,root,root) %{_unitdir}/rngd.service + +%changelog +* Mon Oct 05 2020 Troy Dawson - 6.10-6 +- Make pkcs11 optional +- For RHEL9 and above, do not build with pkcs11 + +* Sat Aug 01 2020 Fedora Release Engineering - 6.10-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 6.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Mar 27 2020 Neil Horman - 6.10-3 +- Fix missing buildrequires + +* Fri Mar 27 2020 Neil Horman - 6.10-2 +- Fix missing buildrequires + +* Fri Mar 27 2020 Neil Horman - 6.10-1 +- Update to latest upstream + +* Thu Jan 30 2020 Fedora Release Engineering - 6.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 13 2020 Neil Horman - 6.9-2 +- Correct default pkcs11 path on 32 bit arch (bz 1788083) + +* Tue Dec 17 2019 Neil Horman - 6.9-1 +- update to latest upstream + +* Mon Aug 05 2019 Volker Froehlich - 6.7-4 +- Remove explicit Requires for libraries + +* Fri Jul 26 2019 Fedora Release Engineering - 6.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 24 2019 Neil Horman -6.7-2 +- Fix race in shutdown leading to hang (bz 1690364) +- bump version number + +* Thu Feb 14 2019 Neil Horman - 6.7-1 +- Update to latest upstream + +* Sat Feb 02 2019 Fedora Release Engineering - 6.3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Oct 01 2018 Neil Horman - 6.3.1-2 +- Add Provides for jitterentropy-rngd (bz 1634788) + +* Mon Jul 16 2018 Neil Horman - 6.3.1-1 +- Update to latest upstream + +* Sat Jul 14 2018 Fedora Release Engineering - 6.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jul 06 2018 Neil Horman - 6.3-1 +- update to latest upstream (#1598608) + +* Thu May 10 2018 Neil Horman +- Update to latest upstream + +* Thu Feb 15 2018 Adam Williamson - 6.1-4 +- Drop all attempts to 'fix' #1490632, revert spec to same as 6.1-1 + +* Fri Feb 09 2018 Fedora Release Engineering - 6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Nov 02 2017 Neil Horman - 6.1-2 +- Enable rngd on entropy src availability (bz 1490632) + +* Tue Oct 10 2017 Neil Horman - 6.1-1 +- update to latest upstream + +* Fri Jul 28 2017 Neil Horman - 6-1 +- Update to latest upstream + +* Thu Jul 27 2017 Fedora Release Engineering - 5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 5-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Oct 18 2016 Zbigniew Jędrzejewski-Szmek - 5-8 +- If device is not found exit immediately (#892178) + +* Sun Mar 6 2016 Peter Robinson 5-7 +- Use %%license + +* Thu Feb 04 2016 Fedora Release Engineering - 5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Dec 10 2014 Zbigniew Jędrzejewski-Szmek - 5-4 +- Build with hardening flags (#1051344) +- Fail nicely if no hardware generator is found (#892178) +- Drop unneeded dependency + +* Mon Aug 18 2014 Fedora Release Engineering - 5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Apr 23 2014 Luke Macken - 5-1 +- Update to release version 5. +- Remove rng-tools-man.patch + +* Sun Aug 04 2013 Fedora Release Engineering - 4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Sep 25 2012 Jaromir Capik - 4-2 +- Migration to new systemd macros + +* Mon Aug 6 2012 Jeff Garzik - 4-1 +- Update to release version 4. + +* Sat Jul 21 2012 Fedora Release Engineering - 3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jan 12 2012 Jiri Popelka - 3-4 +- 2 patches from RHEL-6 +- systemd service +- man page fixes +- modernize spec file + +* Wed Feb 09 2011 Fedora Release Engineering - 3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Jul 3 2010 Jeff Garzik - 3-2 +- comply with renaming guidelines, by Providing rng-utils = 1:2.0-4.2 + +* Sat Jul 3 2010 Jeff Garzik - 3-1 +- Update to release version 3. + +* Fri Mar 26 2010 Jeff Garzik - 2-3 +- more minor updates for package review + +* Thu Mar 25 2010 Jeff Garzik - 2-2 +- several minor updates for package review + +* Wed Mar 24 2010 Jeff Garzik - 2-1 +- initial revision (as rng-tools) + diff --git a/rngd-exit-code-for-list.patch b/rngd-exit-code-for-list.patch new file mode 100644 index 0000000..a79ec91 --- /dev/null +++ b/rngd-exit-code-for-list.patch @@ -0,0 +1,21 @@ +diff -up ./rngd.c.orig ./rngd.c +--- ./rngd.c.orig 2017-10-27 14:18:52.617286574 -0400 ++++ ./rngd.c 2017-10-27 14:19:34.189456107 -0400 +@@ -423,12 +423,15 @@ int main(int argc, char **argv) + } + + if (arguments->list) { ++ int rc = 1; + msg_squash = false; + printf("Available entropy sources:\n"); + for (i=0; i < ENT_MAX; i++) +- if (entropy_sources[i].init && entropy_sources[i].disabled == false) ++ if (entropy_sources[i].init && entropy_sources[i].disabled == false) { ++ rc = 0; + printf("%d: %s\n", i, entropy_sources[i].rng_name); +- return 1; ++ } ++ return rc; + } + + if (!ent_sources) { diff --git a/rngd-shutdown.patch b/rngd-shutdown.patch new file mode 100644 index 0000000..2f8a920 --- /dev/null +++ b/rngd-shutdown.patch @@ -0,0 +1,35 @@ +diff --git a/rngd_jitter.c b/rngd_jitter.c +index 23d96b3..43a13e0 100644 +--- a/rngd_jitter.c ++++ b/rngd_jitter.c +@@ -473,26 +473,22 @@ void close_jitter_entropy_source(struct rng *ent_src) + for (i=0; i < num_threads; i++) + tdata[i].active = 0; + +- flags = fcntl(pipefds[1], F_GETFL, 0); +- flags |= O_NONBLOCK; +- fcntl(pipefds[1], F_SETFL, &flags); ++ close(pipefds[1]); + + /* And wait for completion of each thread */ + for (i=0; i < num_threads; i++) { + message(LOG_DAEMON|LOG_DEBUG, "Checking on done for thread %d\n", i); + while (!tdata[i].done) ++ pthread_kill(threads[i], SIGINT); + if(tdata[i].done) { + message(LOG_DAEMON|LOG_INFO, "Closing thread %d\n", tdata[i].core_id); + pthread_join(threads[i], NULL); + jent_entropy_collector_free(tdata[i].ec); +- } else { +- read(pipefds[0], tmpbuf, 1024); ++ } else + sched_yield(); +- } + } + +- close(pipefds[2]); +- close(pipefds[1]); ++ close(pipefds[0]); + free(tdata); + free(threads); + return; diff --git a/rngd.service b/rngd.service new file mode 100644 index 0000000..3d9dcb5 --- /dev/null +++ b/rngd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Hardware RNG Entropy Gatherer Daemon + +[Service] +ExecStart=/sbin/rngd -f + +[Install] +WantedBy=multi-user.target diff --git a/sources b/sources new file mode 100644 index 0000000..51c99d2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (rng-tools-6.10.tar.gz) = b72d8918f709989ebc70cb9ea9c8b3dabf53041b24bc3f3a6de1bea318861dfd6c1a6110bd750041dc4819406db4a2b28f5137af5f5d5f2beb666f607913b389 diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..db70842 --- /dev/null +++ b/tests/README @@ -0,0 +1,2 @@ +initial tests: +run make check in src, which runs any selftests in the upstream source tarball diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..6238138 --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +#!/bin/bash +export TEST_DOCKER_EXTRA_ARGS="--security-opt seccomp:unconfined" +exec merge-standard-inventory "$@" diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile new file mode 100644 index 0000000..7b452de --- /dev/null +++ b/tests/selftest/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/patch/Sanity/selftest +# Description: Executes upstream test suite +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# 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=/CoreOS/rng-tools/Sanity/selftest +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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Vadkerti " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Executes upstream test suite" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: patch" >> $(METADATA) + @echo "Requires: patch gcc rpm-build automake libselinux-devel ed libattr-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL3 -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/selftest/PURPOSE b/tests/selftest/PURPOSE new file mode 100644 index 0000000..415147c --- /dev/null +++ b/tests/selftest/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/rng-tools/Sanity/selftest +Description: Executes rngtest to validate randomness of rng data +Author: Neil Horman + diff --git a/tests/selftest/runtest.sh b/tests/selftest/runtest.sh new file mode 100755 index 0000000..a826e4c --- /dev/null +++ b/tests/selftest/runtest.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/rng-tools/Sanity/selftest +# Description: Executes the upstream test suite comming with the package +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# 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 rhts environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="rng-tools" +PACKAGES="rng-tools automake autoconf libsysfs-devel libxml2 libxml2-devel openssl-devel libcurl-devel" +UPSTREAMPKG="rng-tools-*" +BUILDLOG=`mktemp` +TESTLOG=`mktemp` +TARGET=$(echo `uname -m` | egrep ppc) +if [[ $TARGET != "" ]]; then TARGET="--target `uname -m`"; fi +TOPDIR=`mktemp -d` +SPEC="$TOPDIR/SPECS/$PACKAGE*.spec" +TESTDIR="$TOPDIR/BUILD/$UPSTREAMPKG/" + +rlJournalStart + rlPhaseStartSetup + for PKG in $PACKAGES; do + rlAssertRpm $PKG + done + rlPhaseEnd + + rlPhaseStartTest + rlFetchSrcForInstalled $PACKAGE + rlRun "rpm -ivh --define '_topdir $TOPDIR' $PACKAGE*.src.rpm" 0 "Installing $PACKAGE src rpm" + echo "+ Building $PACKAGE (Log: $BUILDLOG)" + echo "+ Build command: rpmbuild -bc $SPEC $TARGET" + rlRun "rpmbuild --define '_topdir $TOPDIR' -bc $SPEC $TARGET &> $BUILDLOG" + echo "+ Buildlog:" + tail -n 100 $BUILDLOG + rlRun "pushd ." + rlRun "cd $TESTDIR" + rlRun "make check &> $TESTLOG" + if [ $? -eq 0 ] + then + rlPass "Selftest Passed" + else + rlFail "Selftest Failed" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..d65d773 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,16 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - selftest + required_packages: + - libsysfs-devel + - libxml2 + - libxml2-devel + - openssl-devel + - libcurl-devel + - libgcrypt-devel