Resolves: RHEL-43290 - Package tests

This commit is contained in:
Jitka Plesnikova 2024-07-04 12:43:46 +02:00
parent 85b54aee58
commit e623e4f889
5 changed files with 66 additions and 3 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,6 +1,6 @@
Name: perl-libxml-perl Name: perl-libxml-perl
Version: 0.08 Version: 0.08
Release: 44%{?dist} Release: 45%{?dist}
Summary: A collection of Perl modules for working with XML Summary: A collection of Perl modules for working with XML
License: (GPL+ or Artistic) and Public Domain License: (GPL+ or Artistic) and Public Domain
URL: https://metacpan.org/release/libxml-perl URL: https://metacpan.org/release/libxml-perl
@ -9,6 +9,7 @@ BuildArch: noarch
BuildRequires: make BuildRequires: make
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
# Run-time: # Run-time:
BuildRequires: perl(:VERSION) >= 5.5.0 BuildRequires: perl(:VERSION) >= 5.5.0
@ -19,7 +20,6 @@ BuildRequires: perl(UNIVERSAL)
BuildRequires: perl(vars) BuildRequires: perl(vars)
BuildRequires: perl(XML::Parser) >= 2.19 BuildRequires: perl(XML::Parser) >= 2.19
# Tests: # Tests:
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(XML::Parser) >= 2.19 Requires: perl(XML::Parser) >= 2.19
# Filter out unversioned provides # Filter out unversioned provides
@ -33,8 +33,22 @@ documents for working with XML in Perl. libxml-perl software works in
combination with XML::Parser, PerlSAX, XML::DOM, XML::Grove and combination with XML::Parser, PerlSAX, XML::DOM, XML::Grove and
others. others.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep %prep
%setup -q -n libxml-perl-%{version} %setup -q -n libxml-perl-%{version}
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build %build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
@ -43,6 +57,22 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install %install
%{make_install} %{make_install}
%{_fixperms} %{buildroot}/* %{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# Some tests write into temporary files/directories. The easiest solution
# is to copy the tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -rf "$DIR"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check %check
make test make test
@ -51,9 +81,17 @@ make test
%doc ChangeLog Changes README %doc ChangeLog Changes README
%{perl_vendorlib}/Data/ %{perl_vendorlib}/Data/
%{perl_vendorlib}/XML/ %{perl_vendorlib}/XML/
%{_mandir}/man3/*.3* %{_mandir}/man3/Data*.3*
%{_mandir}/man3/XML*.3*
%files tests
%{_libexecdir}/%{name}
%changelog %changelog
* Mon Jul 01 2024 Jitka Plesnikova <jplesnik@redhat.com> - 0.08-45
- Resolves: RHEL-43290
- Package tests
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.08-44 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.08-44
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688 Related: rhbz#1991688

5
plans/sanity.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

12
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Upstream tests
contact: Jitka Plesnikova <jplesnik@redhat.com>
component: perl-libxml-perl
require: perl-libxml-perl-tests
test: /usr/libexec/perl-libxml-perl/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-9 or distro < centos-stream-9
continue: false