From f683a5bc292e0170c21b4b808e4ba5e892d6f859 Mon Sep 17 00:00:00 2001 From: Jan Kurik Date: Thu, 8 Apr 2021 08:17:51 +0200 Subject: [PATCH] Added test for presence of version symbols in PCP libraries --- .../Makefile | 65 +++++++++++++++++++ .../PURPOSE | 5 ++ .../main.fmf | 16 +++++ .../runtest.sh | 47 ++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 tests/Sanity/shared-libraries-need-symbol-versioning/Makefile create mode 100644 tests/Sanity/shared-libraries-need-symbol-versioning/PURPOSE create mode 100644 tests/Sanity/shared-libraries-need-symbol-versioning/main.fmf create mode 100755 tests/Sanity/shared-libraries-need-symbol-versioning/runtest.sh diff --git a/tests/Sanity/shared-libraries-need-symbol-versioning/Makefile b/tests/Sanity/shared-libraries-need-symbol-versioning/Makefile new file mode 100644 index 0000000..7a281b5 --- /dev/null +++ b/tests/Sanity/shared-libraries-need-symbol-versioning/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/pcp/Sanity/shared-libraries-need-symbol-versioning +# Description: A check for presence of version symbols +# Author: Milos Prchlik , Jan Kuřík +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014-2021 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/pcp/Sanity/shared-libraries-need-symbol-versioning +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: Jan Kuřík " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: A check for presence of version symbols" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: pcp" >> $(METADATA) + @echo "Requires: pcp pcp-libs binutils" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1037771" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/shared-libraries-need-symbol-versioning/PURPOSE b/tests/Sanity/shared-libraries-need-symbol-versioning/PURPOSE new file mode 100644 index 0000000..5dd9bc8 --- /dev/null +++ b/tests/Sanity/shared-libraries-need-symbol-versioning/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/pcp/Sanity/shared-libraries-need-symbol-versioning +Description: A check for presence of version symbols +Author: Milos Prchlik , Jan Kuřík +Bug summary: pcp shared libraries need symbol-versioning +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1037771 diff --git a/tests/Sanity/shared-libraries-need-symbol-versioning/main.fmf b/tests/Sanity/shared-libraries-need-symbol-versioning/main.fmf new file mode 100644 index 0000000..cb2ea2b --- /dev/null +++ b/tests/Sanity/shared-libraries-need-symbol-versioning/main.fmf @@ -0,0 +1,16 @@ +summary: A check for presence of version symbols +description: | + Bug summary: pcp shared libraries need symbol-versioning + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1037771 +contact: Jan Kuřík +component: +- pcp +test: ./runtest.sh +framework: beakerlib +recommend: +- pcp +- pcp-libs +- binutils +duration: 15m +extra-summary: /tools/pcp/Sanity/shared-libraries-need-symbol-versioning +extra-task: /tools/pcp/Sanity/shared-libraries-need-symbol-versioning diff --git a/tests/Sanity/shared-libraries-need-symbol-versioning/runtest.sh b/tests/Sanity/shared-libraries-need-symbol-versioning/runtest.sh new file mode 100755 index 0000000..35928d9 --- /dev/null +++ b/tests/Sanity/shared-libraries-need-symbol-versioning/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/pcp/Sanity/shared-libraries-need-symbol-versioning +# Description: A check for presence of version symbols +# Author: Milos Prchlik , Jan Kuřík +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014-2021 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="pcp" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + for lib in `rpm -ql pcp-libs | grep lib64`; do + rlAssertExists "$lib" + rlRun "readelf -s $lib | grep '@PCP_[[:digit:]]\+\.[[:digit:]]\+'" 0 \ + "$lib should contain versioned symbols" + done + rlPhaseEnd +rlJournalPrintText +rlJournalEnd