From bfb7ed342bdc215d6a1ec26c46ddbaa16fcfe46b Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Tue, 25 Jun 2024 15:52:02 +0200 Subject: [PATCH] Init commit --- .fmf/version | 1 + README.md | 3 -- ci.fmf | 5 +++ tests/testsuite/main.fmf | 20 +++++++++++ tests/testsuite/runtest.sh | 73 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 .fmf/version delete mode 100644 README.md create mode 100644 ci.fmf create mode 100644 tests/testsuite/main.fmf create mode 100755 tests/testsuite/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/README.md b/README.md deleted file mode 100644 index 304a4e3..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# libtool-gating - -CI gating tests for systemtap \ No newline at end of file diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..bb66dbd --- /dev/null +++ b/ci.fmf @@ -0,0 +1,5 @@ +summary: CI Gating Plan +discover: + how: fmf +execute: + how: tmt diff --git a/tests/testsuite/main.fmf b/tests/testsuite/main.fmf new file mode 100644 index 0000000..d18f208 --- /dev/null +++ b/tests/testsuite/main.fmf @@ -0,0 +1,20 @@ +summary: runs testsuite +description: '' +contact: Michal Nowak +component: + - libtool +test: ./runtest.sh +framework: beakerlib +recommend: + - libtool + - yum-utils + - rpm-build + - autoconf + - automake + - texinfo + - libstdc++-devel + - gcc-gfortran + - gcc-java +duration: 40m +extra-summary: /tools/libtool/Sanity/testsuite +extra-task: /tools/libtool/Sanity/testsuite diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh new file mode 100755 index 0000000..c040729 --- /dev/null +++ b/tests/testsuite/runtest.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/libtool/Sanity/testsuite +# Description: runs testsuite +# Author: Michal Nowak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# 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 3 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 rhts environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="libtool" + +# On RHEL10 RPM started to require the following envvars: +# These seem to be harmless for the older versions. +export RPM_ARCH=`arch` +export RPM_PACKAGE_NAME=nnn +export RPM_PACKAGE_RELEASE=rrr +export RPM_PACKAGE_VERSION=vvv + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" + rlRun "pushd $TmpDir" + rlRun "rlFetchSrcForInstalled ${PACKAGE}" + rlRun "SRPM=$(readlink -f libtool-*.src.rpm)" + rlRun "NAME=$(rpm -q --queryformat '%{name}' $SRPM)" + rlRun "VERSION=$(rpm -q --queryformat '%{version}' $SRPM)" + rlRun "SPECDIR=$(rpm --eval '%_specdir')" + rlRun "SPECFILE=${SPECDIR}/${NAME}.spec" + rlRun "BUILDDIR=$(rpm --eval '%_builddir')/${NAME}-${VERSION}" + + # On Fedora 41, BUILDDIR appears to be somewhat ... obscure ... + rlRun "test -d ${BUILDDIR} || BUILDDIR=\"${BUILDDIR}-build/${NAME}-${VERSION}\"" + + rlRun "test -d ${BUILDDIR}" + rlRun "yum-builddep --nogpgcheck -y ${SRPM}" + rlRun "rm -rf ${SPECDIR}" + rlRun "rpm -Uvh ${SRPM}" + rlRun "rpmbuild -bc ${SPECFILE}" + rlRun "cd ${BUILDDIR}" + rlPhaseEnd + + rlPhaseStartTest + rlRun "make check VERBOSE=yes" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd