Compare commits

..

No commits in common. "f37-riscv64" and "master" have entirely different histories.

32 changed files with 184 additions and 1883 deletions

View File

@ -1 +0,0 @@
1

108
.gitignore vendored
View File

@ -1,2 +1,106 @@
/annobin-*.tar.xz
/annobin-9.51-1.fc34.src.rpm
/annobin-2.0.tar.xz
/annobin-2.1.tar.xz
/annobin-2.2.tar.xz
/annobin-2.3.tar.lz
/annobin-2.3.tar.xz
/annobin-2.4.tar.xz
/annobin-2.5.tar.xz
/annobin-2.5.1.tar.xz
/annobin-3.0.tar.xz
/annobin-3.1.tar.xz
/annobin-3.2.tar.xz
/annobin-3.3.tar.xz
/annobin-3.4.tar.xz
/annobin-3.5.tar.xz
/annobin-3.6.tar.xz
/annobin-5.0.tar.xz
/annobin-5.1.tar.xz
/annobin-5.2.tar.xz
/annobin-5.3.tar.xz
/annobin-5.4.tar.xz
/annobin-5.5.tar.xz
/annobin-5.6.tar.xz
/annobin-5.7.tar.xz
/annobin-5.8.tar.xz
/annobin-5.9.tar.xz
/annobin-5.10.tar.xz
/annobin-5.11.tar.xz
/annobin-6.0.tar.xz
/annobin-6.1.tar.xz
/annobin-6.2.tar.xz
/annobin-6.3.tar.xz
/annobin-6.4.tar.xz
/annobin-6.5.tar.xz
/annobin-6.6.tar.xz
/annobin-7.0.tar.xz
/annobin-7.1.tar.xz
/annobin-8.0.tar.xz
/annobin-8.1.tar.xz
/annobin-8.2.tar.xz
/annobin-8.3.tar.xz
/annobin-8.4.tar.xz
/annobin-8.5.tar.xz
/annobin-8.6.tar.xz
/annobin-8.7.tar.xz
/annobin-8.8.tar.xz
/annobin-8.9.tar.xz
/annobin-8.10.tar.xz
/annobin-8.11.tar.xz
/annobin-8.12.tar.xz
/annobin-8.13.tar.xz
/annobin-8.14.tar.xz
/annobin-8.15.tar.xz
/annobin-8.16.tar.xz
/annobin-8.17.tar.xz
/annobin-8.18.tar.xz
/annobin-8.19.tar.xz
/annobin-8.20.tar.xz
/annobin-8.21.tar.xz
/annobin-8.22.tar.xz
/annobin-8.23.tar.xz
/annobin-8.24.tar.xz
/annobin-8.25.tar.xz
/annobin-8.26.tar.xz
/annobin-8.27.tar.xz
/annobin-8.29.tar.xz
/annobin-8.30.tar.xz
/annobin-8.31.tar.xz
/annobin-8.32.tar.xz
/annobin-8.33.tar.xz
/annobin-8.34.tar.xz
/annobin-8.35.tar.xz
/annobin-8.36.tar.xz
/annobin-8.37.tar.xz
/annobin-8.38.tar.xz
/annobin-8.39.tar.xz
/annobin-8.41.tar.xz
/annobin-8.44.tar.xz
/annobin-8.45.tar.xz
/annobin-8.48.tar.xz
/annobin-8.49.tar.xz
/annobin-8.50.tar.xz
/annobin-8.51.tar.xz
/annobin-8.52.tar.xz
/annobin-8.53.tar.xz
/annobin-8.55.tar.xz
/annobin-8.56.tar.xz
/annobin-8.57.tar.xz
/annobin-8.58.tar.xz
/annobin-8.59.tar.xz
/annobin-8.60.tar.xz
/annobin-8.61.tar.xz
/annobin-8.62.tar.xz
/annobin-8.63.tar.xz
/annobin-8.64.tar.xz
/annobin-8.65.tar.xz
/annobin-8.66.tar.xz
/annobin-8.67.tar.xz
/annobin-8.68.tar.xz
/annobin-8.69.tar.xz
/annobin-8.70.tar.xz
/annobin-8.71.tar.xz
/annobin-8.72.tar.xz
/annobin-8.73.tar.xz
/annobin-8.74.tar.xz
/annobin-8.76.tar.xz
/annobin-8.77.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,6 +0,0 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -1 +1 @@
SHA512 (annobin-10.91.tar.xz) = d7c6e77f3e0385dccf1bb3fba4804675a679ec02a192768974ccad22350dcf6858232708189615ee3063da83b0372afca5b66d82282df49903cd4178913fa9d2
SHA512 (annobin-8.77.tar.xz) = d9d393aa359ab58a24d295dd4108b0255e39cf9210ec99125ce3f3589adff795aba50234817b38134964caa2fc92cf04d6c6e2945ae6cc2e1145033383cc58cb

View File

@ -1,2 +0,0 @@
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
for backward compatibility with traditional beakerlib test harness in RHEL.

View File

