From a85087f79e4b8cd5280144b2d45cc77f60b35498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kadl=C4=8D=C3=ADk?= Date: Wed, 29 Mar 2023 10:02:47 +0200 Subject: [PATCH] Import RHEL tests usable in Fedora --- .../main.fmf | 33 +++++ .../runtest.sh | 100 ++++++++++++++ .../main.fmf | 55 ++++++++ .../runtest.sh | 115 ++++++++++++++++ .../main.fmf | 47 +++++++ .../runtest.sh | 84 +++++++++++ .../main.fmf | 76 ++++++++++ .../runtest.sh | 107 ++++++++++++++ .../main.fmf | 33 +++++ .../runtest.sh | 103 ++++++++++++++ .../main.fmf | 36 +++++ .../runtest.sh | 125 +++++++++++++++++ .../main.fmf | 36 +++++ .../runtest.sh | 130 ++++++++++++++++++ .../main.fmf | 32 +++++ .../runtest.sh | 98 +++++++++++++ .../main.fmf | 48 +++++++ .../runtest.sh | 104 ++++++++++++++ .../main.fmf | 33 +++++ .../runtest.sh | 81 +++++++++++ .../main.fmf | 38 +++++ .../runtest.sh | 79 +++++++++++ .../main.fmf | 36 +++++ .../runtest.sh | 119 ++++++++++++++++ Regression/identify/main.fmf | 19 +++ Regression/identify/runtest.sh | 39 ++++++ Regression/lto-preprocessor-options/main.fmf | 35 +++++ .../lto-preprocessor-options/runtest.sh | 39 ++++++ .../main | Bin 0 -> 27456 bytes .../main.fmf | 31 +++++ .../runtest.sh | 38 +++++ .../main.fmf | 31 +++++ .../runtest.sh | 40 ++++++ .../main.fmf | 40 ++++++ .../runtest.sh | 104 ++++++++++++++ .../main.fmf | 34 +++++ .../runtest.sh | 63 +++++++++ Regression/testsuite/main.fmf | 43 ++++++ Regression/testsuite/runtest.sh | 83 +++++++++++ .../files/main_with_gaps_in_notes | Bin 0 -> 33104 bytes .../files/main_with_no_notes | Bin 0 -> 14400 bytes .../main.fmf | 33 +++++ .../runtest.sh | 98 +++++++++++++ .../main.fmf | 39 ++++++ .../runtest.sh | 102 ++++++++++++++ .../main.fmf | 36 +++++ .../runtest.sh | 60 ++++++++ .../main.fmf | 42 ++++++ .../runtest.sh | 124 +++++++++++++++++ Sanity/man_pages_present/main.fmf | 37 +++++ Sanity/man_pages_present/runtest.sh | 108 +++++++++++++++ Sanity/smoke/main.fmf | 27 ++++ Sanity/smoke/runtest.sh | 44 ++++++ 53 files changed, 3137 insertions(+) create mode 100644 Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf create mode 100755 Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh create mode 100644 Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/main.fmf create mode 100755 Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/runtest.sh create mode 100644 Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/main.fmf create mode 100755 Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/runtest.sh create mode 100644 Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/main.fmf create mode 100755 Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/runtest.sh create mode 100644 Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/main.fmf create mode 100755 Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/runtest.sh create mode 100644 Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/main.fmf create mode 100755 Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/runtest.sh create mode 100644 Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built/main.fmf create mode 100755 Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built/runtest.sh create mode 100644 Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/main.fmf create mode 100755 Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/runtest.sh create mode 100644 Regression/bz2022973-annobin-needs-to-be-taught-about/main.fmf create mode 100755 Regression/bz2022973-annobin-needs-to-be-taught-about/runtest.sh create mode 100644 Regression/bz2039747-Missing-cpio-dependency/main.fmf create mode 100755 Regression/bz2039747-Missing-cpio-dependency/runtest.sh create mode 100644 Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/main.fmf create mode 100755 Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/runtest.sh create mode 100644 Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/main.fmf create mode 100755 Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/runtest.sh create mode 100644 Regression/identify/main.fmf create mode 100755 Regression/identify/runtest.sh create mode 100644 Regression/lto-preprocessor-options/main.fmf create mode 100755 Regression/lto-preprocessor-options/runtest.sh create mode 100644 Regression/missing-check-for-x86-property-note-content/main create mode 100644 Regression/missing-check-for-x86-property-note-content/main.fmf create mode 100755 Regression/missing-check-for-x86-property-note-content/runtest.sh create mode 100644 Regression/processing-params-in-reverse-order/main.fmf create mode 100755 Regression/processing-params-in-reverse-order/runtest.sh create mode 100644 Regression/report-missing-FORTIFY-SOURCE-as-error/main.fmf create mode 100755 Regression/report-missing-FORTIFY-SOURCE-as-error/runtest.sh create mode 100644 Regression/segv-when-processing-multiple-params-incl-symlink/main.fmf create mode 100755 Regression/segv-when-processing-multiple-params-incl-symlink/runtest.sh create mode 100644 Regression/testsuite/main.fmf create mode 100755 Regression/testsuite/runtest.sh create mode 100755 Regression/wrong-compiler-flags-but-no-failure/files/main_with_gaps_in_notes create mode 100755 Regression/wrong-compiler-flags-but-no-failure/files/main_with_no_notes create mode 100644 Regression/wrong-compiler-flags-but-no-failure/main.fmf create mode 100755 Regression/wrong-compiler-flags-but-no-failure/runtest.sh create mode 100644 Sanity/allow_multiple_instances_of_fplugin/main.fmf create mode 100755 Sanity/allow_multiple_instances_of_fplugin/runtest.sh create mode 100644 Sanity/annocheck-silently-ignores-any-file-parameter/main.fmf create mode 100755 Sanity/annocheck-silently-ignores-any-file-parameter/runtest.sh create mode 100644 Sanity/bz2067148-support_syncing_with_gcc/main.fmf create mode 100755 Sanity/bz2067148-support_syncing_with_gcc/runtest.sh create mode 100644 Sanity/man_pages_present/main.fmf create mode 100755 Sanity/man_pages_present/runtest.sh create mode 100644 Sanity/smoke/main.fmf create mode 100755 Sanity/smoke/runtest.sh diff --git a/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf b/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf new file mode 100644 index 0000000..c9f84da --- /dev/null +++ b/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf @@ -0,0 +1,33 @@ +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 +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - gcc + - redhat-rpm-config +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1958954 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2020294 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2020287 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false +extra-nitrate: TC#0610974 +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 +id: 357a0573-b070-4a35-8f7d-4822fe15d49c diff --git a/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh b/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh new file mode 100755 index 0000000..968d528 --- /dev/null +++ b/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh @@ -0,0 +1,100 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME redhat-rpm-config" +PACKAGES+=" ${ANNOCHECK_RPM_NAME/annobin-annocheck/gcc}" # Let's work with GCC of the same OS/GTS/DTS annocheck belongs to + +ANNOCHECK_SWITCHES='--verbose' + +rlJournalStart + rlPhaseStartSetup + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + # In general, we need to pass switches suitable for the respective OS. In the future + # an option like --profile=el should be available so let's leave + # a TODO here to use it. Until then we have to resort to maintaining a mess of ifs. + if rlIsRHEL '<9'; then + if annocheck --skip-lto $ANNOCHECK |& grep -q -i 'Unrecognised command line option'; then + : # --skip-lto is unknow, no need to use it + else + ANNOCHECK_SWITCHES+=' --skip-lto' # LTO si enabled on RHEL9+ only + fi + fi + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + 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 $ANNOCHECK_SWITCHES a.out" + cp a.out /tmp/ + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/main.fmf b/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/main.fmf new file mode 100644 index 0000000..9f0c442 --- /dev/null +++ b/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/main.fmf @@ -0,0 +1,55 @@ +summary: Test for BZ#1981410 (annocheck reports that /sbin/ldconfig stack) +description: | + Bug summary: annocheck reports that /sbin/ldconfig stack protection deliberately disabled + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1981410 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - dnf-utils + - yum-utils + - annobin + - annobin-plugin-gcc + - annobin-annocheck + - devtoolset-10-annobin + - devtoolset-10-annobin-plugin-gcc + - devtoolset-10-annobin-annocheck + - devtoolset-11-annobin + - devtoolset-11-annobin-plugin-gcc + - devtoolset-11-annobin-annocheck + - devtoolset-12-annobin + - devtoolset-12-annobin-plugin-gcc + - devtoolset-12-annobin-annocheck + - gcc-toolset-10-annobin + - gcc-toolset-10-annobin-plugin-gcc + - gcc-toolset-10-annobin-annocheck + - gcc-toolset-11-annobin + - gcc-toolset-11-annobin-plugin-gcc + - gcc-toolset-11-annobin-annocheck + - gcc-toolset-12-annobin + - gcc-toolset-12-annobin-plugin-gcc + - gcc-toolset-12-annobin-annocheck +duration: 1h +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1981410 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + - enabled: false + when: collection == gcc-toolset-10, devtoolset-10 + continue: false + because: annobin<10.09, known to fail +extra-nitrate: TC#0611914 +extra-summary: /tools/annobin/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack +extra-task: /tools/annobin/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack +id: a3920cc2-6dab-4090-8b81-81e085aa4fe8 diff --git a/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/runtest.sh b/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/runtest.sh new file mode 100755 index 0000000..fa4e813 --- /dev/null +++ b/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack/runtest.sh @@ -0,0 +1,115 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz1981410-annocheck-reports-that-sbin-ldconfig-stack +# Description: Test for BZ#1981410 (annocheck reports that /sbin/ldconfig stack) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<10.09 +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +ARCH=$(arch) + +rlJournalStart + rlPhaseStartSetup + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "debuginfo-install -y glibc.$ARCH" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + # Note on RHBZ#1981410 + # + # The bug became convoluted over time, partly because several bugs were discussed and processed. + # + # Let's keep this test focused on just one thing, the problem described in the original bug report: + # --test-stack-prot shouldn't fail on /sbin/ldconfig + # Regarding the reproducing command, let's not use '--test-pic --test-pie'. For ldconfig, it's not + # really relevant (#c37). + # + # The other problems deserving their own tests are: + # * the file descriptor issue and + # * many command line arguments + # I'm leaving them as TODO for later. + + rlPhaseStartTest + rlRun 'annocheck --verbose --ignore-gaps --skip-all --test-stack-prot /sbin/ldconfig &>annocheck.out' + if [[ $? -ne 0 ]]; then + rlLogInfo 'annocheck wrote:' + cat annocheck.out | while read line; do + if echo "$line" |& grep -i fail; then + rlLogError "$line" + else + rlLogInfo "$line" + fi + done + rlFileSubmit annocheck.out annocheck.out + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/main.fmf b/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/main.fmf new file mode 100644 index 0000000..53dfac8 --- /dev/null +++ b/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/main.fmf @@ -0,0 +1,47 @@ +summary: Test for BZ#1996963 (annocheck segfaults on ppc64le /lib64/libc.so.6) +description: | + Bug summary: annocheck segfaults on ppc64le /lib64/libc.so.6 with debuginfo + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1996963 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - dnf-utils + - yum-utils + - annobin + - annobin-plugin-gcc + - annobin-annocheck + - devtoolset-10-annobin + - devtoolset-10-annobin-plugin-gcc + - devtoolset-10-annobin-annocheck + - devtoolset-11-annobin + - devtoolset-11-annobin-plugin-gcc + - devtoolset-11-annobin-annocheck + - devtoolset-12-annobin + - devtoolset-12-annobin-plugin-gcc + - devtoolset-12-annobin-annocheck + - gcc-toolset-10-annobin + - gcc-toolset-10-annobin-plugin-gcc + - gcc-toolset-10-annobin-annocheck + - gcc-toolset-11-annobin + - gcc-toolset-11-annobin-plugin-gcc + - gcc-toolset-11-annobin-annocheck + - gcc-toolset-12-annobin + - gcc-toolset-12-annobin-plugin-gcc + - gcc-toolset-12-annobin-annocheck +duration: 30m +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1996963 +adjust: + - enabled: false + when: distro < rhel-7 + continue: false +extra-nitrate: TC#0611913 +extra-summary: /tools/annobin/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6 +extra-task: /tools/annobin/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6 +id: 92b830c4-57ba-440a-9fc3-e6b8581beca2 diff --git a/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/runtest.sh b/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/runtest.sh new file mode 100755 index 0000000..294ee95 --- /dev/null +++ b/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6/runtest.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz1996963-annocheck-segfaults-on-ppc64le-lib64-libc-so-6 +# Description: Test for BZ#1996963 (annocheck segfaults on ppc64le /lib64/libc.so.6) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +ARCH=$(arch) + +rlJournalStart + rlPhaseStartSetup + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + LIBC_SO=$(rpm -ql glibc.$ARCH | grep '^/lib.*/libc\.so\.[0-9]*$' | head -n 1) + if [[ -z "LIBC_SO" ]]; then + rlFail 'libc.so not found' + fi + rlLogInfo "LIBC_SO=$LIBC_SO" + + rlRun "debuginfo-install -y glibc.$ARCH" + rlPhaseEnd + + rlPhaseStartTest + # The exit value we definitely do not want is 139 which corresponds to segfaulting + rlRun "annocheck --verbose --verbose --ignore-gaps --skip-all --test-pic --test-pie --test-stack-prot $LIBC_SO" 0,1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/main.fmf b/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/main.fmf new file mode 100644 index 0000000..5257df0 --- /dev/null +++ b/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/main.fmf @@ -0,0 +1,76 @@ +summary: Test for BZ#1998472 (annocheck complains "MAYB test notes" on empty) +description: | + Bug summary: annocheck complains "MAYB: test: notes" on empty program [aarch64] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1998472 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - redhat-rpm-config +recommend: + - annobin + - annobin-plugin-gcc + - annobin-annocheck + - gcc-c++ + - devtoolset-10-annobin + - devtoolset-10-annobin-plugin-gcc + - devtoolset-10-annobin-annocheck + - devtoolset-10-binutils-devel + - devtoolset-10-elfutils-devel + - devtoolset-10-gcc-c++ + - devtoolset-11-annobin + - devtoolset-11-annobin-plugin-gcc + - devtoolset-11-annobin-annocheck + - devtoolset-11-binutils-devel + - devtoolset-11-elfutils-devel + - devtoolset-11-gcc-c++ + - devtoolset-12-annobin + - devtoolset-12-annobin-plugin-gcc + - devtoolset-12-annobin-annocheck + - devtoolset-12-binutils-devel + - devtoolset-12-elfutils-devel + - devtoolset-12-gcc-c++ + - gcc-toolset-10-annobin + - gcc-toolset-10-annobin-plugin-gcc + - gcc-toolset-10-annobin-annocheck + - gcc-toolset-10-binutils-devel + - gcc-toolset-10-elfutils-devel + - gcc-toolset-10-gcc-c++ + - gcc-toolset-11-annobin + - gcc-toolset-11-annobin-plugin-gcc + - gcc-toolset-11-annobin-annocheck + - gcc-toolset-11-binutils-devel + - gcc-toolset-11-elfutils-devel + - gcc-toolset-11-gcc-c++ + - gcc-toolset-12-annobin + - gcc-toolset-12-annobin-plugin-gcc + - gcc-toolset-12-annobin-annocheck + - gcc-toolset-12-binutils-devel + - gcc-toolset-12-elfutils-devel + - gcc-toolset-12-gcc-c++ +duration: 20m +enabled: true +tag: + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1998472 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + because: No annobin there or older redhat-rpm-config + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<10.10, known to fail + - enabled: false + when: collection == gcc-toolset-10, devtoolset-10 + continue: false + because: annobin<10.10, known to fail +extra-nitrate: TC#0611910 +extra-summary: /tools/annobin/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty +extra-task: /tools/annobin/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty +id: 016ebcd8-fedb-481c-903c-505a12432641 diff --git a/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/runtest.sh b/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/runtest.sh new file mode 100755 index 0000000..9f1ef56 --- /dev/null +++ b/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty/runtest.sh @@ -0,0 +1,107 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz1998472-annocheck-complains-MAYB-test-notes-on-empty +# Description: Test for BZ#1998472 (annocheck complains "MAYB test notes" on empty) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<10.10 or with older redhat-rpm-config +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 +# - RHEL <8 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" +ANNOCHECK_SWITCHES='-v' + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME redhat-rpm-config" +PACKAGES+=" ${ANNOCHECK_RPM_NAME/annobin-annocheck/gcc}" # Let's work with GCC of the same OS/GTS/DTS annocheck belongs to + +rlJournalStart + rlPhaseStartSetup + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + BUILD_CFLAGS="$(rpm --eval '%{build_cflags}')" + BUILD_LDFLAGS="$(rpm --eval '%{build_ldflags}')" + rlLogInfo "BUILD_CFLAGS=$BUILD_CFLAGS" + rlLogInfo "BUILD_LDFLAGS=$BUILD_LDFLAGS" + + # In general, we need to pass switches suitable for the respective OS. In the future + # an option like --profile=el should be available so let's leave + # a TODO here to use it. Until then we have to resort to maintaining a mess of ifs. + if rlIsRHEL '<9'; then + if annocheck --skip-lto $ANNOCHECK |& grep -q -i 'Unrecognised command line option'; then + : # --skip-lto is unknow, no need to use it + else + ANNOCHECK_SWITCHES+=' --skip-lto' # LTO si enabled on RHEL9+ only + fi + fi + rlLogInfo "ANNOCHECK_SWITCHES=$ANNOCHECK_SWITCHES" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlRun 'echo "int main(void){return 0;}" >main.c' + rlRun "gcc $BUILD_CFLAGS $BUILD_LDFLAGS -o main main.c" + rlPhaseEnd + + rlPhaseStartTest + rlRun "annocheck $ANNOCHECK_SWITCHES main" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/main.fmf b/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/main.fmf new file mode 100644 index 0000000..3dca8b0 --- /dev/null +++ b/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/main.fmf @@ -0,0 +1,33 @@ +summary: Test for BZ#2009958 (annobin Plugin diagnostics for -D_FORTIFY_SOURCE) +description: | + Bug summary: annobin: Plugin diagnostics for -D_FORTIFY_SOURCE break autoconf tests + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2009958 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - gcc +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 30m +enabled: true +tag: + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2009958 +adjust: + - enabled: false + when: distro < rhel-9 + continue: false + - enabled: false + when: distro == rhel-9 and distro ~< rhel-9.1 + continue: false +extra-nitrate: TC#0613088 +extra-summary: /tools/annobin/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE +extra-task: /tools/annobin/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE +id: a98bcd3b-0aac-41ee-ac14-602c79e900d8 diff --git a/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/runtest.sh b/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/runtest.sh new file mode 100755 index 0000000..af5f401 --- /dev/null +++ b/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE/runtest.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2009958-annobin-Plugin-diagnostics-for-D-FORTIFY-SOURCE +# Description: Test for BZ#2009958 (annobin Plugin diagnostics for -D_FORTIFY_SOURCE) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + +# Relevancy: expected to fail with annobin<10.58. In practice, expected to fail +# with RHEL <9.1. + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlMountRedhat + + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + TESTED_FLAGS='-c -Werror -flto=auto -fplugin=annobin' + rlLogInfo "TESTED_FLAGS='$TESTED_FLAGS'" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlRun 'echo "int main(void) {return 0;}" >someprog.c' + rlRun 'cp someprog.c conftest.c' + rlPhaseEnd + + rlPhaseStartTest ORDINARY_FILES + # On files not starting with "conftest." failures are expected, unless + # "no-active-checks" drops the checks. + rlRun "gcc $TESTED_FLAGS someprog.c" 1 + rlRun "gcc $TESTED_FLAGS -fplugin-arg-annobin-active-checks someprog.c" 1 + rlRun "gcc $TESTED_FLAGS -fplugin-arg-annobin-no-active-checks someprog.c" 0 + rlPhaseEnd + + rlPhaseStartTest AUTOCONF_FILES + # On files starting with "conftest." passes are expected, unless + # "active-checks" enforces the checks. + rlRun "gcc $TESTED_FLAGS conftest.c" 0 + rlRun "gcc $TESTED_FLAGS -fplugin-arg-annobin-active-checks conftest.c" 1 + rlRun "gcc $TESTED_FLAGS -fplugin-arg-annobin-no-active-checks conftest.c" 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/main.fmf b/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/main.fmf new file mode 100644 index 0000000..08fd6f7 --- /dev/null +++ b/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/main.fmf @@ -0,0 +1,36 @@ +summary: Test for BZ#2011438 (gating run with rpminspect and annocheck pie test) +description: | + Bug summary: gating run with rpminspect and annocheck: pie test malloc says PASS but rpminspect says VERIFY + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2011438 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 60m +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011438 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<10.13, known to fail + - enabled: false + when: collection == gcc-toolset-10, devtoolset-10 + continue: false + because: annobin<10.13, known to fail +extra-nitrate: TC#0611935 +extra-summary: /tools/annobin/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test +extra-task: /tools/annobin/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test +id: 492c0d84-e165-4b55-ac4a-dbe2da78f2b2 diff --git a/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/runtest.sh b/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/runtest.sh new file mode 100755 index 0000000..ba2284d --- /dev/null +++ b/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test/runtest.sh @@ -0,0 +1,125 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2011438-gating-run-with-rpminspect-and-annocheck-pie-test +# Description: Test for BZ#2011438 (gating run with rpminspect and annocheck pie test) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<10.13 +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +ARCH=$(arch) + +ANNOCHECK_SWITCHES='--ignore-unknown --verbose' + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + # In general, we need to pass switches suitable for the respective OS. In the future + # an option like --profile=el should be available so let's leave + # a TODO here to use it. Until then we have to resort to maintaining a mess of ifs. + if rlIsRHEL '<9'; then + if annocheck --skip-lto $ANNOCHECK |& grep -q -i 'Unrecognised command line option'; then + : # --skip-lto is unknow, no need to use it + else + ANNOCHECK_SWITCHES+=' --skip-lto' # LTO si enabled on RHEL9+ only + fi + fi + rlLogInfo "ANNOCHECK_SWITCHES=$ANNOCHECK_SWITCHES" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + # As a test, submit ever growing bogus paths as --debug-dir + rlPhaseStartTest + + BOGUS_DIR=/abcd + i=0; while [[ $i -lt 5000 ]]; do + + (( i++ )) + BOGUS_DIR+=/abcd + annocheck $ANNOCHECK_SWITCHES --debug-dir=$BOGUS_DIR /usr/bin/ls &>annocheck.out + retval=$? + + case $retval in + 0|1) + : # OK + ;; + *) + rlFileSubmit annocheck.out annocheck.out + rlFail "'annocheck $ANNOCHECK_SWITCHES --debug-dir=$BOGUS_DIR /usr/bin/ls' exited with $retval" + rlLogInfo 'annocheck output:' + while read line; do + rlLogInfo "$line" + done +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - dnf-utils + - yum-utils + - annobin-plugin-gcc + - annobin + - annobin-annocheck + - devtoolset-10-annobin-annocheck + - devtoolset-11-annobin-annocheck + - devtoolset-12-annobin-annocheck + - gcc-toolset-10-annobin-annocheck + - gcc-toolset-11-annobin-annocheck + - gcc-toolset-12-annobin-annocheck +duration: 15m +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2012797 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2072082 +adjust: + - enabled: false + when: distro < rhel-7 + continue: false +extra-nitrate: TC#0612587 +extra-summary: /tools/annobin/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built +extra-task: /tools/annobin/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built +id: dd72a644-b723-48c2-8d32-7001a98bb0fa diff --git a/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built/runtest.sh b/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built/runtest.sh new file mode 100755 index 0000000..fe7c620 --- /dev/null +++ b/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built/runtest.sh @@ -0,0 +1,130 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2012797-annocheck-reports-that-ld64-so-2-was-not-built +# Description: Test for BZ#2012797 (annocheck reports that ld64.so.2 was not built) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +ANNOCHECK_RPM_VERSION=$(rpm --qf '%{version}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +ARCH=$(arch) + +ANNOCHECK_SWITCHES='--ignore-unknown --verbose' + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + # In general, we need to pass switches suitable for the respective OS. In the future + # an option like --profile=el should be available so let's leave + # a TODO here to use it. Until then we have to resort to maintaining a mess of ifs. + if rlIsRHEL '<9'; then + if annocheck --skip-lto $ANNOCHECK |& grep -q -i 'Unrecognised command line option'; then + : # --skip-lto is unknow, no need to use it + else + ANNOCHECK_SWITCHES+=' --skip-lto' # LTO si enabled on RHEL9+ only + fi + fi + if rlTestVersion $ANNOCHECK_RPM_VERSION '>=' 10.56; then + ANNOCHECK_SWITCHES+=' --follow-links' + fi + rlLogInfo "ANNOCHECK_SWITCHES=$ANNOCHECK_SWITCHES" + + DYNLOADERS=$(rpm -ql glibc.$ARCH | grep '/lib.*/ld.*\.so\.[0-9]\+$') + if [[ -z "$DYNLOADERS" ]]; then + rlDie 'No dynamic loader found' + fi + + # Extend for RHBZ#2033255: not only /lib/... but /usr/lib/... as well + DYNLOADERS_THROUGH_SYMLINK='' + for i in $DYNLOADERS; do + if cmp -s "$i" "/usr$i"; then + DYNLOADERS_THROUGH_SYMLINK+=" /usr$i" + fi + done + DYNLOADERS+=" $DYNLOADERS_THROUGH_SYMLINK" + + rlLogInfo "DYNLOADERS=$DYNLOADERS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + for i in $DYNLOADERS; do + rlPhaseStartTest $i + rlAssertExists $i + out="annocheck${i//\//-}.out" + rlRun "annocheck $ANNOCHECK_SWITCHES $i &>$out" + if [[ $? -ne 0 ]]; then + rlLogInfo 'annocheck wrote:' + while read line; do + if echo "$line" |& grep -i fail; then + rlLogError "$line" + else + rlLogInfo "$line" + fi + done <$out + rlFileSubmit $out $out + fi + rlPhaseEnd + done + + rlPhaseStartCleanup + rlRun popd + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/main.fmf b/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/main.fmf new file mode 100644 index 0000000..bbd1963 --- /dev/null +++ b/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/main.fmf @@ -0,0 +1,32 @@ +summary: Test for BZ#2013562 (man pages for non-existing commands [RHEL-9.0.0]) +description: | + Bug summary: man pages for non-existing commands [RHEL-9.0.0] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2013562 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 15m +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2013562 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: no annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: system annobin fixed in rhel-8.6 +extra-nitrate: TC#0611971 +extra-summary: /tools/annobin/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0 +extra-task: /tools/annobin/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0 +id: 8f08fa61-44a3-41cb-bf40-d7f52687b01a diff --git a/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/runtest.sh b/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/runtest.sh new file mode 100755 index 0000000..f400482 --- /dev/null +++ b/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0/runtest.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2013562-man-pages-for-non-existing-commands-RHEL-9-0-0 +# Description: Test for BZ#2013562 (man pages for non-existing commands [RHEL-9.0.0]) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<10.73 +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "rpm -ql $PACKAGES >files" + while read i; do + [[ "$i" == */bin/* ]] && echo "${i##*/bin/}" >>commands.txt + [[ "$i" == */man1/* ]] && echo "${i##*/man1/}" >>manpages.txt + done +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck + - dnf-utils + - yum-utils + - devtoolset-10-annobin-annocheck + - devtoolset-11-annobin-annocheck + - devtoolset-12-annobin-annocheck + - gcc-toolset-10-annobin-annocheck + - gcc-toolset-11-annobin-annocheck + - gcc-toolset-12-annobin-annocheck +duration: 30m +enabled: true +tag: + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2022973 +adjust: + - enabled: false + when: distro < rhel-7 + continue: false + because: No /usr/sbin/ldconfig there + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<10.25, known to fail + - enabled: false + when: collection == gcc-toolset-11 and distro == rhel-8 + continue: false + because: annobin<10.25, known to fail +extra-nitrate: TC#0612586 +extra-summary: /tools/annobin/Regression/bz2022973-annobin-needs-to-be-taught-about +extra-task: /tools/annobin/Regression/bz2022973-annobin-needs-to-be-taught-about +id: b34f9a47-f243-4b6e-ba27-d87792783111 diff --git a/Regression/bz2022973-annobin-needs-to-be-taught-about/runtest.sh b/Regression/bz2022973-annobin-needs-to-be-taught-about/runtest.sh new file mode 100755 index 0000000..8d163fc --- /dev/null +++ b/Regression/bz2022973-annobin-needs-to-be-taught-about/runtest.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2022973-annobin-needs-to-be-taught-about +# Description: Test for BZ#2022973 (annobin needs to be taught about) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<10.25 +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 +# - GTS=11 on RHEL-8 +# - RHEL <7 (no /usr/sbin/ldconfig) + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +ARCH=$(arch) + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "debuginfo-install -y glibc.$ARCH glibc-gconv-extra.$ARCH" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + for i in /sbin/ldconfig /usr/sbin/ldconfig; do + rlPhaseStartTest $i + out="annocheck${i//\//-}.out" + rlRun "annocheck --verbose --ignore-gaps --skip-all --test-stack-prot $i &>$out" + if [[ $? -ne 0 ]]; then + rlLogInfo 'annocheck wrote:' + while read line; do + if echo "$line" |& grep -i fail; then + rlLogError "$line" + else + rlLogInfo "$line" + fi + done <$out + rlFileSubmit $out $out + fi + rlPhaseEnd + done + + rlPhaseStartCleanup + rlRun popd + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2039747-Missing-cpio-dependency/main.fmf b/Regression/bz2039747-Missing-cpio-dependency/main.fmf new file mode 100644 index 0000000..5419aeb --- /dev/null +++ b/Regression/bz2039747-Missing-cpio-dependency/main.fmf @@ -0,0 +1,33 @@ +summary: Test for BZ#2039747 (Missing cpio dependency) +description: | + Bug summary: Missing cpio dependency + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2039747 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-annocheck +duration: 10m +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2039747 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2043474 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: no annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: system annobin fixed in rhel-8.6 + - enabled: false + when: collection == gcc-toolset-11, devtoolset-11, devtoolset-12 + continue: false + because: not fixed in GTS <12, DTS<13 +extra-nitrate: TC#0612788 +extra-summary: /tools/annobin/Regression/bz2039747-Missing-cpio-dependency +extra-task: /tools/annobin/Regression/bz2039747-Missing-cpio-dependency +id: e61c7418-2d31-46ee-95f3-49f267ab59be diff --git a/Regression/bz2039747-Missing-cpio-dependency/runtest.sh b/Regression/bz2039747-Missing-cpio-dependency/runtest.sh new file mode 100755 index 0000000..4fd2497 --- /dev/null +++ b/Regression/bz2039747-Missing-cpio-dependency/runtest.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2039747-Missing-cpio-dependency +# Description: Test for BZ#2039747 (Missing cpio dependency) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Relevancy: Should pass for +# - system annobin of RHEL >8.5 +# - GTS >11 +# - DTS >12 + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) + +PACKAGES="$ANNOCHECK_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "rpm -q --requires $ANNOCHECK_RPM_NAME >requires.txt" + rlAssertGrep '^cpio$' requires.txt + rlAssertGrep '^rpm$' requires.txt + if ! rlGetPhaseState; then + rlFileSubmit requires.txt requires.txt + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun popd + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/main.fmf b/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/main.fmf new file mode 100644 index 0000000..a847047 --- /dev/null +++ b/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/main.fmf @@ -0,0 +1,38 @@ +summary: Test for BZ#2086850 (annocheck Warning Unrecognised command line option) +description: | + Bug summary: annocheck: Warning: Unrecognised command line option: --tmpdir= + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2086850 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-annocheck + - dnf-utils + - yum-utils +duration: 15m +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2086850 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: no annobin + - enabled: false + when: distro == rhel-8.7 and collection is not defined + continue: false + because: RHBZ#2086850 itself + - enabled: false + when: distro == rhel-8.6 and collection is not defined + continue: false + because: annocheck on /bin/bash fails for reasons other than RHBZ#2086850 + - enabled: false + when: collection == gcc-toolset-11, devtoolset-11 + continue: false + because: annocheck on /bin/bash fails for reasons other than RHBZ#2086850 +extra-nitrate: TC#0613629 +extra-summary: /tools/annobin/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line +extra-task: /tools/annobin/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line +id: 8ccc286c-37c1-4d30-a22b-7ee3740737b8 diff --git a/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/runtest.sh b/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/runtest.sh new file mode 100755 index 0000000..eb3648a --- /dev/null +++ b/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line/runtest.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2086850-annocheck-Warning-Unrecognised-command-line +# Description: Test for BZ#2086850 (annocheck Warning Unrecognised command line option) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + +# Relevancy: expected to fail with annobin=10.72 (and a few minor versions before) +# In practice, expected to fail with +# - system annobin of RHEL 8.7 - bz2086850 itself +# - system annobin of RHEL 8.6 - annocheck on /bin/bash fails for reasons other than bz2086850 +# - GTS =12 - annocheck on /bin/bash fails for reasons other than bz2086850 +# - GTS <11 - no annocheck + +rlJournalStart + rlPhaseStartSetup + BASH_ANNOCHECK_RESULT=0 + if rlIsRHEL '<=7'; then + # Older bash builds aren't annocheck-clean + BASH_ANNOCHECK_RESULT='0,1' + fi + ANNOCHECK_SWITCHES='' + if rlIsRHEL '<9'; then + if annocheck --skip-lto $ANNOCHECK |& grep -q -i 'Unrecognised command line option'; then + : # --skip-lto is unknown, no need to use it + else + ANNOCHECK_SWITCHES+=' --skip-lto' # LTO si enabled on RHEL9+ only + fi + fi + rlRun 'debuginfo-install -y bash' + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + # Check if --tmpdir= is still expected to work + rlRun 'annocheck --help &>help.out' + rlAssertGrep ' --tmpdir=' help.out + + # There should be no complains + rlRun "annocheck $ANNOCHECK_SWITCHES --tmpdir=/root/foobar /bin/bash &>simple.out" "$BASH_ANNOCHECK_RESULT" + rlAssertNotGrep 'command line option' simple.out -i + + # With some luck we may find the tmpdir in action. However the + # following implementation is quite shaky and maybe not worth + # maintaining... + rlRun "annocheck $ANNOCHECK_SWITCHES -v -v --enable-timing --enable-notes --enable-hardened --enable-builtby --tmpdir=/root/foobar /bin/bash &>beefy.out" "$BASH_ANNOCHECK_RESULT" + rlAssertGrep 'data file /root/foobar/' beefy.out + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/main.fmf b/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/main.fmf new file mode 100644 index 0000000..1c2ef22 --- /dev/null +++ b/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/main.fmf @@ -0,0 +1,36 @@ +summary: Test for BZ#2097065 (annobin annobin-docs subpackage incorrectly) +description: | + Bug summary: annobin: annobin-docs subpackage incorrectly provides annobin, breaking buildroot + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2097065 +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - cpio +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck + - annobin-docs +duration: 60m +enabled: true +tag: + - CI-Tier-1 + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2097065 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2097617 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + - enabled: false + when: distro < fedora-37 + continue: false +extra-nitrate: TC#0613923 +extra-summary: /tools/annobin/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly +extra-task: /tools/annobin/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly +id: 187dfc4e-d186-4340-9b6e-0c0782b9c771 diff --git a/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/runtest.sh b/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/runtest.sh new file mode 100755 index 0000000..28c32e4 --- /dev/null +++ b/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly/runtest.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/bz2097065-annobin-annobin-docs-subpackage-incorrectly +# Description: Test for BZ#2097065 (annobin annobin-docs subpackage incorrectly) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +ANNOBIN_DOCS_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-docs +PACKAGES="$ANNOCHECK_RPM_NAME cpio" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlPhaseEnd + + # The -docs RPM may not exist at all. We should first know, if missing + # -docs is OK - then there is nothing to test. If the RPM should exists + # (let's check it by inspecting the spec file) then it should be present + # and should not provide anything strange (actually, just annobin-docs + # makes sense and possibly scl-package(...) for a GTS/DTS build). + rlPhaseStartTest DOCS_IS_MODEST_IF_AT_ALL + + DOCS_RPM_EXPECTED=false + rlFetchSrcForInstalled $ANNOCHECK_RPM_NAME + rlRun "ANNOBIN_SRPM=$(echo *.src.rpm)" + rlRun 'rpm2cpio <$ANNOBIN_SRPM >annobin.cpio' + rlRun 'cpio -id provides.out" + + # We expect just one or two Provides items + rlRun 'ITEMS_COUNT=$(wc -l +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 10m +enabled: true +tag: + - CI-Tier-1 +extra-nitrate: TC#0604430 +extra-summary: /tools/annobin/Regression/identify +extra-task: /tools/annobin/Regression/identify +id: 594f9117-8d59-4846-8a55-9c82b486d36d diff --git a/Regression/identify/runtest.sh b/Regression/identify/runtest.sh new file mode 100755 index 0000000..bb4dd23 --- /dev/null +++ b/Regression/identify/runtest.sh @@ -0,0 +1,39 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +rlJournalStart + rlPhaseStartTest + 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)" + rlRun "[[ "x${tool_v}" == "x${rpm_v}." ]]" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/lto-preprocessor-options/main.fmf b/Regression/lto-preprocessor-options/main.fmf new file mode 100644 index 0000000..f343914 --- /dev/null +++ b/Regression/lto-preprocessor-options/main.fmf @@ -0,0 +1,35 @@ +summary: lto-preprocessor-options +description: '' +contact: Martin Cermak +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - redhat-rpm-config +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1743635 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1998472 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + because: No annobin there, older redhat-rpm-config + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.4 and collection is not defined + continue: false + because: annobin<9.23, known to fail +extra-nitrate: TC#0607751 +extra-summary: /tools/annobin/Regression/lto-preprocessor-options +extra-task: /tools/annobin/Regression/lto-preprocessor-options +id: 878eadae-6f02-4d8b-b7e0-22b8d4280f32 diff --git a/Regression/lto-preprocessor-options/runtest.sh b/Regression/lto-preprocessor-options/runtest.sh new file mode 100755 index 0000000..615d5ef --- /dev/null +++ b/Regression/lto-preprocessor-options/runtest.sh @@ -0,0 +1,39 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +rlJournalStart + rlPhaseStartTest + b=`mktemp` + rlRun "echo 'int main (void) { return 0; }' | gcc -xc -o $b `rpm --eval "%build_cflags %build_ldflags"` -flto - " + rlRun "annocheck -v $b" + rm $b + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/missing-check-for-x86-property-note-content/main b/Regression/missing-check-for-x86-property-note-content/main new file mode 100644 index 0000000000000000000000000000000000000000..b7f4983a4a9958c8cf33bb1a902848845794ec82 GIT binary patch literal 27456 zcmeHQeQXrR6@PonVH1PRXZQ;7rG+bCl zo1&JAv?@YKX;r0Pk@}%Z=^tqnsr>^r|2U$Gl1h=1_8+QBEvX*x%+Act&dz%?`-Op#!Gt6MLxy_+L;DwcoShUgqp<|QPUwLJ zuoG^FbubqI<_KP`JnNlLczmYKBqx*J3j6_3M{glHrd&d#m|r8zCcPM@K-YnKB8tLc zI!qZb<#<286y+GA-y}BEpdQxEvuRJ@+1^@unCj&rqO6BO)O(TiUL-xHvs6x|T%TAc z_}4@A8K$9P*XbQ5y)f;k>to7wfAFG{`!M8YOXboUmeY$;u$2v{!61N+p_-b0W$0W-*B zef+%?K=gBrzx?tamn;~$>$fw>b9NgkEPL)PP6KsN27%4MT>^n|{C6$DvMr8K z=mYTkLJ(>LzS)3}W%@)g0fwq(r!+Nhm|D>|rh}>$jq$8nb~M{jOPXNmPs~M~9=Z;`U-|ypw8)D%OZOx5XDPv%5TC>6cX)c(cd^bG z7XtiXdtVCh>6R3j4e+twFs=mnH1r9)Li{Ek_hQ6|5hF&77%^hR0D!mKZvAKG2{bK{2Go3GG&h)=0 zt5=<+nbXN-lt8n4Aur0s`dHo*y$d=3ptA8$=49_%3IJqIU3BJW&h$QW7r>>JuIpaP zxvu*{@}dGDJ$SCIy+;4_M_tzq)}3ElF=E7s5hF&77%^hRh!G>kjR~}iNvq|1&>V~Q zrdwuRcMJfw&${k$02rBd-R)${L`cUDfHbvGT0Ot1`Ekj!aiWdBdDeArM}ht(VG%?7 z?G^x-dDC@;ske3EVC#xKZ7q*BpMV{!?%A+;tuP;=@TURb?3=FJa${Cej2JOu#E20i zMvNFSVtg!MKg6)#A^R4xPv(3s9r-6NpzwC`V_ZpL_H$fKVfJfWMPc@LWIt?<|NB+f zLXq#0lOp>b?kDF&_SK!C_?sxbuMp*Ty%iK*MwG$6k7vn`k$ogt9(`*O=--G~PV_t# zg!wBd%;laTxp_o6J*JFzUGMrNa+SVH;Y)OVZZ%$Dmcr*L{v8VQb$rxdfABE6slBfi zLw$XpO06H-d+5$oXQ$Gobf&sCb#-pKyQ?R){(zoKWi*E((p`4~i1rj&NdQB;)=HZT z+j=$wz){MdDf^w1T+*(XrePLRg={vQQJt)2n%1~sM#^&k@zUKewC@3UctG-e=LJN$ zHYBkA+qg0WZ)4ffvX7|QqE?;&SW*+WA)8kxZOhTKj$xVDY52aO^al4G7#kiu0#{M( z<{I6N!kzi>VRhHRg98V~hWG6~NWT06UU{0ZJbbTsyxT~I}vWMcG^kp#58WFxSa&Nej1N^q8>i@ zxX1Sq)A)Y6G4CgyKQN8k>Bej)o=OcRcoDh}MX>u9@&kY41PP@{I| zITX{l-LZZCqibQ}e&ab2)41NRZ@tI;Jvax6`#X=XAJtssdOu&Hp8fn>VftZZcn-4q zJ?0`j2N|Y$2A*-^+0QUn@W(mdh7!WP;(06yVPRKX!`3$6sz^wDHX=FcNpXrw5~Su& z;#2lV0I=pZ(%6q>nF2|gzaBkK=Ohi&fjQrm@M*jRSs*Qv*0nBak=s|dA6mXhTDTk_ zp+M)tMbhG?ohy!^;W8j1qPKwD{Hd0ETDG+eFWIqj`$_ZCa;D>~iOzlZ- zm@6fkK$7rGpky_@%WpMIuO%Up68{bDJ(L<69^F4O5H^KH*xXX-Qumfry5v+$y|5^t=CwjfZiPA^AQt3h}y{{{k&YM=+n$*qGWc9a}&8E`%Y(8DJaP{UZ#bPR* z-#~Er+eVun-Lm|VZ3YD4*S#+#aI-l2^bkVWW*7(DE z*1`PssjNPU7B~zDlNOiRveRY9w#-5*o!83KW_H51Osi5(SIkEZGnaPol%T4XF!Hgk zVVUoJ{h`YirxkTLrAho#4j(hN^^clc58n^lHQO=rM%K`Z_X;T`E9{8a0}xHzM;hH= z1Q{g%+_NBLJclU4a4duDpU)M940GUkq0(-##CNjN=N8XF>c77;aD6 zckZVDZ}ot9ul~UEEC%<7F#qH358-}zt^HvM-WZA2y6d{50e_nmU2pvo&JkPvH7dp+ z@t+Ni!$*kEerOC!^v~+JBqmY-@HxS+A18l6>9AiL;~61eKi)Pf|I0#tF?^kGhybGc ziH9|?J0Mp@%=Zx2LtGC*#Qh=e4?+BI_J^qF#c#y(rGDQ2ns~s~zeoH-$k)&37bK$3 z<=v2od_{pnf?q%XA57pY(~7$Je@XKAb3*S0qnK}^{{846r4xR?z;mf19;IL<02U?c z-)oK|Kk%MKZqRTV(@E6#lf%LWvl14D%6UZ8Ppfac6MKpQ;5(w6)p-TuDU#>;Ilpp0 zEy`J6KW7_U*Dn*%=NZ2t>Mi2^w4+kC@sQ|_LN?nm)zhtZZ%NyFZUPrG@Wkkj&dv@+ zss8iMlRlWWoleC9h1OQoqEj1Cbu(8Jt4vr<4Fe_Wm`cSg8jtA3>3Y$~7)2b&T$!vF zkBU(ADI=l~f~%_9xS={)p_&vfoOtPkczA7D+bKJhd|t^y^^9lLDXCdJ<+%*1nzPhG z(Hhr^YR<9jvZ__4AZwK-i@KxdlugkRc;d97YPPLStGemf)8Khe=PISrG^pfDEkdec z8cvO_mDb}q1a6S0Z@lV_U+y^qV5|UJUB3> zj_uk#GN9HUa=nv}wtm0kto5AcXdnuY*QGg{ceZuiLDy=oY^f8PnZrY{hxe&vCuf*y zrL5;@1xm?jTY9p0>se6M@p74x5o=hgIyTzJ7l(&yN1m8ndvLdZ1$a2Os4)PgJY90M zaZt*R?a>MTC0x`eK`|{yR|;lDnY67*-FBt}tnrFb%%zPSv3BhqPK$1X;uGkMujHo9 z@^s0gjtwH_sBV|h7e5$KZBT5zsG$P=nk+h?V8epq=u-|T*dIW#Em6UWK0!TTB4<}a zo`%;IJPrPhT9}1mTcS8x$;g6Iz+2HvaJ*awC2N&Ry6Jdj6PKrGj$<3+6-O_FlGDd4 z1y!>(vrr8hW*(FDqQ=K<{V0cuhN<&!arvGQvV&pUEEJ8hQ|1xy-vjRZ5wD7rO!#{Y zyzhs>?{f@X;m5r;tk3I~OvBF*Z-umq?vQ@?`vd$P00uu-7{eibUI%3w&OfaG003Ne zU3{zw@O~zyeEqziDO`U1ECxPvSfBShF@2oU#X7>eV}0IlWYD=Atk3(WnDTxpM!5db z0E2sxSfBSFF=dMlm!IXBejY&VZQ?NRZ(@r6D2Q&UcT!TZ`6;r4$rq|fWkK4nD$FM}|BDx}Zz5T@_2 zVo0Cyur`p9?BeUkd`)QNw8>E|dP3gTfK|I_Zb&|M-2L z;txZKbCBs|1O3#fr!P$M0k9s^6Aj9rA${JL%V0eQhI#A>;vv#MPmXvv4|pPC{KtK~ h+;@ZM5exeOZ-){O=Z`KDQTiLnPKIY(1rZ9uzX0sx#l`>t literal 0 HcmV?d00001 diff --git a/Regression/missing-check-for-x86-property-note-content/main.fmf b/Regression/missing-check-for-x86-property-note-content/main.fmf new file mode 100644 index 0000000..1e0d455 --- /dev/null +++ b/Regression/missing-check-for-x86-property-note-content/main.fmf @@ -0,0 +1,31 @@ +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 +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1991931 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<9.85, known to fail +extra-nitrate: TC#0611377 +extra-summary: /tools/annobin/Regression/missing-check-for-x86-property-note-content +extra-task: /tools/annobin/Regression/missing-check-for-x86-property-note-content +id: 1d637272-8d85-442a-acd6-47680ccf4d00 diff --git a/Regression/missing-check-for-x86-property-note-content/runtest.sh b/Regression/missing-check-for-x86-property-note-content/runtest.sh new file mode 100755 index 0000000..1c0efec --- /dev/null +++ b/Regression/missing-check-for-x86-property-note-content/runtest.sh @@ -0,0 +1,38 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +rlJournalStart + rlPhaseStartTest + rlRun "annocheck main" 1 + rlRun "annocheck --fixed-format-messages main | \ + grep '^Hardened: FAIL: test: cf-protection file: main.$'" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/processing-params-in-reverse-order/main.fmf b/Regression/processing-params-in-reverse-order/main.fmf new file mode 100644 index 0000000..f5c2d33 --- /dev/null +++ b/Regression/processing-params-in-reverse-order/main.fmf @@ -0,0 +1,31 @@ +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 +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988714 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<9.84, known to fail +extra-nitrate: TC#0611374 +extra-summary: /tools/annobin/Regression/processing-params-in-reverse-order +extra-task: /tools/annobin/Regression/processing-params-in-reverse-order +id: 3c1562a5-f3af-4ae9-9996-9137798a33a1 diff --git a/Regression/processing-params-in-reverse-order/runtest.sh b/Regression/processing-params-in-reverse-order/runtest.sh new file mode 100755 index 0000000..f96ee7a --- /dev/null +++ b/Regression/processing-params-in-reverse-order/runtest.sh @@ -0,0 +1,40 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +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 diff --git a/Regression/report-missing-FORTIFY-SOURCE-as-error/main.fmf b/Regression/report-missing-FORTIFY-SOURCE-as-error/main.fmf new file mode 100644 index 0000000..61e5383 --- /dev/null +++ b/Regression/report-missing-FORTIFY-SOURCE-as-error/main.fmf @@ -0,0 +1,40 @@ +summary: Test for BZ#1703500 +description: | + Bug summary: annobin: Missing _FORTIFY_SOURCE macro results in MAYBE + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1703500 +contact: Martin Cermak +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - redhat-rpm-config +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1703500 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1904479 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1908699 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<10.12, known to fail + - enabled: false + when: collection is defined + continue: false + because: written for system annobin only +extra-nitrate: TC#0602252 +extra-summary: /tools/annobin/Regression/report-missing-FORTIFY-SOURCE-as-error +extra-task: /tools/annobin/Regression/report-missing-FORTIFY-SOURCE-as-error +id: ff18936f-b5e1-4072-85aa-f22852356407 diff --git a/Regression/report-missing-FORTIFY-SOURCE-as-error/runtest.sh b/Regression/report-missing-FORTIFY-SOURCE-as-error/runtest.sh new file mode 100755 index 0000000..abc9cd8 --- /dev/null +++ b/Regression/report-missing-FORTIFY-SOURCE-as-error/runtest.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/report-missing-FORTIFY-SOURCE-as-error +# Description: Test for BZ#1703500 +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + + rlRun "echo 'int main(void) {}' > u.c" + rlRun "rpm --eval '%build_cflags' | grep -o -- '-D_FORTIFY_SOURCE=[2|3]'" + rlPhaseEnd + + rlPhaseStartTest + # Notes on LTO: RHBZ#1703500 was a RHEL8 bug. On RHEL9, LTO is used + # by default. LTO discards preprocessor options: + # https://sourceware.org/git/?p=annobin.git;a=commit;h=153a180de5421cc27c2de90c003366592fc4eb8c + # On top of the original reproducer, we need to disable LTO (at least since RHEL9). + + rlRun "gcc `rpm --eval "%build_cflags %build_ldflags" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3//' -e 's/-flto=auto -ffat-lto-objects//'` u.c" + rlRun "annocheck -v a.out |& tee annocheck.log" + + rlRun "grep -F 'MAYB: Some parts of the binary do not record if -D_FORTIFY_SOURCE=' annocheck.log" 1 + rlRun "grep -F \ + \ + -e 'FAIL: Some parts of the binary were not compiled with -D_FORTIFY_SOURCE=2' \ + -e 'FAIL: Parts of the binary were compiled without -D_FORTIFY_SOURCE=2' \ + -e 'FAIL: The binary was compiled without -DFORTIFY_SOURCE=2' \ + -e 'FAIL: fortify test because -D_FORTIFY_SOURCE=2 was not present on command line' \ + -e 'FAIL: fortify test because -D_FORTIFY_SOURCE=2 was not present on the command line' \ + \ + -e 'FAIL: Some parts of the binary were not compiled with -D_FORTIFY_SOURCE=[2|3]' \ + -e 'FAIL: Parts of the binary were compiled without -D_FORTIFY_SOURCE=[2|3]' \ + -e 'FAIL: The binary was compiled without -DFORTIFY_SOURCE=[2|3]' \ + -e 'FAIL: fortify test because -D_FORTIFY_SOURCE=[2|3] was not present on command line' \ + -e 'FAIL: fortify test because -D_FORTIFY_SOURCE=[2|3] was not present on the command line' \ + \ + annocheck.log" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun popd + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/segv-when-processing-multiple-params-incl-symlink/main.fmf b/Regression/segv-when-processing-multiple-params-incl-symlink/main.fmf new file mode 100644 index 0000000..afc5a86 --- /dev/null +++ b/Regression/segv-when-processing-multiple-params-incl-symlink/main.fmf @@ -0,0 +1,34 @@ +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 +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - libstdc++ +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988715 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<9.87, known to fail +extra-nitrate: TC#0611375 +extra-summary: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink +extra-task: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink +id: f75cab47-3558-41b8-b37f-982bb25872a2 diff --git a/Regression/segv-when-processing-multiple-params-incl-symlink/runtest.sh b/Regression/segv-when-processing-multiple-params-incl-symlink/runtest.sh new file mode 100755 index 0000000..cb7a69c --- /dev/null +++ b/Regression/segv-when-processing-multiple-params-incl-symlink/runtest.sh @@ -0,0 +1,63 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +ANNOCHECK_RPM_VERSION=$(rpm --qf '%{version}' -qf $ANNOCHECK) + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ANNOCHECK_RPM_NAME=$ANNOCHECK_RPM_NAME" + rlLogInfo "ANNOCHECK_RPM_VERSION=$ANNOCHECK_RPM_VERSION" + if rlTestVersion $ANNOCHECK_RPM_VERSION '>=' 10.56; then + IS_NEW=true + rlLogInfo 'annocheck knows --follow-links/--ignore-links' + else + IS_NEW=false + rlLogInfo 'annocheck does not know --follow-links/--ignore-links' + fi + rlPhaseEnd + + 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*" + if $IS_NEW; then + rlRun "annocheck --follow-links --skip-all /usr/lib64/libstdc++.so*" + rlRun "annocheck --ignore-links --skip-all /usr/lib64/libstdc++.so*" + else + rlRun "annocheck --skip-all /usr/lib64/libstdc++.so*" + fi + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/testsuite/main.fmf b/Regression/testsuite/main.fmf new file mode 100644 index 0000000..80227f2 --- /dev/null +++ b/Regression/testsuite/main.fmf @@ -0,0 +1,43 @@ +summary: testsuite +description: '' +contact: Martin Cermak +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - binutils-devel + - bzip2-devel + - make + - rpm-build + - rpm-devel +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck + - dnf-utils + - yum-utils + - elfutils + - elfutils-devel + - gcc-c++ + - gcc-plugin-devel +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2101443 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2054571 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2017039 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2040688 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2031133 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1986846 +adjust: + - enabled: false + when: distro < rhel-7 + continue: false + because: known to fail, won't be fixed (RHBZ#2040688 and others) +extra-nitrate: TC#0590691 +extra-summary: /tools/annobin/Regression/testsuite +extra-task: /tools/annobin/Regression/testsuite +id: 39498e38-82ff-47b7-884e-dfdecd2f0a9f diff --git a/Regression/testsuite/runtest.sh b/Regression/testsuite/runtest.sh new file mode 100755 index 0000000..3162c2a --- /dev/null +++ b/Regression/testsuite/runtest.sh @@ -0,0 +1,83 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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" + + # 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' --with tests -bc SPECS/annobin.spec" + rlPhaseEnd + + rlPhaseStartTest + rlRun "pushd BUILD/annobin-*" + set -o pipefail + rlRun "make check CLANG_TESTS=\"check-pre-clang-13\" |& 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 diff --git a/Regression/wrong-compiler-flags-but-no-failure/files/main_with_gaps_in_notes b/Regression/wrong-compiler-flags-but-no-failure/files/main_with_gaps_in_notes new file mode 100755 index 0000000000000000000000000000000000000000..4b2431b6a99f2ce78ae1f1bdacc029bfb9ab9876 GIT binary patch literal 33104 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 literal 0 HcmV?d00001 diff --git a/Regression/wrong-compiler-flags-but-no-failure/files/main_with_no_notes b/Regression/wrong-compiler-flags-but-no-failure/files/main_with_no_notes new file mode 100755 index 0000000000000000000000000000000000000000..cb3b80a736e85bff1c2dc52da708cb224707b3ea GIT binary patch literal 14400 zcmeHOU2GiH6+Y|4#DTEumIO?U@V3HL67V>?Nlf@Laeh64K$A3vAdybS*|j}ry=%>m z!3iKN3`8baBvOB#kSrlpk;(&AsT!oJ+B7I?9}q#}0mMs$uw+YtY*dN@MZW0FoNqnc zuqvr|;NgDK>YID-`R+aUcXoHqJiC3@j)p{nfJJm4acaCd%IT4Uo(wFAdT1kEPd#)C zwbC_2v^dPu>?Qp{Lv#UdlKe%YYvBu`EBF?%1H(gRZm%8=vO`2QCg}(38o5ByI=>?g zfKgs+FCEpZ^XHNcj_cT!>5j-?y8GLllW`dmhK`f0J0-ePq61gOPcX)l$Amu{WjuA( z-Pd*dMW^#N=^q$l|ErlG_y4rFTXf6CA)VJtdtkJ;XC}zW)P65un)gb3_2%KAj6Yb0 zmpThxf7klXLaw9W6-UQ9#x{0!bgj3_B`X`Y&wgZ68ns&F3ke7&3~T<2WA zV)o*fkNn|;^U~3KPyg~S?`Q9LAvlUUSi?39o(3!l2AAP;HDKR<`W=GZw6KKZSX0No zP{;n~b?l$2W6ynH%@uH*Lu0Np;1%71cO*}aQ}Fr^Ipx6h183Ovic}u)y<#vxBcnl? zxR58Ii+XqM+_KflT3KsD?RwpMa(3=}(8=Zf{GeA3^8UUDw-!pp{64q8z;zD}mx@xi z6PbReq09l#1wILCpw8IwF}l)Q%B6Qn-kT?WcMZ?ncIhDYJNDVZpF{;GWj`Z7E%|R~ z`AC1TDbn%U=P?A%$MWOrWj2=2>kFvH^5gsHax8xdjESfs`J5+5Lx_LI^275~a4wb~ zugAc^z`(%3z`)?gg@31R{mP!W&}1KL{IHYAexVXHsB`wj+f8ReN7aUxI*C;K%bi52 zwjNULoF3w`x${aX)&3l(`K#&NxiEc%)BKfmuA-FU`v1m>SoL10gH?_ocu8t-Si>vFKd zKGt}nxV}`KPqmG6&1Zz|sqUYJ_8V3*t)90htM=*7Hrb~yFR~M7?f2$`<@T}087u00 zlR7_;YTLG;XaB~#KeUKw^!7e`qWd3wX;01s%j~J{;vGb@OO;ZyIi=Lu#y?p^i34X+ zZMF7UKlh|kO8nt8kN51K=atG-!hv4s-N5lad-AKdqVd}Bc#?=sE~M?r8GG{L>?`w1 zG5=L5Wly}FK5(X1-@=R;7#J8B7#J8B7#J8B7+eW{uJwdl7|m0A`R;Ukjx7?ci|$z~ z&o-A;mEz1@Ri$1gqC!=vT}1TQC8ef`=;=#J{Y{>AhT0>0DKXZZXkE6X>3AY~2FlOy zTdGR^f(^DU2_MbgMif5doxZ447%Px$-jQs%KXu)cP2;p_D6}d9&CU7#J8B z7#J8B7#JA*7=gG!Jx&m@fZ=Z(B3cIL!(UfK*Gsx0@r5@_8gYrOl13cjN=YL=5pmZj z|IfTCvB|Uq10wcsT!IV{Q&^GmYo)&53STG8zug%4Ee9aR@T9~MBBs$6gYb7AQ7yLc zCdqG+h7ohPUmSzq6|q|idyRqrs;GYnilpFnBUX6>EXjpz|el0LFU< zfUfT)qA!#xp?#b$VDum7i|+p(qHqkM$N5uZX_$TFv4bAxz@u8sJvbPsq5U{#u8n^?uZbSxUt939@a6VfgRcLhrmy!t44~`Z()6~p3w|9!0p<_jD6eEJ#vk7g@V<<0 zk2LsQB1*;d`2KKG-d}0a;XNtdKMb^sb#O^* zAKyPt$``Bsq644@f1&AX3syF+K402$q_4#%_`g^d{NnGa=U4Z*PMi|}^c<}g2ilJ_ Q+KwYD6 +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1991943 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2097643 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<9.88, known to fail +extra-nitrate: TC#0611398 +extra-summary: /tools/annobin/Regression/wrong-compiler-flags-but-no-failure +extra-task: /tools/annobin/Regression/wrong-compiler-flags-but-no-failure +id: b0536591-5e26-4b9e-80e2-a3b78fba3089 diff --git a/Regression/wrong-compiler-flags-but-no-failure/runtest.sh b/Regression/wrong-compiler-flags-but-no-failure/runtest.sh new file mode 100755 index 0000000..b482fee --- /dev/null +++ b/Regression/wrong-compiler-flags-but-no-failure/runtest.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Regression/wrong-compiler-flags-but-no-failure +# Description: wrong-compiler-flags-but-no-failure +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +ANNOCHECK_RPM_VERSION=$(rpm --qf '%{version}' -qf $ANNOCHECK) +PACKAGES="$ANNOCHECK_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "cp files/* $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + # Reproducer of https://bugzilla.redhat.com/show_bug.cgi?id=1991943#c0 + rlPhaseStartTest main_with_gaps_in_notes + rlRun "FILE=main_with_gaps_in_notes" + rlRun "OUTPUT=${FILE}.out" + rlRun "annocheck --fixed-format-messages $FILE &>$OUTPUT" 0-255 + rlRun "grep 'Hardened: PASS: test: .* file: $FILE.' $OUTPUT" + rlRun "grep -F 'Hardened: FAIL: test: cf-protection file: $FILE.' $OUTPUT" + # See https://bugzilla.redhat.com/show_bug.cgi?id=2097643#c6 for how + # the behaviour changed and why. + if rlTestVersion $ANNOCHECK_RPM_VERSION '>=' 10.75; then + rlRun "grep -F 'Hardened: FAIL: test: gaps file: $FILE.' $OUTPUT" + else + rlRun "grep -E 'Hardened: (MAYB|FAIL): test: notes file: $FILE.' $OUTPUT" + fi + rlGetPhaseState || rlFileSubmit $OUTPUT $OUTPUT + rlPhaseEnd + + # Binary with no notes. Created from the previous one by: + # strip --remove-section .gnu.build.attributes + # See https://bugzilla.redhat.com/show_bug.cgi?id=2097643#c6 for details. + rlPhaseStartTest main_with_no_notes + rlRun "FILE=main_with_no_notes" + rlRun "OUTPUT=${FILE}.out" + rlRun "annocheck --fixed-format-messages $FILE &>$OUTPUT" 0-255 + rlRun "grep 'Hardened: PASS: test: .* file: $FILE.' $OUTPUT" + rlRun "grep -F 'Hardened: FAIL: test: cf-protection file: $FILE.' $OUTPUT" + rlRun "grep -E 'Hardened: (MAYB|FAIL): test: notes file: $FILE' $OUTPUT" + rlGetPhaseState || rlFileSubmit $OUTPUT $OUTPUT + rlPhaseEnd + + rlPhaseStartCleanup + rlRun popd + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/allow_multiple_instances_of_fplugin/main.fmf b/Sanity/allow_multiple_instances_of_fplugin/main.fmf new file mode 100644 index 0000000..1212d29 --- /dev/null +++ b/Sanity/allow_multiple_instances_of_fplugin/main.fmf @@ -0,0 +1,39 @@ +summary: Allow multiple instances of -fplugin in CLI +description: | + Bug summary: Allow multiple instances of -fplugin in CLI + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2162746 +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2162746 +tag: [] +contact: Vaclav Kadlcik +component: + - annobin +adjust: + - enabled: false + when: collection is not defined and distro < rhel-8 + continue: false + because: no system annobin + - enabled: false + when: collection is not defined and distro == rhel-8 and distro ~< rhel-8.9 + continue: false + because: annobin < 11.11, known to fail + - enabled: false + when: collection is not defined and distro == rhel-9 and distro ~< rhel-9.3 + continue: false + because: annobin < 11.11, known to fail + - enabled: false + when: collection == gcc-toolset-11, devtoolset-11, gcc-toolset-12, devtoolset-12 + continue: false + because: annobin < 11.11, known to fail + - require+: + - annobin-annocheck + - annobin-plugin-gcc + when: distro == fedora +test: $WITH_SCL ./runtest.sh +framework: beakerlib +duration: 30m +extra-nitrate: TC#0614896 +extra-summary: /tools/annobin/Sanity/allow_multiple_instances_of_fplugin +extra-task: /tools/annobin/Sanity/allow_multiple_instances_of_fplugin +id: 3e6cf1e0-5b5a-4313-9050-f08b14c58be7 diff --git a/Sanity/allow_multiple_instances_of_fplugin/runtest.sh b/Sanity/allow_multiple_instances_of_fplugin/runtest.sh new file mode 100755 index 0000000..1a3e4f7 --- /dev/null +++ b/Sanity/allow_multiple_instances_of_fplugin/runtest.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Sanity/allow_multiple_instances_of_fplugin +# Description: Allow multiple instances of -fplugin in CLI +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 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 + +# Relevancy: expected to fail with annobin<11.11 +# In practice, expected to fail with +# - system annobin of RHEL <8.9 or <9.3 +# - GTS/DTS <13.0 + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlMountRedhat + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + PLUGIN_LINK=$(rpm -ql $ANNOBIN_RPM_NAME | grep -m 1 -e '/annobin\.so$' -e '/[gd]ts-annobin\.so$') + PLUGIN_FILE=$(readlink --canonicalize-existing "$PLUGIN_LINK") + PLUGIN_NAME=${PLUGIN_LINK##*/} + PLUGIN_NAME=${PLUGIN_NAME%.so} + rlLogInfo "PLUGIN_LINK=$PLUGIN_LINK" + rlLogInfo "PLUGIN_FILE=$PLUGIN_FILE" + rlLogInfo "PLUGIN_NAME=$PLUGIN_NAME" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlRun 'echo "int main(void) { return 0; }" >main.c' + rlPhaseEnd + + rlPhaseStartTest + rlAssertExists "$PLUGIN_FILE" + for i in 1 2 3; do + rlRun "cp '$PLUGIN_FILE' copy${i}.so" + done + rlRun "gcc -fplugin=$PLUGIN_NAME -fplugin=$PWD/copy1.so -fplugin=$PWD/copy2.so -fplugin=$PWD/copy3.so main.c &>compile.log" + while read line; do + rlLogError "$line" + done +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-plugin-gcc + - annobin + - annobin-annocheck +duration: 48h +enabled: true +tag: + - CI-Tier-1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1973981 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: No annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.6 and collection is not defined + continue: false + because: annobin<9.78, known to fail + - enabled: false + when: collection == gcc-toolset-10, devtoolset-10 + continue: false + because: annobin<9.78, known to fail +extra-nitrate: TC#0611175 +extra-summary: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter +extra-task: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter +id: c083513a-d534-4cf2-a56f-833f68e40db0 diff --git a/Sanity/annocheck-silently-ignores-any-file-parameter/runtest.sh b/Sanity/annocheck-silently-ignores-any-file-parameter/runtest.sh new file mode 100755 index 0000000..7ac6ccd --- /dev/null +++ b/Sanity/annocheck-silently-ignores-any-file-parameter/runtest.sh @@ -0,0 +1,60 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: expected to fail with annobin<9.78 +# In practice, expected to fail with +# - system annobin of RHEL <8.6 +# - GTS/DTS <11 + +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 |& \ + 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 $testcnt -eq 300" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TMP" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/bz2067148-support_syncing_with_gcc/main.fmf b/Sanity/bz2067148-support_syncing_with_gcc/main.fmf new file mode 100644 index 0000000..b4d5158 --- /dev/null +++ b/Sanity/bz2067148-support_syncing_with_gcc/main.fmf @@ -0,0 +1,42 @@ +summary: Update Annobin for automatic syncing with gcc +description: '' +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +require: + - annobin-annocheck + - binutils-devel + - gcc + - gcc-c++ + - gcc-plugin-devel + - perl + - redhat-rpm-config + - rpm-build + - rpm-devel +recommend: + - annobin-plugin-gcc + - annobin +duration: 30m +enabled: true +tag: + - CI-Tier-1 + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2067148 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + - enabled: false + when: distro == rhel-8 and distro < rhel-8.7 + continue: false + - enabled: false + when: collection is defined + continue: false +extra-nitrate: TC#0613129 +extra-summary: /tools/annobin/Sanity/bz2067148-support_syncing_with_gcc +extra-task: /tools/annobin/Sanity/bz2067148-support_syncing_with_gcc +id: b821b6f6-6911-4a40-a35c-7d022f0b1a72 diff --git a/Sanity/bz2067148-support_syncing_with_gcc/runtest.sh b/Sanity/bz2067148-support_syncing_with_gcc/runtest.sh new file mode 100755 index 0000000..9e92473 --- /dev/null +++ b/Sanity/bz2067148-support_syncing_with_gcc/runtest.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Sanity/bz2067148-support_syncing_with_gcc +# Description: Update Annobin for automatic syncing with gcc +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + +# Not implemented for devtoolset/gcc-toolset. Suggested TCMS relevancy: +# distro < rhel-8: False +# distro = rhel-8 && distro < rhel-8.7: False +# collection defined: False + + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +# We need to consider GCC of the same "set" annobin belongs to, e.g. system +# GCC if we are testing system annobin, GTS-11 GCC for GTS-11 annobin etc. +GCC_RPM_NAME=${ANNOCHECK_RPM_NAME%%annocheck} # remove trailing "annocheck" +GCC_RPM_NAME=${GCC_RPM_NAME%%annobin-} # remove trailing "annobin-" if present +GCC_RPM_NAME=${GCC_RPM_NAME}gcc + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME $GCC_RPM_NAME redhat-rpm-config rpm-build" + +rlJournalStart + rlPhaseStartSetup + rlMountRedhat + + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "ARCH=$ARCH" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "PLUGIN_DIR=$(gcc -print-file-name=plugin)" + rlRun "GCC_VERSION=$(rpm -q --qf='%{VERSION}' $GCC_RPM_NAME)" + rlRun "GCC_MAJOR_VERSION=${GCC_VERSION%%.*}" + rlRun "VERSION_INFO_FILE=$PLUGIN_DIR/annobin-plugin-version-info" + rlRun 'SRC_TARBALL=/usr/src/annobin/latest-annobin.tar.xz' + rlRun "ANNOBIN_SOURCE_RPM=$(rpm -q --qf='%{SOURCERPM}' $ANNOBIN_RPM_NAME)" + rlRun "ANNOBIN_VERSION=$(rpm -q --qf='%{VERSION}' $ANNOBIN_RPM_NAME)" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + + rlFetchSrcForInstalled "$ANNOBIN_RPM_NAME" + rlRun 'mkdir -p my_rpmbuild' + rlRun "yum -y builddep $ANNOBIN_SOURCE_RPM" + rlRun "rpm -ivh --define='_topdir $PWD/my_rpmbuild' $ANNOBIN_SOURCE_RPM" + rlRun "rpmbuild --define '_topdir ${PWD}/my_rpmbuild' -bp my_rpmbuild/SPECS/*.spec" + rlPhaseEnd + + rlPhaseStartTest RPM_IS_SANE + rlRun "rpm -ql $ANNOBIN_RPM_NAME >files.txt" + rlAssertGrep "^${VERSION_INFO_FILE}$" files.txt + rlAssertGrep "^${SRC_TARBALL}$" files.txt + rlPhaseEnd + + rlPhaseStartTest VERSION_RECORDED + # annobin-plugin-version-info should exist and look sane + rlAssertExists "$VERSION_INFO_FILE" + rlAssertEquals "$VERSION_INFO_FILE has 1 line" "$(wc -l <$VERSION_INFO_FILE)" 1 + rlAssertGrep "^${GCC_RPM_NAME}-${GCC_MAJOR_VERSION}\." "$VERSION_INFO_FILE" + rlPhaseEnd + + rlPhaseStartTest SOURCES_ATTACHED + # annobin sources tarball should exist and match the SRPM's sources + rlAssertExists "$SRC_TARBALL" + rlAssertNotDiffer "$SRC_TARBALL" "my_rpmbuild/SOURCES/annobin-${ANNOBIN_VERSION}.tar.xz" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/man_pages_present/main.fmf b/Sanity/man_pages_present/main.fmf new file mode 100644 index 0000000..af74d88 --- /dev/null +++ b/Sanity/man_pages_present/main.fmf @@ -0,0 +1,37 @@ +summary: Check if man pages are present +description: '' +contact: Vaclav Kadlcik +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + - annobin-annocheck + - annobin-plugin-gcc + - annobin + - util-linux-ng +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL6 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2018541 +adjust: + - enabled: false + when: distro < rhel-8 and collection is not defined + continue: false + because: no annobin there + - enabled: false + when: distro == rhel-8 and distro ~< rhel-8.4 and collection is not defined + continue: false + because: known to fail + - enabled: false + when: collection == gcc-toolset-10, devtoolset-10 + continue: false + because: known to fail +extra-nitrate: TC#0612012 +extra-summary: /tools/annobin/Sanity/man_pages_present +extra-task: /tools/annobin/Sanity/man_pages_present +id: 419e4450-e96b-4955-b6d3-f29494d84ab8 diff --git a/Sanity/man_pages_present/runtest.sh b/Sanity/man_pages_present/runtest.sh new file mode 100755 index 0000000..c3d2c00 --- /dev/null +++ b/Sanity/man_pages_present/runtest.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/annobin/Sanity/man_pages_present +# Description: Check if man pages are present +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +# Relevancy: Should work with +# - system annobin of RHEL 8.4+ or 9+ +# - annobin of GTS/DTS 11+ + +ANNOCHECK="${ANNOCHECK:-$(type -P annocheck)}" + +ANNOCHECK_RPM_NAME=$(rpm --qf '%{name}' -qf $ANNOCHECK) +if [[ "$ANNOCHECK_RPM_NAME" == *toolset* ]]; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +elif rlIsRHEL '>9' || rlIsFedora; then + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck}-plugin-gcc +else + ANNOBIN_RPM_NAME=${ANNOCHECK_RPM_NAME%-annocheck} +fi + +PACKAGES="$ANNOCHECK_RPM_NAME $ANNOBIN_RPM_NAME" + +rlJournalStart + rlPhaseStartSetup + rlMountRedhat + + rlRun "yum -y install --skip-broken $PACKAGES" 0-255 # best effort + + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "ANNOCHECK=$ANNOCHECK" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + rlAssertRpm --all + export COLLECTIONS="$_COLLECTIONS" + + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + + rlRun "rpm -ql $PACKAGES >files" + while read i; do + [[ "$i" == */bin/* ]] && echo "${i##*/bin/}" >>commands.txt + [[ "$i" == */man1/* ]] && echo "$i" >>manfiles.txt + done dump.man" + if rlIsRHEL '<7'; then + rlRun 'col -b plaintext.man' + rlRun 'mv plaintext.man dump.man' + fi + rlAssertGrep DESCRIPTION dump.man + rlRun 'rm dump.man' + done + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/smoke/main.fmf b/Sanity/smoke/main.fmf new file mode 100644 index 0000000..28e5f83 --- /dev/null +++ b/Sanity/smoke/main.fmf @@ -0,0 +1,27 @@ +summary: smoke test for annobin plugin +description: '' +contact: Martin Cermak +component: + - annobin +test: $WITH_SCL ./runtest.sh +framework: beakerlib +recommend: + # newer name of the plugin + - annobin-plugin-gcc + # older name of the plugin + - annobin +duration: 15m +enabled: true +tag: + - CI-Tier-1 + - DTS9-INTEROP-CI + - NoRHEL4 + - NoRHEL5 +adjust: + - enabled: false + when: distro < rhel-6 + continue: false +extra-nitrate: TC#0605363 +extra-summary: /tools/annobin/Sanity/smoke +extra-task: /tools/annobin/Sanity/smoke +id: 53d76909-4863-4ce6-8e7b-5413b5faa6df diff --git a/Sanity/smoke/runtest.sh b/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..0f39938 --- /dev/null +++ b/Sanity/smoke/runtest.sh @@ -0,0 +1,44 @@ +#!/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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 "echo 'int main() {return 0;}' | gcc -xc -fplugin=annobin -o /dev/null -" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd