| |
@@ -0,0 +1,70 @@
|
| |
+ #!/bin/bash
|
| |
+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
| |
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| |
+ #
|
| |
+ # runtest.sh of /CoreOS/pth/Sanity/selftest
|
| |
+ # Description: Runs make tests on build
|
| |
+ # Author: Zbysek MRAZ <zmraz@redhat.com>
|
| |
+ #
|
| |
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| |
+ #
|
| |
+ # Copyright (c) 2010 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 rhts environment
|
| |
+ . /usr/bin/rhts-environment.sh
|
| |
+ . /usr/share/beakerlib/beakerlib.sh
|
| |
+
|
| |
+ PACKAGE="pth"
|
| |
+ TARGET=$(echo `uname -m` | egrep ppc)
|
| |
+ if [[ $TARGET != "" ]]; then
|
| |
+ if rlIsRHEL 4 5; then
|
| |
+ TARGET="--target ppc"
|
| |
+ else
|
| |
+ TARGET="--target `uname -m`";
|
| |
+ fi
|
| |
+ fi
|
| |
+
|
| |
+ rlJournalStart
|
| |
+ rlPhaseStartSetup
|
| |
+ rlAssertRpm $PACKAGE
|
| |
+ if rlIsRHEL 4 5; then
|
| |
+ BDIR='/usr/src/redhat'
|
| |
+ else
|
| |
+ BDIR='/root/rpmbuild'
|
| |
+ fi
|
| |
+ rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
|
| |
+ rlRun "pushd $TmpDir"
|
| |
+ rlFetchSrcForInstalled $PACKAGE
|
| |
+ rlRun "rpm -ivh $PACKAGE*.src.rpm" 0 "Installing source RPM"
|
| |
+ rlRun "rpmbuild -bc $BDIR/SPECS/${PACKAGE}.spec $TARGET" 0 "Building package"
|
| |
+ rlRun "cd $BDIR/BUILD/${PACKAGE}*"
|
| |
+ rlPhaseEnd
|
| |
+
|
| |
+ rlPhaseStartTest
|
| |
+ rlRun "make test > $TmpDir/tests.log 2>&1" 0 "Testing"
|
| |
+ rlAssertGrep "OK - ALL TESTS SUCCESSFULLY PASSED" $TmpDir/tests.log
|
| |
+ rlPhaseEnd
|
| |
+
|
| |
+ rlPhaseStartCleanup
|
| |
+ rlRun "popd"
|
| |
+ rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
| |
+ rlIsRHEL 6 7 && rlRun "rm -r $BDIR" 0 "Removing rpmbuild directory"
|
| |
+ rlPhaseEnd
|
| |
+ rlJournalPrintText
|
| |
+ rlJournalEnd
|
| |