@ -1,16 +0,0 @@
summary: Test for BZ#1958954 (annobin fails to skip endbr64 entry point check)
description: |
Bug summary: annobin fails to skip endbr64 entry point check for shared objects
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1958954
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin-annocheck
- gcc
duration: 48h
extra-summary: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check
extra-task: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check

View File

@ -1,54 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check
# Description: Test for BZ#1958954 (annobin fails to skip endbr64 entry point check)
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "rpm -q annobin-annocheck gcc"
rlPhaseEnd
rlPhaseStartTest
rlRun "echo 'void f1(void) {}' > f1.c"
rlRun "echo 'void f2(void) {}' > f2.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_ldflags` -shared f1.o f2.o"
rlRun "annocheck -v a.out"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,21 +0,0 @@
summary: identify
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
- devtoolset-10
- devtoolset-10-annocheck
- devtoolset-11
- devtoolset-11-annocheck
- gcc-toolset-10
- gcc-toolset-10-annocheck
- gcc-toolset-11
- gcc-toolset-11-annocheck
duration: 48h
extra-summary: /tools/annobin/Regression/identify
extra-task: /tools/annobin/Regression/identify

View File

@ -1,43 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/identify
# Description: identify
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "tool_v=$(annocheck --version | awk '/^annocheck: Version/ {print $3}')"
rlRun "__RPM=$(rpm --queryformat='%{name}\n' -qf $(man -w annobin))"
rlRun "rpm_v=$(rpm -q --queryformat='%{version}\n' $__RPM)"
# Following fails for annobin-8.89-2.el8
rlRun "[[ "x${tool_v}" == "x${rpm_v}." ]]"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,16 +0,0 @@
summary: lto-preprocessor-options
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- annobin
- annobin-annocheck
- redhat-rpm-config
duration: 48h
extra-summary: /tools/annobin/Regression/lto-preprocessor-options
extra-task: /tools/annobin/Regression/lto-preprocessor-options

View File

@ -1,44 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/lto-preprocessor-options
# Description: lto-preprocessor-options
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
b=`mktemp`
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "cflags=\"$(rpm --eval '%build_cflags')\""
rlRun "ldflags=\"$(rpm --eval '%build_ldflags')\""
rlRun "echo 'int main (void) { return 0; }' | gcc -xc -o $b $cflags $ldflags -flto - "
rlRun "annocheck -v $b"
rm $b
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,16 +0,0 @@
summary: missing-check-for-x86-property-note-content
description: |
Bug summary: annobin: Missing check for contents of x86 property note
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1991931
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1991931
extra-summary: /tools/annobin/Regression/missing-check-for-x86-property-note-content
extra-task: /tools/annobin/Regression/missing-check-for-x86-property-note-content

View File

@ -1,40 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/missing-check-for-x86-property-note-content
# Description: missing-check-for-x86-property-note-content
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "annocheck main" 1
rlRun "annocheck --fixed-format-messages main | \
grep '^Hardened: FAIL: test: cf-protection file: main.$'"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,16 +0,0 @@
summary: processing-params-in-reverse-order
description: |
Bug summary: annocheck processes (reports) parameters in reverse order
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988714
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988714
extra-summary: /tools/annobin/Regression/processing-params-in-reverse-order
extra-task: /tools/annobin/Regression/processing-params-in-reverse-order

View File

@ -1,42 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/processing-params-in-reverse-order
# Description: processing-params-in-reverse-order
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "TMP=$(mktemp)"
rlRun "annocheck --verbose --skip-all --test-stack-prot /bin/bash /bin/cat |& tee $TMP"
rlRun "fgrep -i /bin/ $TMP | head -1 | fgrep /bash"
rlRun "fgrep -i /bin/ $TMP | tail -1 | fgrep /cat"
rlRun "rm -f $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,17 +0,0 @@
summary: segv-when-processing-multiple-params-incl-symlink
description: |
Bug summary: annocheck segfaults sometimes when processing multiple parameters and symlink is involved
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988715
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
- libstdc++
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988715
extra-summary: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink
extra-task: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink

View File

@ -1,44 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink
# Description: segv-when-processing-multiple-params-incl-symlink
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
# This tries to test https://bugzilla.redhat.com/show_bug.cgi?id=1988715#c0
# keeping in mind that annocheck will evolve in the future, along its
# rules / policies, and the surrounding OS will evolve too. This test
# shouldn't report false positives though.
rlRun "rpm -qf /usr/lib64/libstdc++.so*"
rlRun "annocheck --follow-links --skip-all /usr/lib64/libstdc++.so*"
rlRun "annocheck --ignore-links --skip-all /usr/lib64/libstdc++.so*"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,28 +0,0 @@
summary: testsuite
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
- annobin-annocheck
- binutils-devel
- gcc
- gcc-c++
- elfutils
- elfutils-devel
- make
- rpm-build
- rpm-devel
- gcc-plugin-devel
- yum
- dnf
- yum-utils
- bzip2-devel
- rpm-build
duration: 48h
extra-summary: /tools/annobin/Regression/testsuite
extra-task: /tools/annobin/Regression/testsuite

View File

