From a9360e73d98a732f05edf2c060b61a440f6e11a5 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Fri, 18 Jun 2021 16:53:30 +0000 Subject: [PATCH] CI testing: Add test covering rhbz1969584 --- .../main.fmf | 16 ++++++ .../runtest.sh | 54 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf create mode 100755 tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh diff --git a/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf b/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf new file mode 100644 index 0000000..435d7ff --- /dev/null +++ b/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/main.fmf @@ -0,0 +1,16 @@ +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: ./runtest.sh +framework: beakerlib +recommend: +- annobin-annocheck +- gcc +duration: 48h +extra-summary: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check +extra-task: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check diff --git a/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh b/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh new file mode 100755 index 0000000..41312a4 --- /dev/null +++ b/tests/Regression/annobin-fails-to-skip-endbr64-entry-point-check/runtest.sh @@ -0,0 +1,54 @@ +#!/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 + +PACKAGE="annobin" + +rlJournalStart + rlPhaseStartSetup + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "rpm -q annobin-annocheck gcc" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo 'void f1(void) {}' > f1.c" + rlRun "echo 'void f2(void) {}' > f2.c" + rlRun "gcc `rpm --eval %build_cflags` -fpic -c f1.c" + rlRun "gcc `rpm --eval %build_cflags` -fpic -c f2.c" + rlRun "gcc `rpm --eval %build_ldflags` -shared f1.o f2.o" + rlRun "annocheck -v a.out" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd