CI Tests: updates Regression/bz471298-pthread_cond to use actual beakerlib functions

This commit is contained in:
Sergey Kolosov 2023-01-13 22:20:10 +01:00
parent 6d3d89d0ca
commit 87390fd480

View File

@ -1,3 +1,5 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# runtest.sh - bz471298-pthread_cond - Bugzilla(s) 471298
# Author: Petr Muller <pmuller@redhat.com>
# Location: /tools/glibc/Regression/bz471298-pthread_cond/runtest.sh
@ -18,29 +20,30 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
PACKAGE=glibc
# Include rhts environment
rpm -Uvh http://nest.test.redhat.com/mnt/qa/scratch/pmuller/rhtslib/rhtslib.rpm
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlStartJournal
rlPhaseStartSetup Preparation
rlAssertRpm ${PACKAGE}
rlRun 'gcc -lpthread -lrt pthread_cond_test.c -o pthread_test' 0 "Comnpiling the testcase"
rlPhaseEnd
PACKAGE="glibc"
TESTPROG="pthread_cond_test"
######################
# Begin Test-Case
######################
rlPhaseStartTest Test
rlWatchdog './pthread_test' 10
rlAssert0 "Checking if the command had to be killed (bug 471298)" $?
rlPhaseEnd
rlJournalStart
rlPhaseStartSetup
rlAssertRpm ${PACKAGE}
rlRun "TESTTMPDIR=$(mktemp -d)"
rlRun "cp ${TESTPROG}.c $TESTTMPDIR"
rlRun "pushd $TESTTMPDIR"
rlPhaseEnd
######################
# Clean after the test
######################
rlPhaseStartCleanup Clean-Up
rlRun "rm -f pthread_test" 0 "Cleaning up the executable"
rlPhaseEnd
rlPhaseStartTest Test
rlRun "gcc -lpthread -lrt ${TESTPROG}.c -o ${TESTPROG}"
rlAssertExists "${TESTPROG}"
rlWatchdog "./${TESTPROG}" 10
rlAssert0 "Checking if the command had to be killed (bug 471298)" $?
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd