From 012a47b6a105485da49d4f70be569efd8e3efea4 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Thu, 8 Aug 2024 17:06:53 +1200 Subject: [PATCH] Enable brew-build.tier0.functional test Now the libkdumpfile-devel is in rhel10 compose, so enable the brew-build.tier0.functional test. Related: RHEL-33022 Signed-off-by: Tao Liu --- gating.yaml | 3 +- python-drgn.spec | 6 +++- tests/README | 2 ++ tests/selftest/Makefile | 64 ++++++++++++++++++++++++++++++++++++ tests/selftest/PURPOSE | 4 +++ tests/selftest/runtest.sh | 68 +++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 25 ++++++++++++++ 7 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 tests/README create mode 100644 tests/selftest/Makefile create mode 100644 tests/selftest/PURPOSE create mode 100755 tests/selftest/runtest.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml index 9156309..4ca9235 100644 --- a/gating.yaml +++ b/gating.yaml @@ -2,4 +2,5 @@ product_versions: - rhel-10 decision_context: osci_compose_gate -rules: [] +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/python-drgn.spec b/python-drgn.spec index a092b78..16f2646 100644 --- a/python-drgn.spec +++ b/python-drgn.spec @@ -15,7 +15,7 @@ scripting in Python.} Name: python-%{pypi_name} Version: 0.0.25 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Programmable debugger License: LGPL-2.1-or-later @@ -117,6 +117,10 @@ cp -PR contrib tools %{buildroot}%{_datadir}/drgn %endif %changelog +* Thu Aug 8 2024 Tao Liu - 0.0.25-7 +- Enable brew-build.tier0.functional test +- Remove autorelease and autochangelog + * Mon Jun 24 2024 Troy Dawson - 0.0.25-6 - Bump release for June 2024 mass rebuild diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..44fb438 --- /dev/null +++ b/tests/README @@ -0,0 +1,2 @@ +initial tests: +run make check, which runs any selftests in the upstream source tarball diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile new file mode 100644 index 0000000..7b452de --- /dev/null +++ b/tests/selftest/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/patch/Sanity/selftest +# Description: Executes upstream test suite +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# 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=/CoreOS/rng-tools/Sanity/selftest +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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Vadkerti " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Executes upstream test suite" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: patch" >> $(METADATA) + @echo "Requires: patch gcc rpm-build automake libselinux-devel ed libattr-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL3 -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/selftest/PURPOSE b/tests/selftest/PURPOSE new file mode 100644 index 0000000..a91bf5e --- /dev/null +++ b/tests/selftest/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of python-drgn/tests/selftest +Description: Executes selftest to validate integrity of python-drgn +Author: Tao Liu + diff --git a/tests/selftest/runtest.sh b/tests/selftest/runtest.sh new file mode 100755 index 0000000..26e8bab --- /dev/null +++ b/tests/selftest/runtest.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/rng-tools/Sanity/selftest +# Description: Executes the upstream test suite comming with the package +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# 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 rhts environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="python-drgn" +PACKAGES="drgn python3-devel python3-setuptools sed python3-pytest gcc-c++ make bzip2-devel elfutils-devel libkdumpfile-devel xz-devel autoconf automake libtool zlib-ng-compat-devel" +UPSTREAMPKG="python-drgn-*" +BUILDLOG=`mktemp` +TESTLOG=`mktemp` +TARGET=$(echo `uname -m` | egrep ppc) +if [[ $TARGET != "" ]]; then TARGET="--target `uname -m`"; fi +TOPDIR=`mktemp -d` +SPEC="$TOPDIR/SPECS/$PACKAGE*.spec" +TESTDIR="$TOPDIR/BUILD/$UPSTREAMPKG/" + +rlJournalStart + rlPhaseStartSetup + for PKG in $PACKAGES; do + rlAssertRpm $PKG + done + rlPhaseEnd + rlPhaseStartTest + rlFetchSrcForInstalled drgn + rlRun "rpm -ivh --define '_topdir $TOPDIR' $PACKAGE*.src.rpm" 0 "Installing $PACKAGE src rpm" + echo "+ Building $PACKAGE (Log: $BUILDLOG)" + echo "+ Build command: rpmbuild -bc $SPEC $TARGET" + rlRun "rpmbuild --define '_package_note_flags %nil' --define '_topdir $TOPDIR' -bc $SPEC $TARGET &> $BUILDLOG" + if [ $? -eq 0 ] + then + rlPass "Selftest Passed" + else + rlFail "Selftest Failed" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..99cb8e1 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,25 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - selftest + required_packages: + - drgn + - python3-devel + - python3-setuptools + - sed + - python3-pytest + - gcc-c++ + - make + - bzip2-devel + - elfutils-devel + - libkdumpfile-devel + - xz-devel + - autoconf + - automake + - libtool + - zlib-ng-compat-devel