Package tests

This commit is contained in:
Jitka Plesnikova 2024-02-05 17:29:07 +01:00
parent 2f317c7597
commit 56fa198385
6 changed files with 59 additions and 19 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,17 +0,0 @@
https://rt.cpan.org/Public/Bug/Display.html?id=86060
--- lib/Mail/SPF/Util.pm
+++ lib/Mail/SPF/Util.pm
@@ -155,9 +155,9 @@ sub ipv6_address_is_ipv4_mapped {
throws I<Mail::SPF::EInvalidOptionValue>
Returns the given I<NetAddr::IP> IPv4 or IPv6 address compactly formatted as a
-I<string>. For IPv4 addresses, this is equivalent to calling L< NetAddr::IP's
-C<addr> |NetAddr::IP/addr> method. For IPv6 addresses, this is equivalent to
-calling L< NetAddr::IP's C<short> |NedAddr::IP/short> method. Throws a
+I<string>. For IPv4 addresses, this is equivalent to calling L<NetAddr::IP's
+C<addr>|NetAddr::IP/addr> method. For IPv6 addresses, this is equivalent to
+calling L<NetAddr::IP's C<short>|NetAddr::IP/short> method. Throws a
I<Mail::SPF::EInvalidOptionValue> exception if the specified object is not a
I<NetAddr::IP> IPv4 or IPv6 address object.

16
gating.yaml Normal file
View File

@ -0,0 +1,16 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
# Rawhide
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

View File

@ -12,6 +12,7 @@ BuildRequires: coreutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
@ -31,8 +32,6 @@ BuildRequires: perl(blib)
BuildRequires: perl(Net::DNS::Resolver::Programmable) >= 0.003
BuildRequires: perl(Net::DNS::RR)
BuildRequires: perl(Test::More)
# Optional tests only
BuildRequires: perl(Test::Pod) >= 1.00
Requires: perl(Net::DNS) >= 0.62
Requires: perl(URI) >= 1.13
@ -43,12 +42,27 @@ Requires(postun): %{_sbindir}/update-alternatives
Mail::SPF is an object-oriented implementation of Sender Policy Framework
(SPF). See http://www.openspf.org for more information about SPF.
%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
%setup -q -n Mail-SPF-%{version}
# Work around test suite failures with Net::DNS ≥ 0.68 (CPAN RT#78214)
%patch -P 0
chmod -x bin/*
# 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
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
@ -62,6 +76,19 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{__mv} -f %{buildroot}%{_mandir}/man1/spfquery.1 %{buildroot}%{_mandir}/man1/spfquery-%{name}.1
touch %{buildroot}%{_bindir}/spfquery %{buildroot}%{_bindir}/spfd %{buildroot}%{_mandir}/man1/spfquery.1.gz
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
rm %{buildroot}%{_libexecdir}/%{name}/t/90-author*
for F in `ls %{buildroot}%{_libexecdir}/%{name}/t/*`; do
perl -i -ne 'print $_ unless m{^use blib}' $F
done
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
make test
@ -87,9 +114,13 @@ fi
%{_bindir}/spfquery.%{name}
%{_bindir}/spfd.%{name}
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Feb 05 2024 Jitka Plesnikova <jplesnik@redhat.com> - 3.20240205-1
- 3.20240205 bump (rhbz#2262786)
- Package tests
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

5
plans/sanity.fmf Normal file
View File

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

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

@ -0,0 +1,4 @@
summary: Upstream tests
component: perl-Mail-SPF
require: perl-Mail-SPF-tests
test: /usr/libexec/perl-Mail-SPF/test