@ -1,85 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/testsuite
# Description: testsuite
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="${PACKAGE:-$(rpm -qf --queryformat=%{name} $(man -w annobin))}"
export PACKAGE
GCC="${GCC:-$(which gcc)}"
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "X_SCLS=$X_SCLS"
rlLogInfo "GCC=$GCC"
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
# In case more than one devtoolset- or gcc-toolset -build package is
# installed (they can co-exist from the packaging persp, but their
# coexistence causes unexpected results with rpm macros), then we have
# a mess of defined rpm macros coming e.g. from
# /etc/rpm/macros.gcc-toolset-10-config
# /etc/rpm/macros.gcc-toolset-9-config etc. To have just the needed
# macros (respective to given SCL under test) defined without
# uninstalling unneeded RPMs, we'll need an override mechanism. The
# following assumes just one SCL *enabled* (more than one installed),
# and doesn't care of a (useless) revert:
echo ${X_SCLS} | fgrep toolset && \
rlRun "cat /etc/rpm/*${X_SCLS%\ }* > ~/.rpmmacros"
rlAssertRpm $PACKAGE
rlRun "TMP=\$(mktemp -d)"
rlRun "pushd $TMP"
rlFetchSrcForInstalled $PACKAGE
rlRun "yum-builddep -y *src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec"
rlPhaseEnd
rlPhaseStartTest
rlRun "pushd BUILD/annobin-*"
set -o pipefail
rlRun "make check |& tee $TMP/check.log"
rlRun -l "grep '^PASS:' $TMP/check.log" 0
rlRun -l "grep '^FAIL:' $TMP/check.log" 1
PASSCOUNT=$(grep '^PASS:' $TMP/check.log | wc -l)
rlRun "[[ $PASSCOUNT -ge 7 ]]"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,16 +0,0 @@
summary: Test for BZ#1973981 (annocheck silently ignores any file parameter)
description: |
Bug summary: annocheck silently ignores any file parameter beyond 256
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1973981
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1973981
extra-summary: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter
extra-task: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter

View File

@ -1,54 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter
# Description: Test for BZ#1973981 (annocheck silently ignores any file parameter)
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartSetup
rlRun "TMP=$(mktemp -d)"
rlRun "pushd $TMP"
rlPhaseEnd
rlPhaseStartTest
for i in `seq 0 299`; do touch ${i}.sample; done
samplecnt=$(ls *.sample | wc -l)
testcnt=$(ls *.sample | \
xargs annocheck |& \
fgrep '.sample: is not an ELF format file' | wc -l)
rlRun "test $samplecnt -eq 300"
rlRun "test $testcnt -eq 300"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,5 +0,0 @@
#include <stdio.h>
void hello() {
printf("Hello World\n");
}

View File

@ -1,5 +0,0 @@
#include <iostream>
void hello() {
std::cout << "Hello World\n";
}

View File

@ -1,6 +0,0 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View File

@ -1,6 +0,0 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View File

@ -1,17 +0,0 @@
summary: gcc-fedora-flags
description: ''
contact:
- Tom Stellard <tstellar@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- gcc-c++
- annobin
- annobin-annocheck
- redhat-rpm-config
duration: 1h
extra-summary: /tools/annobin/Sanity/gcc-fedora-flags
extra-task: /tools/annobin/Sanity/gcc-fedora-flags

View File

@ -1,40 +0,0 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
set -x
default_cflags=`rpm -E %{build_cflags}`
default_cxxflags=`rpm -E %{build_cxxflags}`
default_ldflags=`rpm -E %{build_ldflags}`
cflags=`rpm -D '%toolchain gcc' -E %{build_cflags}`
cxxflags=`rpm -D '%toolchain gcc' -E %{build_cxxflags}`
ldflags=`rpm -D '%toolchain gcc' -E %{build_ldflags}`
set +x
rlJournalStart
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "test \"$default_cflags\" = \"$cflags\""
rlRun "test \"$default_cxxflags\" = \"$cxxflags\""
rlRun "test \"$default_ldflags\" = \"$ldflags\""
rlRun "gcc $cflags -o hello.o -c hello.c"
rlRun "annocheck hello.o"
rlRun "gcc $cflags -o main.o -c main.c"
rlRun "gcc $ldflags -o hello main.o hello.o"
rlRun "annocheck hello"
rlRun "./hello | grep \"Hello World\""
rlRun "g++ $cxxflags -o hello-cpp.o -c hello.cpp"
rlRun "annocheck hello-cpp.o"
rlRun "g++ $cxxflags -o main-cpp.o -c main.cpp"
rlRun "g++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o"
rlRun "annocheck hello-cpp"
rlRun "./hello-cpp | grep \"Hello World\""
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,16 +0,0 @@
summary: smoke test for annobin plugin
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- man-db
- gcc
- annobin
- annobin-annocheck
duration: 48h
extra-summary: /tools/annobin/Sanity/smoke
extra-task: /tools/annobin/Sanity/smoke

View File

@ -1,45 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Sanity/smoke
# Description: smoke test for annobin plugin
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartSetup
rlRun "which gcc"
rlRun "man -w annobin"
rlRun "echo $X_SCLS"
rlPhaseEnd
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "echo 'int main() {return 0;}' | gcc -xc -fplugin=annobin -o /dev/null -"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd