Package tests

This commit is contained in:
Jitka Plesnikova 2021-06-03 11:09:24 +02:00
parent 99e5b25137
commit 2af69a541b
8 changed files with 48 additions and 1 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

1
.gitignore vendored
View File

@ -34,3 +34,4 @@
/Socket-2.029.tar.gz
/Socket-2.030.tar.gz
/Socket-2.031.tar.gz
/Socket-2.032.tar.gz

Binary file not shown.

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

@ -43,9 +43,24 @@ socket(), setsockopt() and bind(). It also provides several other support
functions, mostly for dealing with conversions of network addresses between
human-readable and native binary forms, and for hostname resolver operations.
%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 Socket-%{version}
# Help file to recognise the 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 OPTIMIZE="$RPM_OPT_FLAGS"
%{make_build}
@ -55,7 +70,17 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
%{_fixperms} $RPM_BUILD_ROOT/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
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
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test
%files
@ -65,9 +90,13 @@ make test
%{perl_vendorarch}/Socket*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Thu Jun 03 2021 Jitka Plesnikova <jplesnik@redhat.com> - 4:2.032-1
- 2.032 bump
- Package tests
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 4:2.031-477
- Increase release to favour standalone package

5
plans/sanity.fmf Normal file
View File

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

View File

@ -1 +1 @@
SHA512 (Socket-2.031.tar.gz) = 8c44f20be19988a26ea2c451ec0e5a732d5471ea5cc1af93a1c1c202fb283ee6ccc094c940b9e258d7613ef8afcbfa52581ccdb65feb1008cead46fa7f036924
SHA512 (Socket-2.032.tar.gz) = 9b412ffbfa0c7fa1a8d9c474eac9d2835d65e0089c9cc1338459800a18ea472e8ea5ae02a54c01cc9524da6de0585c26dbbd5e97f5b563207083b15ba03c35f2

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

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