From 2df2d42a0b561162a14a1623256f83596aa6f339 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 14 Apr 2025 09:53:18 +0200 Subject: [PATCH] spec: build systemd-tests package As it's a hard requirement for the upstream integration test suite. Related: RHEL-79976 --- split-files.py | 3 +++ systemd.spec | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/split-files.py b/split-files.py index 8f7079f..fd9b7e2 100644 --- a/split-files.py +++ b/split-files.py @@ -68,6 +68,7 @@ outputs = {suffix: open(f'.file-list-{suffix}', 'w') 'devel', 'container', 'oomd', + 'tests', 'remote', 'resolve', 'main', @@ -101,6 +102,8 @@ for file in files(buildroot): o = outputs['pam'] elif '/rpm/' in n: o = outputs['rpm-macros'] + elif '/usr/lib/systemd/tests' in n: + o = outputs['tests'] elif 'ukify' in n: o = outputs['ukify'] elif re.search(r'/libsystemd-(shared|core)-.*\.so$', n): diff --git a/systemd.spec b/systemd.spec index bb47eaa..212823a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -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 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 %autosetup -S git @@ -950,7 +964,7 @@ CONFIGURE_OPTS=( -Dfirst-boot-full-preset=true -Ddefault-network=true -Dtests=unsafe - -Dinstall-tests=false + -Dinstall-tests=true -Dnobody-user=nobody -Dnobody-group=nobody -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 tests -f .file-list-tests + %clean rm -rf $RPM_BUILD_ROOT rm -f 10-timeout-abort.conf.user