Adapt test scripts to newest annobin versions

This commit is contained in:
Václav Kadlčík 2023-01-24 15:15:39 +01:00
parent bc0466b88d
commit f45bd71eb3
3 changed files with 6 additions and 8 deletions

View File

@ -28,13 +28,10 @@
# Include Beaker environment # Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart rlJournalStart
rlPhaseStartSetup rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir" rlRun "pushd $TmpDir"
rlRun "rpm -q annobin-annocheck gcc"
rlPhaseEnd rlPhaseEnd
rlPhaseStartTest rlPhaseStartTest
@ -43,7 +40,7 @@ rlJournalStart
rlRun "gcc `rpm --eval %build_cflags` -fpic -c f1.c" rlRun "gcc `rpm --eval %build_cflags` -fpic -c f1.c"
rlRun "gcc `rpm --eval %build_cflags` -fpic -c f2.c" rlRun "gcc `rpm --eval %build_cflags` -fpic -c f2.c"
rlRun "gcc `rpm --eval %build_ldflags` -shared f1.o f2.o" rlRun "gcc `rpm --eval %build_ldflags` -shared f1.o f2.o"
rlRun "annocheck -v a.out" rlRun "annocheck -v --skip-lto a.out"
rlPhaseEnd rlPhaseEnd
rlPhaseStartCleanup rlPhaseStartCleanup

View File

@ -62,7 +62,7 @@ rlJournalStart
rlRun "pushd $TMP" rlRun "pushd $TMP"
rlFetchSrcForInstalled $PACKAGE rlFetchSrcForInstalled $PACKAGE
rlRun "yum-builddep -y *src.rpm" rlRun "dnf builddep -y *src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm" rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec" rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec"
rlPhaseEnd rlPhaseEnd

View File

@ -28,8 +28,6 @@
# Include Beaker environment # Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart rlJournalStart
rlPhaseStartSetup rlPhaseStartSetup
rlRun "TMP=$(mktemp -d)" rlRun "TMP=$(mktemp -d)"
@ -41,7 +39,10 @@ rlJournalStart
samplecnt=$(ls *.sample | wc -l) samplecnt=$(ls *.sample | wc -l)
testcnt=$(ls *.sample | \ testcnt=$(ls *.sample | \
xargs annocheck |& \ xargs annocheck |& \
fgrep '.sample: is not an ELF format file' | wc -l) grep -F \
-e '.sample: unable to read magic number' \
-e '.sample: is not an ELF format file' \
| wc -l)
rlRun "test $samplecnt -eq 300" rlRun "test $samplecnt -eq 300"
rlRun "test $testcnt -eq 300" rlRun "test $testcnt -eq 300"
rlPhaseEnd rlPhaseEnd