Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

29 changed files with 1266 additions and 189 deletions

View File

@ -1 +0,0 @@
54956e8dfce9d977814449907acaeb26c50dd1cc SOURCES/annobin-11.13.tar.xz

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/annobin-11.13.tar.xz /annobin-*.tar.xz
/annobin-9.51-1.fc34.src.rpm

View File

@ -1,12 +0,0 @@
diff -rup annobin.orig/annocheck/annocheck.c annobin-11.12/annocheck/annocheck.c
--- annobin.orig/annocheck/annocheck.c 2023-03-03 16:09:24.659603476 +0000
+++ annobin-11.12/annocheck/annocheck.c 2023-03-03 16:09:57.249530355 +0000
@@ -20,6 +20,8 @@
#include <sys/stat.h>
#include <elfutils/libdwelf.h>
#include <elfutils/libdwfl.h>
+#undef HAVE_LIBDEBUGINFOD
+#define HAVE_LIBDEBUGINFOD 0
#ifndef LIBANNOCHECK
#include <rpm/rpmlib.h>
#if HAVE_LIBDEBUGINFOD

View File

@ -1,12 +0,0 @@
diff -rup annobin.orig/gcc-plugin/annobin.cc annobin-10.64/gcc-plugin/annobin.cc
--- annobin.orig/gcc-plugin/annobin.cc 2022-04-06 12:55:02.350469755 +0100
+++ annobin-10.64/gcc-plugin/annobin.cc 2022-04-06 12:55:28.503296390 +0100
@@ -1851,7 +1851,7 @@ annobin_emit_start_sym_and_version_note
Ensure that we do not have empty special text sections so that the
annobin start symbols are never beyond the end of the sections. */
#ifndef ANNOBIN_NOP_INSN
-#define ANNOBIN_NOP_INSN ".nop"
+#define ANNOBIN_NOP_INSN "nop"
#endif
if (* suffix && enable_ppc64_nops)
annobin_emit_asm (ANNOBIN_NOP_INSN,

View File

@ -0,0 +1,55 @@
#--- annobin.orig/gcc-plugin/annobin.cc 2025-01-22 10:16:43.228689446 +0000
+++ annobin-12.82/gcc-plugin/annobin.cc 2025-01-22 10:17:28.453873506 +0000
@@ -3249,6 +3249,7 @@ multiple_annobin_plugins_present (const
return false;
}
+#if GCCPLUGIN_VERSION_MAJOR > 11
/* We used to call plugins_active_p() here but this only lets us know if
there are other active plugins. It does not tell us if they are
different versions of the annobin plugin. So instead we iterate
@@ -3271,16 +3272,16 @@ multiple_annobin_plugins_present (const
return false;
}
- // We have only found one annobin plugin, which must be ourselves.
- // But there is a possibility that there are other, older versions of the
- // annobin plugin installed. We have no reliable way of detecting them,
- // but we assume that if the version string in the plugin's
- // plugin_name_arrgs structure is not filled in then it *might* be an
- // annobin plugin. So we count that as a positive result.
- //
- // If this turns out to be incorrect then the only recourse is for the user
- // to place the annobin plugin earlier on the gcc command line than the
- // plugin(s) that are not setting their version strings.
+ /* We have only found one annobin plugin, which must be ourselves.
+ But there is a possibility that there are other, older versions of the
+ annobin plugin installed. We have no reliable way of detecting them,
+ but we assume that if the version string in the plugin's
+ plugin_name_args structure is not filled in then it *might* be an
+ annobin plugin. So we count that as a positive result.
+
+ If this turns out to be incorrect then the only recourse is for the user
+ to place the annobin plugin earlier on the gcc command line than the
+ plugin(s) that are not setting their version strings. */
if (cbd.num_with_no_version > 0)
{
if (verbose_level >= INFORM_VERBOSE)
@@ -3288,7 +3289,16 @@ multiple_annobin_plugins_present (const
name, cbd.num_with_no_version);
return true;
}
-
+#else
+ if (plugins_active_p ())
+ {
+ if (verbose_level >= INFORM_VERBOSE)
+ fprintf (stderr, "%s: other plugin(s) found. Assuming that they are old versions of the annobin plugin",
+ name);
+ return true;
+ }
+#endif
+
return false;
}

View File

@ -0,0 +1,36 @@
--- annobin.orig/gcc-plugin/annobin.cc 2024-01-17 14:00:26.889983192 +0000
+++ annobin-12.31/gcc-plugin/annobin.cc 2024-01-17 14:01:27.517055850 +0000
@@ -3261,18 +3261,24 @@ plugin_init (struct plugin_name_args *
target_start_sym_bias = annobin_target_start_symbol_bias ();
if (annobin_attach_type == not_set)
{
- /* Choose a default attachment type. Link ordering is preferable
- as it is more resistant to changes in compiler section building.
- But it can only be used if the target assembler supports link_order sections
- and the target linker is sufficiently new that it implements them correctly.
- For now we use a test of the GCC version as an approximation to the binutils
- versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient).
- See BZ 2016458 for an example of where this solution is needed. */
+ if (annobin_note_format == string)
+ /* String format notes do not need section groups. */
+ annobin_attach_type = none;
+ else
+ {
+ /* Choose a default attachment type. Link ordering is preferable
+ as it is more resistant to changes in compiler section building.
+ But it can only be used if the target assembler supports link_order sections
+ and the target linker is sufficiently new that it implements them correctly.
+ For now we use a test of the GCC version as an approximation to the binutils
+ versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient).
+ See BZ 2016458 for an example of where this solution is needed. */
#if GCCPLUGIN_VERSION_MAJOR >= 12
- annobin_attach_type = link_order;
+ annobin_attach_type = link_order;
#else
- annobin_attach_type = group;
+ annobin_attach_type = group;
#endif
+ }
}
annobin_inform (INFORM_VERBOSE, "Attach mode: %s", attach_mode_name (annobin_attach_type));

File diff suppressed because it is too large Load Diff

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.other.functional}

