CI Tests: updates Regression/bz464146-sp-corruption to use actual beakerlib functions
This commit is contained in:
parent
87390fd480
commit
353c8e0d93
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||||
# runtest.sh - bz464146-sp-corruption - Bugzilla(s) 464146
|
# runtest.sh - bz464146-sp-corruption - Bugzilla(s) 464146
|
||||||
# Author: Petr Muller <pmuller@redhat.com>
|
# Author: Petr Muller <pmuller@redhat.com>
|
||||||
# Location: /tools/glibc/Regression/bz464146-sp-corruption/runtest.sh
|
# Location: /tools/glibc/Regression/bz464146-sp-corruption/runtest.sh
|
||||||
@ -18,17 +20,19 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
PACKAGE=glibc
|
# Include Beaker environment
|
||||||
|
|
||||||
# Include rhts environment
|
|
||||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
rlStartJournal
|
|
||||||
|
|
||||||
######################
|
PACKAGE="glibc"
|
||||||
# Prepare environment
|
TESTPROG="testit"
|
||||||
######################
|
|
||||||
rlPhaseStartSetup Preparation
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
rlAssertRpm ${PACKAGE}
|
rlAssertRpm ${PACKAGE}
|
||||||
|
rlRun "TESTTMPDIR=$(mktemp -d)"
|
||||||
|
rlRun "cp ${TESTPROG}.c $TESTTMPDIR"
|
||||||
|
rlRun "pushd $TESTTMPDIR"
|
||||||
|
|
||||||
ARCH=`uname -m`
|
ARCH=`uname -m`
|
||||||
if [ "$ARCH" == "ia64" -o "$ARCH" == "aarch64" -o "$ARCH" == "ppc64le" ]
|
if [ "$ARCH" == "ia64" -o "$ARCH" == "aarch64" -o "$ARCH" == "ppc64le" ]
|
||||||
then
|
then
|
||||||
@ -36,32 +40,23 @@ rlPhaseStartSetup Preparation
|
|||||||
else
|
else
|
||||||
FLAGS="-m64"
|
FLAGS="-m64"
|
||||||
fi
|
fi
|
||||||
rlRun "gcc $FLAGS testit.c -o testit -lpthread" 0 "Compiling the testcase"
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseEnd
|
rlPhaseStartTest Test
|
||||||
|
rlRun "gcc $FLAGS ${TESTPROG}.c -o ${TESTPROG} -lpthread"
|
||||||
######################
|
rlAssertExists "${TESTPROG}"
|
||||||
# Begin Test-Case
|
./${TESTPROG} > log
|
||||||
######################
|
|
||||||
rlPhaseStartTest Test
|
|
||||||
output=`mktemp`
|
|
||||||
./testit > $output
|
|
||||||
RC=$?
|
RC=$?
|
||||||
|
|
||||||
rlAssert0 "Testing for success of the testcases" $RC
|
rlAssert0 "Testing for success of the testcases" $RC
|
||||||
rlAssertNotEquals "Testing for segfault (bug 464146)" $RC 139
|
rlAssertNotEquals "Testing for segfault (bug 464146)" $RC 139
|
||||||
rlAssertEquals "Testing for correct output - output should contain 1 line" `cat $output | wc -l` 1
|
rlAssertEquals "Testing for correct output - output should contain 1 line" `cat log | wc -l` 1
|
||||||
cat $output > /tmp/mineminemine
|
rlAssertGrep "received \"Hello World\!\"" log
|
||||||
rlAssertGrep "received \"Hello World\!\"" /tmp/mineminemine
|
rlPhaseEnd
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
######################
|
|
||||||
# Clean after the test
|
|
||||||
######################
|
|
||||||
rlPhaseStartCleanup Clean-Up
|
|
||||||
rlRun "rm -f $output testit"
|
|
||||||
rlCreateLogFromJournal > ${OUTPUTFILE}
|
|
||||||
rlCompareJournalWithRCW
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $TESTTMPDIR"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -26,7 +27,7 @@ int port;
|
|||||||
void *receiver(void *);
|
void *receiver(void *);
|
||||||
void *sender(void *);
|
void *sender(void *);
|
||||||
|
|
||||||
main(argc,argv)
|
int main(argc,argv)
|
||||||
int argc;
|
int argc;
|
||||||
char *argv[];
|
char *argv[];
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user