Package tests

This commit is contained in:
Jitka Plesnikova 2023-08-22 15:48:49 +02:00
parent 77ec4dd261
commit 166156eb59
6 changed files with 54 additions and 14 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,13 +0,0 @@
diff -up Authen-SASL-2.16/lib/Authen/SASL/Perl.pm.orig Authen-SASL-2.16/lib/Authen/SASL/Perl.pm
--- Authen-SASL-2.16/lib/Authen/SASL/Perl.pm.orig 2012-09-04 18:00:31.000000000 +0200
+++ Authen-SASL-2.16/lib/Authen/SASL/Perl.pm 2014-06-04 09:51:34.654310724 +0200
@@ -323,6 +323,9 @@ sub securesocket {
my $fh = $self->{fh};
+ # Fix for BZ#965739, RT#85294
+ $len = length($_[1]) if $len > length($_[1]);
+
# put on wire in peer-sized chunks
my $bsz = $self->{sndbufsz};
while ($len > 0) {

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !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

@ -7,10 +7,12 @@ URL: https://metacpan.org/release/Authen-SASL
Source0: https://cpan.metacpan.org/authors/id/E/EH/EHUELS/Authen-SASL-%{version}.tar.gz
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(:VERSION) >= 5.6
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
@ -32,32 +34,66 @@ SASL is a generic mechanism for authentication used by several network
protocols. Authen::SASL provides an implementation framework that all
protocols should be able to share.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: perl(Carp)
Requires: perl(Digest::MD5)
Requires: perl(Digest::HMAC_MD5)
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%autosetup -p1 -n Authen-SASL-%{version}
# Fix permissions
chmod -c a-x example_pl
# Help generators to recognize Perl scripts
for F in `find t -name *.t -o -name *.pl`; 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}
%install
%{make_install}
%{_fixperms} $RPM_BUILD_ROOT
%{_fixperms} %{buildroot}
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
rm %{buildroot}%{_libexecdir}/%{name}/t/author-pod-syntax.t
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -I . -r -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
unset AUTHOR_TESTING
make test
%files
%license LICENSE
%doc api.txt Changes example_pl README
%{perl_vendorlib}/*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Aug 21 2023 Jitka Plesnikova <jplesnik@redhat.com> - 2.1700-1
- 2.1700 bump (rhbz#2231059)
- Package tests
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.16-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_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-Authen-SASL
require: perl-Authen-SASL-tests
test: /usr/libexec/perl-Authen-SASL/test