5
plans/ci.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: CI Gating Plan
discover:
how: fmf
execute:
how: tmt

4
rpminspect.yaml Normal file
View File

@ -0,0 +1,4 @@
---
runpath:
allowed_paths:
- /usr/lib64

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (annobin-12.96.tar.xz) = a6484c13e5a780e510b21e6f9178f146394e38f7f9d4e005a46cc9df0da0f34ae684349f8dacffbeb3850eaa8e487daef17ac9c9b080f73519e15c01d2e8ac5b

2
tests/README Normal file
View File

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

View File

@ -0,0 +1,71 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/identify
# Description: identify
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/identify
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
requires = annobin
# https://mojo.redhat.com/docs/DOC-1072127
dtsver = $(shell seq -s, 10 11)
dtsreq = $(shell echo {dev,gcc-}toolset-{$(dtsver)}{,-annocheck})
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: identify" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
$(foreach package, $(requires) $(dtsreq), \
echo "Requires: $(package)" >> $(METADATA); \
)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/annobin/Regression/identify
Description: identify
Author: Martin Cermak <mcermak@redhat.com>

View File

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

View File

@ -0,0 +1,42 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/identify
# Description: identify
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "tool_v=$(annocheck --version | awk '/^annocheck: Version/ {print $3}')"
rlRun "__RPM=$(rpm --queryformat='%{name}\n' -qf $(man -w annobin))"
rlRun "rpm_v=$(rpm -q --queryformat='%{version}\n' $__RPM)"
# Following fails for annobin-8.89-2.el8
rlRun "[[ "x${tool_v}" == "x${rpm_v}." ]]"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/lto-preprocessor-options
# Description: lto-preprocessor-options
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/lto-preprocessor-options
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: lto-preprocessor-options" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
@echo "Requires: annobin annobin-annocheck redhat-rpm-config" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1743635" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/annobin/Regression/lto-preprocessor-options
Description: lto-preprocessor-options
Author: Martin Cermak <mcermak@redhat.com>

View File

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

View File

@ -0,0 +1,41 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/lto-preprocessor-options
# Description: lto-preprocessor-options
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
b=`mktemp`
rlRun "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

View File

@ -0,0 +1,78 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/testsuite
# Description: testsuite
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/testsuite
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
requires = annobin binutils-devel gcc-c++ elfutils elfutils-devel make rpm-build \
rpm-devel gcc-plugin-devel yum yum-utils bzip2-devel
# https://mojo.redhat.com/docs/DOC-1072127
dtsver = $(shell seq -s, 9 11)
dtsreq = $(shell echo {dev,gcc-}toolset-{$(dtsver)}-{build,elfutils{,-devel},gcc{,-c++,-plugin-devel},binutils{,-devel},annobin{,-annocheck}})
installdeps:
yum -y install $(requires)
showdeps:
echo $(requires)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: testsuite" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
$(foreach package, $(requires) $(dtsreq), \
echo "Requires: $(package)" >> $(METADATA); \
)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/annobin/Regression/testsuite
Description: testsuite
Author: Martin Cermak <mcermak@redhat.com>

View File

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

View File

@ -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 <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="${PACKAGE:-$(rpm -qf --queryformat=%{name} $(man -w annobin))}"
export PACKAGE
GCC="${GCC:-$(which gcc)}"
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "X_SCLS=$X_SCLS"
rlLogInfo "GCC=$GCC"
# In case more than one devtoolset- or gcc-toolset -build package is
# installed (they can co-exist from the packaging persp, but their
# coexistence causes unexpected results with rpm macros), then we have
# a mess of defined rpm macros coming e.g. from
# /etc/rpm/macros.gcc-toolset-10-config
# /etc/rpm/macros.gcc-toolset-9-config etc. To have just the needed
# macros (respective to given SCL under test) defined without
# uninstalling unneeded RPMs, we'll need an override mechanism. The
# following assumes just one SCL *enabled* (more than one installed),
# and doesn't care of a (useless) revert:
echo ${X_SCLS} | fgrep toolset && \
rlRun "cat /etc/rpm/*${X_SCLS%\ }* > ~/.rpmmacros"
rlAssertRpm $PACKAGE
rlRun "TMP=\$(mktemp -d)"
rlRun "pushd $TMP"
rlFetchSrcForInstalled $PACKAGE
rlRun "yum-builddep -y *src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec"
rlPhaseEnd
rlPhaseStartTest
rlRun "pushd BUILD/annobin-*"
set -o pipefail
rlRun "make check |& tee $TMP/check.log"
rlRun -l "grep '^PASS:' $TMP/check.log" 0
rlRun -l "grep '^FAIL:' $TMP/check.log" 1
PASSCOUNT=$(grep '^PASS:' $TMP/check.log | wc -l)
rlRun "[[ $PASSCOUNT -ge 7 ]]"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,59 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Sanity/smoke
# Description: smoke test for annobin plugin
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Sanity/smoke
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: smoke test for annobin plugin" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "License: GPL" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/annobin/Sanity/smoke
Description: smoke test for annobin plugin
Author: Martin Cermak <mcermak@redhat.com>

View File

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

44
tests/Sanity/smoke/runtest.sh Executable file
View File

@ -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 <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="annobin"
rlJournalStart
rlPhaseStartSetup
rlRun "which gcc"
rlRun "man -w annobin"
rlRun "echo $X_SCLS"
rlPhaseEnd
rlPhaseStartTest
rlRun "echo 'int main() {return 0;}' | gcc -xc -fplugin=annobin -o /dev/null -"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd