69 lines
2.4 KiB
Bash
69 lines
2.4 KiB
Bash
|
#!/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 <mvadkert@redhat.com>
|
||
|
#
|
||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
#
|
||
|
# 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="python-drgn"
|
||
|
PACKAGES="drgn python3-devel python3-setuptools sed python3-pytest gcc-c++ make bzip2-devel elfutils-devel libkdumpfile-devel xz-devel autoconf automake libtool zlib-ng-compat-devel"
|
||
|
UPSTREAMPKG="python-drgn-*"
|
||
|
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 drgn
|
||
|
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 '_package_note_flags %nil' --define '_topdir $TOPDIR' -bc $SPEC $TARGET &> $BUILDLOG"
|
||
|
if [ $? -eq 0 ]
|
||
|
then
|
||
|
rlPass "Selftest Passed"
|
||
|
else
|
||
|
rlFail "Selftest Failed"
|
||
|
fi
|
||
|
rlPhaseEnd
|
||
|
|
||
|
rlPhaseStartCleanup
|
||
|
rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm"
|
||
|
rlPhaseEnd
|
||
|
rlJournalPrintText
|
||
|
rlJournalEnd
|