diff --git a/.fmf/version b/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/.fmf/version
@@ -0,0 +1 @@
+1
diff --git a/.gitignore b/.gitignore
index 418477d..4668051 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 /perlfaq-5.20200125.tar.gz
 /perlfaq-5.20200523.tar.gz
 /perlfaq-5.20201107.tar.gz
+/perlfaq-5.20210520.tar.gz
diff --git a/gating.yaml b/gating.yaml
new file mode 100644
index 0000000..da7481a
--- /dev/null
+++ b/gating.yaml
@@ -0,0 +1,19 @@
+# Fedora
+--- !Policy
+id: fedora_policy
+product_versions:
+  - fedora-*
+decision_contexts:
+  - bodhi_update_push_testing
+  - bodhi_update_push_stable
+subject_type: koji_build
+rules:
+  - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
+
+# RHEL
+--- !Policy
+product_versions:
+  - rhel-*
+decision_context: osci_compose_gate
+rules:
+  - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
diff --git a/perl-perlfaq.spec b/perl-perlfaq.spec
index 6f698a2..c49bdbb 100644
--- a/perl-perlfaq.spec
+++ b/perl-perlfaq.spec
@@ -1,6 +1,6 @@
 Name:           perl-perlfaq
-Version:        5.20201107
-Release:        4%{?dist}
+Version:        5.20210520
+Release:        1%{?dist}
 Summary:        Frequently asked questions about Perl
 # Code examples are Public Domain
 License:        (GPL+ or Artistic) and Public Domain
@@ -12,6 +12,7 @@ BuildRequires:  make
 BuildRequires:  perl-generators
 BuildRequires:  perl-interpreter
 BuildRequires:  perl(:VERSION) >= 5.6
+BuildRequires:  perl(Config)
 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
 BuildRequires:  perl(strict)
 BuildRequires:  perl(warnings)
@@ -21,34 +22,67 @@ BuildRequires:  perl(File::Spec)
 BuildRequires:  perl(IO::Handle)
 BuildRequires:  perl(IPC::Open3)
 BuildRequires:  perl(Test::More)
-Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 Conflicts:      perl < 4:5.22.0-347
 
 %description
 The perlfaq comprises several documents that answer the most commonly asked
 questions about Perl and Perl programming.
 
+%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 perlfaq-%{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
 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}
+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
 %license LICENSE
 %doc Changes README
-%{perl_vendorlib}/*
-%{_mandir}/man3/*
+%{perl_vendorlib}/perlfaq*
+%{perl_vendorlib}/perlglossary*
+%{_mandir}/man3/perlfaq*
+%{_mandir}/man3/perlglossary*
+
+%files tests
+%{_libexecdir}/%{name}
 
 %changelog
+* Thu Nov 14 2024 Jitka Plesnikova <jplesnik@redhat.com> - 5.20210520-1
+- Resolves: RHEL-5538 - 5.20210520 bump
+- Package tests
+
 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 5.20201107-4
 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
   Related: rhbz#1991688
diff --git a/plans/sanity.fmf b/plans/sanity.fmf
new file mode 100644
index 0000000..a72ded4
--- /dev/null
+++ b/plans/sanity.fmf
@@ -0,0 +1,5 @@
+summary: Sanity tests
+discover:
+    how: fmf
+execute:
+    how: tmt
diff --git a/sources b/sources
index 78c0f1d..fe65f0a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (perlfaq-5.20201107.tar.gz) = 05cb71fd81fb88ea7f04c36d9d9f19759947e47141be729e24633e2a799256686aa1be276227965b988511b2f384bb03f5c489e9000e6880100c2cd6d08ffb38
+SHA512 (perlfaq-5.20210520.tar.gz) = cbd97e8bfcd30d7dd15d70ec85397953c546435aeb9ca34bcaa9e96f580282acded8c77aa91fe04c2fed66bd43214caf7df96568fad6daac9303db1e990acefb
diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf
new file mode 100644
index 0000000..fa273bd
--- /dev/null
+++ b/tests/upstream-tests.fmf
@@ -0,0 +1,11 @@
+summary: Upstream tests
+component: perl-perlfaq
+require: perl-perlfaq-tests
+test: /usr/libexec/perl-perlfaq/test
+enabled: true
+tag:
+  - rhel-buildroot
+adjust:
+  - enabled: false
+    when: distro < rhel-9 or distro < centos-stream-9
+    continue: false