spec: build systemd-tests package

As it's a hard requirement for the upstream integration test suite.

Related: RHEL-79976
This commit is contained in:
Frantisek Sumsal 2025-04-14 09:53:18 +02:00
parent 16940aab25
commit 2df2d42a0b
2 changed files with 20 additions and 1 deletions

View File

@ -68,6 +68,7 @@ outputs = {suffix: open(f'.file-list-{suffix}', 'w')
'devel', 'devel',
'container', 'container',
'oomd', 'oomd',
'tests',
'remote', 'remote',
'resolve', 'resolve',
'main', 'main',
@ -101,6 +102,8 @@ for file in files(buildroot):
o = outputs['pam'] o = outputs['pam']
elif '/rpm/' in n: elif '/rpm/' in n:
o = outputs['rpm-macros'] o = outputs['rpm-macros']
elif '/usr/lib/systemd/tests' in n:
o = outputs['tests']
elif 'ukify' in n: elif 'ukify' in n:
o = outputs['ukify'] o = outputs['ukify']
elif re.search(r'/libsystemd-(shared|core)-.*\.so$', n): elif re.search(r'/libsystemd-(shared|core)-.*\.so$', n):

View File

@ -892,6 +892,20 @@ systemd-oomd is a system service that uses cgroups-v2 and pressure stall
information (PSI) to monitor and take action on processes before an OOM information (PSI) to monitor and take action on processes before an OOM
occurs in kernel space. occurs in kernel space.
%package tests
Summary: Internal unit tests for systemd
Requires: %{name}%{_isa} = %{version}-%{release}
# This dependency is provided transitively. Also add it explicitly to
# appease rpminspect, https://github.com/rpminspect/rpminspect/issues/1231:
Requires: %{name}-libs%{_isa} = %{version}-%{release}
Requires: python3dist(psutil)
License: LGPL-2.1-or-later
%description tests
"Installed tests" that are usually run as part of the build system. They can be
useful to test systemd internals.
%prep %prep
%autosetup -S git %autosetup -S git
@ -950,7 +964,7 @@ CONFIGURE_OPTS=(
-Dfirst-boot-full-preset=true -Dfirst-boot-full-preset=true
-Ddefault-network=true -Ddefault-network=true
-Dtests=unsafe -Dtests=unsafe
-Dinstall-tests=false -Dinstall-tests=true
-Dnobody-user=nobody -Dnobody-user=nobody
-Dnobody-group=nobody -Dnobody-group=nobody
-Dcompat-mutable-uid-boundaries=true -Dcompat-mutable-uid-boundaries=true
@ -1382,6 +1396,8 @@ getent passwd systemd-oom &>/dev/null || useradd -r -l -g systemd-oom -d / -s /s
%files oomd -f .file-list-oomd %files oomd -f .file-list-oomd
%files tests -f .file-list-tests
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
rm -f 10-timeout-abort.conf.user rm -f 10-timeout-abort.conf.user