Commit Graph

6366 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
2637a27cf2 various: fix typos
(cherry picked from commit 9e8658b887)
(cherry picked from commit 0fdcfd46a0)
2026-05-27 09:42:51 +01:00
Luca Boccassi
497d017241 machined: reject invalid class types when registering machines
Follow-up for fbe550738d

(cherry picked from commit 6df5f80bd3)
2026-03-12 12:13:02 +00:00
Zbigniew Jędrzejewski-Szmek
9e3b33ec51 TEST-07-PID1: add small test for LogExtraFields
(cherry picked from commit 18031b17f8)
2026-03-12 09:40:48 +01:00
Luca Boccassi
aec18f804c core: fix reloading multiple confexts at the same time
[] has higher precedence than pointer dereference, hence hilarity
ensues as soon as there are multuple images

Originally reported on yeswehack.com as:
YWH-PGM9780-122

Follow-up for dfdeb0b1cb

(cherry picked from commit 0c67b8adcb)
2026-03-12 09:40:48 +01:00
Cyrus Xi
710264949f core/cgroup: fix TasksMaxScale percentage serialization (#41011)
bus_cgroup_set_tasks_max_scale() used a hand-rolled percentage format
that produced values ~10x too small (e.g., "TasksMax=4.0%" instead of
"TasksMax=40.00%").

On daemon-reload, the incorrect value was re-read, silently reducing
the effective TasksMax by ~10x and causing fork rejections on systems
with high thread counts.

Fix by using the existing PERMYRIAD macros, consistent with memory
property handlers (MemoryMax, MemoryHigh, MemoryLow, etc.).

Fixes: #41009
(cherry picked from commit 9d15e09d5c)
2026-03-12 09:40:48 +01:00
Yu Watanabe
847abc5041 test-network: add test case for issue #40106
(cherry picked from commit f47d180b85)
2026-03-12 09:40:48 +01:00
Frantisek Sumsal
0a3a2ecd69 shared: don't exclude valid min/max values for cgroup weight fields
1 and 10000 are valid cgroup weight values, but the condition was
incorrectly excluding them:

$ echo '{"userName":"crashhostarray","cpuWeight":1}' | userdbctl -F -
<stdin>:1:42: JSON field 'cpuWeight' is not in valid range 1…10000.

$ echo '{"userName":"crashhostarray","cpuWeight":10000}' | userdbctl -F -
<stdin>:1:42: JSON field 'cpuWeight' is not in valid range 1…10000.

(cherry picked from commit 76ab7861ff)
2026-03-12 09:40:48 +01:00
Frantisek Sumsal
085e66276c nspawn: actually mask certain files under /proc/
/run/systemd/inaccessible/ exists only on host - in the container we have
/run/host/inaccessible/, and since all the inaccessible mounts have
MOUNT_IN_USERNS we need to use the latter one, otherwise the masking
gets silently skipped:

~# SYSTEMD_LOG_LEVEL=debug systemd-nspawn -q --directory=foo ls -la /proc/kallsyms
...
Bind-mounting /run/systemd/inaccessible/reg on /proc/kallsyms (MS_BIND "")...
Failed to mount /run/systemd/inaccessible/reg (type n/a) on /proc/kallsyms (MS_BIND ""): No such file or directory
Changing mount flags /proc/kallsyms (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND "")...
Failed to mount n/a (type n/a) on /proc/kallsyms (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND ""): Invalid argument
Bind-mounting /run/systemd/inaccessible/reg on /proc/kcore (MS_BIND "")...
Failed to mount /run/systemd/inaccessible/reg (type n/a) on /proc/kcore (MS_BIND ""): No such file or directory
Changing mount flags /proc/kcore (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND "")...
Failed to mount n/a (type n/a) on /proc/kcore (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND ""): Invalid argument
...
Inner child finished, invoking payload.
-r--r--r--. 1 root root 0 Feb 25 13:19 /proc/kallsyms

(cherry picked from commit 83b8daa032)
2026-03-12 09:40:48 +01:00
Luca Boccassi
90b7cb95d6 machined: do not allow unprivileged users to shell into the root namespace via varlink
Forbid non-root from shelling into a machine that is running in
the root user namespace.

Follow-up for adaff8eb35

(cherry picked from commit e5a5656b55)
2026-03-04 13:20:49 +00:00
Luca Boccassi
f11f356510 test: delete one more test artifact on shutdown
Hopefully fixes:

[  154.500726] TEST-13-NSPAWN.sh[4351]: + tar -C /var/tmp/mangletest/ -cvzf /var/tmp/mangletest.tar.gz mangletest-0.1
[  154.504485] TEST-13-NSPAWN.sh[5402]: mangletest-0.1/
[  154.506908] TEST-13-NSPAWN.sh[5402]: mangletest-0.1/usr/
[  154.508713] TEST-13-NSPAWN.sh[5402]: mangletest-0.1/usr/lib/
[  154.509208] TEST-13-NSPAWN.sh[5402]: mangletest-0.1/usr/lib/os-release
[  154.509877] TEST-13-NSPAWN.sh[4351]: + run0 --pipe -u testuser importctl -m --user import-tar /var/tmp/mangletest.tar.gz
[  154.693870] TEST-13-NSPAWN.sh[5405]: Enqueued transfer job 9. Press C-c to continue download in background.
[  154.696371] TEST-13-NSPAWN.sh[5405]: Image 'mangletest' already exists.

Fixes https://github.com/systemd/systemd/issues/40829

Follow-up for 4248b02c44

(cherry picked from commit 756f39c239)
2026-02-26 10:24:32 +00:00
Luca Boccassi
0f9f8c7804 test: move check for verity kernel keyring support to util.sh
(cherry picked from commit b9813d6c95)
2026-02-26 10:24:31 +00:00
Luca Boccassi
06a22ee919 test: do not fail TEST-86-MULTI-PROFILE-UKI if full TPM2 support not available
On a mkosi run on GHA:

[    9.547863] TEST-86-MULTI-PROFILE-UKI.sh[458]: + /usr/lib/systemd/systemd-measure --current
[    9.552790] TEST-86-MULTI-PROFILE-UKI.sh[463]: Measuring boot phases: enter-initrd, enter-initrd:leave-initrd, enter-initrd:leave-initrd:sysinit, enter-initrd:leave-initrd:sysinit:ready
[    9.553086] TEST-86-MULTI-PROFILE-UKI.sh[463]: Found container virtualization none.
[    9.553308] TEST-86-MULTI-PROFILE-UKI.sh[463]: Reading EFI variable /sys/firmware/efi/efivars/LoaderTpm2ActivePcrBanks-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
[    9.553486] TEST-86-MULTI-PROFILE-UKI.sh[463]: Loaded shared library 'libtss2-esys.so.0' via dlopen().
[    9.553676] TEST-86-MULTI-PROFILE-UKI.sh[463]: Loaded shared library 'libtss2-rc.so.0' via dlopen().
[    9.553867] TEST-86-MULTI-PROFILE-UKI.sh[463]: Loaded shared library 'libtss2-mu.so.0' via dlopen().
[    9.554050] TEST-86-MULTI-PROFILE-UKI.sh[463]: Sorry, system lacks full TPM2 support.
[FAILED] Failed to start TEST-86-MULTI-PROFILE-UKI.service - TEST-86-MULTI-PROFILE-UKI.

(cherry picked from commit 7112e4755e)
2026-02-26 10:24:31 +00:00
Yu Watanabe
a3cecbaf9b meson,test: sort unit files
(cherry picked from commit 6109cf8b61)
2026-02-26 10:24:31 +00:00
Daan De Meyer
282db4f37f mkosi: Remove some packages from the image
Let's slim down the image size a bit. None of the removed packages
should be required.

(cherry picked from commit 4e77671be7)
2026-02-26 10:24:31 +00:00
Daan De Meyer
a66721b879 TEST-72-SYSUPDATE: Use some very long partition names
To catch issues like https://github.com/systemd/systemd/issues/40658.
The commit that fixes that issue can make the name even longer to ensure
we don't regress again in this regard.

(cherry picked from commit 48f0f1fd81)
2026-02-26 10:24:31 +00:00
Mike Gilbert
43d2f85c43 meson: use printf instead of echo
The echo builtin provided by some shells (mksh) will interpret \x2d as
an escape sequence. This causes meson to fail:

```
test/fuzz/meson.build:93:52: ERROR: File fuzz-unit-file/dm-back-slash.swap does not exist.
```

Bug: https://bugs.gentoo.org/969789
(cherry picked from commit a304f6c9db)
2026-02-26 10:24:31 +00:00
Lennart Poettering
b1ce991244 test: bump disk sizes for some test cases
In my testing I switched building my locally run CI integration tests to
ArchLinux and realized that for that the default sizes don't work
anymore, the images are larger than the space allocated. Let's bump the
size by 50% for the relevant disk images.

(cherry picked from commit ab89fad427)
2026-02-26 10:24:31 +00:00
Lennart Poettering
d29a7cced5 tests: don't use "dd" to allocate empty files
Let's use truncate -s … to create empty files (if they can be sparse)

Let's use fallocate -l … to create empty non-sparse files.

This should reduce the disk footprint of our tests a bit, given that in
most cases we won't use the allocate disk space in full, not even
remotely.

(cherry picked from commit dd2676c1ab)
2026-02-26 10:24:31 +00:00
Cathy Hu
398122e3d1 journal-remote test: add -Z for mkdir in general
Otherwise on SELinux enabled systems with the "targeted" policy
the type is not set correctly when run via unconfined user and
the test fails.

(cherry picked from commit d3761f1509)
2026-02-26 10:24:31 +00:00
Lennart Poettering
1a89240670 pcrextend: fix varlink API to match what we actually take
(Change test case slightly, to ensure we don't regress on this)

(cherry picked from commit 823054d079)
2026-02-26 10:24:31 +00:00
Luca Boccassi
74c18638fd userdbd: avoid sending gshadow hash to unprivileged callers via varlink
Reported on yeswehack as YWH-PGM9780-59

Follow-up for d093b62c94

(cherry picked from commit 1012c6ce76)
2026-02-26 10:24:31 +00:00
Luca Boccassi
36afb086a1 core: validate ref_uid before checking in AttachProcesses method
ref_uid is initialized to invalid, and is only set in some
circumstances. The AttachProcesses will attempt to check it,
and assert that it is valid. Check beforehand.

Reported as YWH-PGM9780-89

Follow-up for 59857b672c

(cherry picked from commit 05f5156ad1)
2026-02-26 10:24:31 +00:00
Luca Boccassi
78129d7c82 portable: fix --force flag combination with directory extension
The check for image type uses the wrong variable, so it's applied
when it shouldn't.

Follow-up for 06768b90a3

(cherry picked from commit d07aa23c87)
2026-02-26 10:24:30 +00:00
Zbigniew Jędrzejewski-Szmek
5519fbbdbf udev-rules: downgrade error about non-system user/group in OWNER=/GROUP=
This reverts (in sprit) commit f5cdf9515a,
"udev-rules: ignore non-system user/group in OWNER=/GROUP=".

The original change was done to clean up a situation where we added a
new group, but the group could already have been used for some other
purposes, and now the some unexpected entity would own the device.
Unfortunately, this check doesn't really address the issue, since the
existing account might as well be a system account, which might be
equally bad. In addition, this change is a big compatiblity break,
causing existing rules to stop working. Since quite a lot of systems
have local configuration to assign devices to users for various
purposes, this is very noticable to users. In a way, the original change
to add a new group was the compat break, and follow-up patch to cahnge
the rule parsing evolved a small compat break into a much bigger one.
There is merit to the change though, since device nodes shouldn't be
owned by users and groups and different mechanisms should be used
instead. To avoid breaking users systems, and since the original goal
cannot be achieved by this patch, let's downgrade this to a warning
to guide users towards different solutions.

(cherry picked from commit 5c05a339c6)
2026-02-25 21:23:12 +00:00
Yu Watanabe
9fa74ea900 journal: check validity of PID field in syslog/kmsg earlier
Then, let's make syslog_parse_identifier() returns PID as pid_t, rather
than the string.

This also makes the function refuse ridiculously long identifier.

Fixes #40456.
Fixes oss-fuzz#477990732 (https://issues.oss-fuzz.com/issues/477990732).

(cherry picked from commit eb5b797d7c)
2026-02-06 14:29:11 +00:00
Nick Rosbrook
ce35956b3a test: disable pipefail again in monitor_check_rr()
Partially reverts d6b3793704.

On Ubuntu 26.04 devel, TEST-75-RESOLVED often fails at this stage,
despite the matching query apparently being found:

 + monitor_check_rr '2025-12-18 16:02:54' 'follow10.so.close.signed.test IN CNAME follow11.yet.so.far.signed.test'
  + set +x
  Dec 18 16:02:54 ns1.unsigned.test resolvectl[552]: ← A: follow10.so.close.signed.test IN CNAME follow11.yet.so.far.signed.test
 + monitor_check_rr '2025-12-18 16:02:54' 'follow11.yet.so.far.signed.test IN CNAME follow12.getting.hot.signed.test'
  + set +x
  Dec 18 16:02:54 ns1.unsigned.test resolvectl[552]: ← A: follow11.yet.so.far.signed.test IN CNAME follow12.getting.hot.signed.test
 + monitor_check_rr '2025-12-18 16:02:54' 'follow12.getting.hot.signed.test IN CNAME follow13.almost.final.signed.test'
  + set +x
  Dec 18 16:02:54 ns1.unsigned.test resolvectl[552]: ← A: follow12.getting.hot.signed.test IN CNAME follow13.almost.final.signed.test
 + monitor_check_rr '2025-12-18 16:02:54' 'follow13.almost.final.signed.test IN CNAME follow14.final.signed.test'
  + set +x
  Dec 18 16:02:54 ns1.unsigned.test resolvectl[552]: ← A: follow13.almost.final.signed.test IN CNAME follow14.final.signed.test

Unsetting pipefail, as was done before d6b3793704, appears to fix the
problem.

(cherry picked from commit 7c9c34514a)
2026-02-06 14:29:11 +00:00
Nick Rosbrook
a45dad1aa5 test: cope with uutils coreutils flag parsing for date command
With GNU coreutils, one can pass an argument to the "set" flag like:

 date -s "-3 days"

With uutils coreutils, that gives an error:

 error: unexpected argument '-3' found
    tip: to pass '-3' as a value, use '-- -3'

That's a bug (https://github.com/uutils/coreutils/issues/9679), but both
implementations accept --set="-3 days" just fine, so use that instead.

(cherry picked from commit 9dcfd6e8fe)
2026-02-06 14:29:10 +00:00
Nick Rosbrook
2c661e5f0d test: use journalctl -n option instead of piping to head
On Ubuntu's test infrastructure for the development series, this test
often fails when piping the journal output to head. The cause is
unclear, but possibly related to Ubuntu's use of uutils coreutils.

Workaround this by just using journalctl's -n flag, which removes the
need for piping output to head.

(cherry picked from commit a8efad14f8)
2026-02-06 14:29:10 +00:00
David Tardon
c68880a98b test: fix test with -Dnetworkd=false
User and group systemd-network are created from
sysusers.d/systemd-network.conf, which is only copied into the test
image when building with -Dnetworkd=true. This means that if
-Dnetworkd=false is used, the user and the group don't exist, which
causes the test to fail.

Use a locally created user and group to avoid that.

(cherry picked from commit a11278ce63)
2026-02-06 14:29:10 +00:00
Lennart Poettering
b6b0c83b8d test: perform /usr/share/ sysext unmount lazily
/usr/share/ is a directory commonly accessed by various tools, hence we
really should make sure we umount it lazily (MNT_DETACH), since
otherwise there's a good chance that the umount might simply fail.

I noticed this there:

https://github.com/systemd/systemd/actions/runs/21321690161/job/61372465563?pr=40446
(cherry picked from commit 2e38c56c73)
2026-02-06 14:29:10 +00:00
Yu Watanabe
758bba7844 integration tests: do not adjust log level of udevd in the test script
Similar to 5c60d3011f, but for udevd.

(cherry picked from commit 18de7dd90f)
2026-02-06 14:29:10 +00:00
Yu Watanabe
b5abfd890e mkfs-utils: also set $E2FSPROGS_FAKE_TIME if $SOURCE_DATE_EPOCH is set
Follow-up for 7bf0d0c46e.

To support e2fsprogs older than v1.47.1 (released 2024-05-21).

Suggested-by: ZauberNerd <zaubernerd@zaubernerd.de>
(cherry picked from commit 7d23749ddd)
2026-02-06 14:29:10 +00:00
ZauberNerd
b84c115f59 mkfs-util: set hash_seed to seed derived value for reproducibility
When creating ext2/ext3/ext4 filesystems, mke2fs generates a random
hash_seed for htree directory indexing. This causes non-reproducible
images even when SOURCE_DATE_EPOCH is set and the same filesystem UUID
is used.

Set the hash_seed explicitly to match the filesystem UUID, ensuring
that repeated builds with the same seed produce bit-for-bit identical
images.

Also add a test case in TEST-58-REPART to verify ext4 reproducibility
by creating the same partition twice and comparing the results.

See https://vdwaa.nl/mkosi-reproducible-arch-images.html

I used claude ai to help me with this change.

(cherry picked from commit 7bf0d0c46e)
2026-02-06 14:29:10 +00:00
Yu Watanabe
f399faf60a TEST-13-NSPAWN: remove pulled image on exit
Otherwise, if the VM is unexpectedly rebooted, then `importctl --user pull-tar`
may fail as the file may already exist.
```
[  123.351751] TEST-13-NSPAWN.sh[3946]: + run0 -u testuser importctl --user pull-tar file:///var/tmp/image-tar/kurps.tar.gz nurps --verify=checksum -m
[  123.541603] TEST-13-NSPAWN.sh[4311]: Enqueued transfer job 3. Press C-c to continue download in background.
[  123.552456] TEST-13-NSPAWN.sh[4311]: Pulling 'file:///var/tmp/image-tar/kurps.tar.gz', saving as 'nurps'.
[  123.552788] TEST-13-NSPAWN.sh[4311]: Operating on image directory '/home/testuser/.local/state/machines'.
[  123.819942] TEST-13-NSPAWN.sh[4311]: Got 1% of file:///var/tmp/image-tar/kurps.tar.gz.
[  124.156557] TEST-13-NSPAWN.sh[4311]: * shutting down connection #0
[  124.156896] TEST-13-NSPAWN.sh[4311]: * Could not open file /var/tmp/image-tar/kurps.tar.gz.sha256
[  124.157223] TEST-13-NSPAWN.sh[4311]: * closing connection #-1
[  124.159198] TEST-13-NSPAWN.sh[4311]: * Could not open file /var/tmp/image-tar/kurps.nspawn
[  124.159493] TEST-13-NSPAWN.sh[4311]: * closing connection #-1
[  124.159818] TEST-13-NSPAWN.sh[4311]: Acquired 68.5M.
[  124.160395] TEST-13-NSPAWN.sh[4311]: Download of file:///var/tmp/image-tar/kurps.tar.gz complete.
[  124.160664] TEST-13-NSPAWN.sh[4311]: Transfer failed: Could not read a file:// file
[  124.160923] TEST-13-NSPAWN.sh[4311]: Settings file could not be retrieved, proceeding without.
[  124.404733] TEST-13-NSPAWN.sh[4311]: * shutting down connection #1
[  124.405162] TEST-13-NSPAWN.sh[4311]: Acquired 79B.
[  124.406170] TEST-13-NSPAWN.sh[4311]: Download of file:///var/tmp/image-tar/SHA256SUMS complete.
[  124.406734] TEST-13-NSPAWN.sh[4311]: SHA256 checksum of file:///var/tmp/image-tar/kurps.tar.gz is valid.
[  124.455446] TEST-13-NSPAWN.sh[4311]: Failed to rename to final image name to /home/testuser/.local/state/machines/.tar-file:\x2f\x2f\x2fvar\x2ftmp\x2fimage-tar\x2fkurps\x2etar\x2egz: File exists
[  124.457251] TEST-13-NSPAWN.sh[4311]: Exiting.
```
Workaround for issue #38240.

(cherry picked from commit fc48bf0c6b)
2026-02-06 14:29:10 +00:00
Cathy Hu
99debe91cd journal-remote test: add -Z in mkdir for journal-{remote,upload}.conf.d
Otherwise on SELinux enabled systems with the "targeted" policy
the type is not set correctly when run via unconfined user and
the test fails.

(cherry picked from commit 57202fd181)
2026-02-06 14:29:10 +00:00
Zbigniew Jędrzejewski-Szmek
2c96c1f8fe TEST-46-HOMED: fix 2 minute timeout in cleanup
The test passes but for two minutes the cleanup function just logs:
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
...

Do not wait for the user to become inactive or remove the user if 'homectl
inspect' doesn't find the user. This brings a successfull run from 176 s
to 58 s here.

(cherry picked from commit 689391f8c8)
2026-02-06 14:29:10 +00:00
Luca Boccassi
404f798fb3 test: fix (again) race condition in TEST-80-NOTIFYACCESS
Even with the previous fix, it can still happen that pid1
sends SIGHUP to the script after 'sdnotify --ready' but before
'wait', so the test can still get stuck:

[ 2444.373448] reload-timeout.sh[158]: + set -o pipefail
[ 2444.373502] reload-timeout.sh[158]: + COUNTER=0
[ 2444.373590] reload-timeout.sh[158]: + trap sighup_handler SIGHUP
[ 2444.373639] reload-timeout.sh[158]: + export SYSTEMD_LOG_LEVEL=debug
[ 2444.373670] reload-timeout.sh[158]: + SYSTEMD_LOG_LEVEL=debug
[ 2444.373790] reload-timeout.sh[158]: + wait_for_signal 1
[ 2444.373871] reload-timeout.sh[158]: + local notify=1
[ 2444.373912] reload-timeout.sh[158]: + local p
[ 2444.374079] reload-timeout.sh[158]: + p=159
[ 2444.374123] reload-timeout.sh[159]: + sleep infinity
[ 2444.375358] systemd[1]: reload-timeout.service: Got notification message from PID 158: READY=1
[ 2444.375363] systemd[1]: reload-timeout.service: Changed start -> running
[ 2444.375368] systemd[1]: reload-timeout.service: Job 294 reload-timeout.service/start finished, result=done
[ 2444.375374] systemd[1]: Started reload-timeout.service.
[ 2444.375766] systemd[1]: reload-timeout.service: Failed to send unit change signal for reload-timeout.service: Connection reset by peer
[ 2444.376464] reload-timeout.sh[158]: + '[' 1 -eq 1 ']'
[ 2444.376464] reload-timeout.sh[158]: + systemd-notify --ready
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Job for reload-timeout.service finished.
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Got result done/Success for job reload-timeout.service.
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.376952] TEST-80-NOTIFYACCESS.sh[92]: + systemctl reload --no-block reload-timeout.service
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state UNSET → OPENING
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Executing dbus call org.freedesktop.systemd1.Manager ReloadUnit(reload-timeout.service, replace)
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 2444.379910] systemd-notify[160]: Notify message sent to '/run/systemd/notify': "READY=1"
[ 2444.379931] systemd-notify[160]: Notify message sent to '/run/systemd/notify': "BARRIER=1"
[ 2444.382218] systemd[1]: reload-timeout.service: Trying to enqueue job reload-timeout.service/reload/replace
[ 2444.382241] systemd[1]: reload-timeout.service: Installed new job reload-timeout.service/reload as 366
[ 2444.382248] systemd[1]: reload-timeout.service: Enqueued job reload-timeout.service/reload as 366
[ 2444.383905] systemd[1]: reload-timeout.service: Service has no extensions to reload.
[ 2444.384925] systemd[1]: reload-timeout.service: Changed running -> reload-signal
[ 2444.384935] systemd[1]: Reloading reload-timeout.service...
[ 2444.386410] reload-timeout.sh[158]: ++ sighup_handler
[ 2444.386410] reload-timeout.sh[158]: ++ echo hup1
[ 2444.386455] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.386555] TEST-80-NOTIFYACCESS.sh[92]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-signal" ]]; do sleep .5; done'
[ 2444.395566] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state UNSET → OPENING
[ 2444.395566] TEST-80-NOTIFYACCESS.sh[165]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 2444.396041] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 2444.396041] TEST-80-NOTIFYACCESS.sh[165]: Showing one /org/freedesktop/systemd1/unit/reload_2dtimeout_2eservice
[ 2444.401911] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 2444.401911] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.403806] TEST-80-NOTIFYACCESS.sh[92]: + sync_in hup1
[ 2444.403806] TEST-80-NOTIFYACCESS.sh[92]: + read -r x
[ 2444.403964] reload-timeout.sh[158]: + wait 159
[ 2444.403988] TEST-80-NOTIFYACCESS.sh[92]: + test hup1 = hup1
[ 2444.403988] TEST-80-NOTIFYACCESS.sh[92]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-notify" ]]; do sleep .5; done'

Try to check if the signal handler has ran by checking the counter,
and avoid waiting and immediately return if it has changed

Fixes https://github.com/systemd/systemd/issues/39581

Follow-up for 8fba2ed258

(cherry picked from commit 8d1e58f9fd)
2026-02-06 14:29:10 +00:00
Luca Boccassi
b6d30cdebd Revert "tests: run qemu with cpu_reset,guest_errors debug messages"
This reverts commit b169c7512c.

(cherry picked from commit 84079cd158)
2026-02-06 14:29:09 +00:00
Luca Boccassi
f91ed1dff8 Revert "tests: also add qemu shutdown trace debug logs to integration script"
This reverts commit 9b42cc3b12.

(cherry picked from commit d6514ebf33)
2026-02-06 14:29:09 +00:00
Luca Boccassi
b1bfc07500 Revert "integration-test: check tools distribution rather than image distribution"
This reverts commit fd2cdadc14.

(cherry picked from commit 293a925e9e)
2026-02-06 14:29:09 +00:00
Yu Watanabe
2411010149 test: use test-sleep executable in softreboot and coredump tests
This partially reverts 355bcc243c.

(cherry picked from commit 28826f6ba9)
2026-02-06 14:29:09 +00:00
Nick Rosbrook
1790788e94 test: check that currentServer field is set in resolvectl JSON status
(cherry picked from commit e06ee11150)
2026-02-06 14:29:09 +00:00
Yu Watanabe
dac716e083 journal/audit: do not use strjoina() for arbitrary length of received string
Otherwise, when a long message is received, the assertion in strjoina()
may be triggered.

Fixes oss-fuzz#476768320 (https://issues.oss-fuzz.com/issues/476768320).
Fixes #40388.

(cherry picked from commit 3d2284c7db)
2026-02-06 14:29:09 +00:00
Heran Yang
19fafd3ba9 core/unit: re-find dropin paths of a unit after writting settings
Fixes: ab932a622d ("core: simplify unit_need_daemon_reload() a bit")
Fixes #35710

Co-authored-by: Jian Wen <wenjianhn@gmail.com>
(cherry picked from commit c55aadc13e)
2026-02-06 14:29:09 +00:00
Yu Watanabe
a8c1405d3e core: do not provide non-dynamic user through DBus/Varlink
With a service with DynamicUser= with static user or group, e.g.,
```
$ systemd-run -p DynamicUser=yes -p Group=disk sleep infinity
```
previously the lookup by name and ID through DBus/Varlink are inconsistent:
```
$ busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByUID "u" 6
Call failed: Dynamic user ID 6 does not exist.

$ busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByName "s" disk
u 6

$ userdbctl group 6
  Group name: disk
 Disposition: system
         GID: 6
   Passwords: 1
     Service: io.systemd.NameServiceSwitch

$ userdbctl group disk
  Group name: disk
 Disposition: dynamic
         GID: 6
 Description: Dynamic Group
     Service: io.systemd.DynamicUser
```

With this change, the results of these methods are consistent.

Fixes #40228.

(cherry picked from commit cb39d66ec8)
2026-02-06 14:29:09 +00:00
Luca Boccassi
8fba2ed258 test: fix race condition in TEST-80-NOTIFYACCESS
In some cases systemd is faster to send the SIGHUP
than the script is to start the 'sleep' and background
it, so it never gets interrupted later and the test
is left hanging waiting for it.

[ 5028.410588] systemd[1]: Starting reload-timeout.service...
[ 5028.429544] reload-timeout.sh[165]: + set -o pipefail
[ 5028.429544] reload-timeout.sh[165]: + COUNTER=0
[ 5028.429841] reload-timeout.sh[165]: + trap sighup_handler SIGHUP
[ 5028.429841] reload-timeout.sh[165]: + export SYSTEMD_LOG_LEVEL=debug
[ 5028.429841] reload-timeout.sh[165]: + SYSTEMD_LOG_LEVEL=debug
[ 5028.429841] reload-timeout.sh[165]: + systemd-notify --ready
[ 5028.432891] systemd[1]: reload-timeout.service: Got notification message from PID 165: READY=1
[ 5028.432908] systemd[1]: reload-timeout.service: Changed start -> running
[ 5028.432983] systemd[1]: reload-timeout.service: Job 409 reload-timeout.service/start finished, result=done
[ 5028.432997] systemd[1]: Started reload-timeout.service.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Job for reload-timeout.service finished.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Got result done/Success for job reload-timeout.service.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.436949] TEST-80-NOTIFYACCESS.sh[99]: + systemctl reload --no-block reload-timeout.service
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state UNSET → OPENING
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Executing dbus call org.freedesktop.systemd1.Manager ReloadUnit(reload-timeout.service, replace)
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 5028.445202] reload-timeout.sh[165]: + wait_for_signal
[ 5028.445586] reload-timeout.sh[169]: + sleep infinity
[ 5028.447285] reload-timeout.sh[165]: ++ sighup_handler
[ 5028.447285] reload-timeout.sh[165]: ++ echo hup1
[ 5028.444886] systemd[1]: reload-timeout.service: Trying to enqueue job reload-timeout.service/reload/replace
[ 5028.445228] systemd[1]: reload-timeout.service: Installed new job reload-timeout.service/reload as 491
[ 5028.445240] systemd[1]: reload-timeout.service: Enqueued job reload-timeout.service/reload as 491
[ 5028.446601] systemd[1]: reload-timeout.service: Service has no extensions to reload.
[ 5028.446799] systemd[1]: reload-timeout.service: Changed running -> reload-signal
[ 5028.446881] systemd[1]: Reloading reload-timeout.service...
[ 5028.451343] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.452421] TEST-80-NOTIFYACCESS.sh[99]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-signal" ]]; do sleep .5; done'
[ 5028.460676] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state UNSET → OPENING
[ 5028.460676] TEST-80-NOTIFYACCESS.sh[172]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 5028.462029] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 5028.462029] TEST-80-NOTIFYACCESS.sh[172]: Showing one /org/freedesktop/systemd1/unit/reload_2dtimeout_2eservice
[ 5028.463759] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 5028.470322] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.472991] TEST-80-NOTIFYACCESS.sh[99]: + sync_in hup1
[ 5028.472991] TEST-80-NOTIFYACCESS.sh[99]: + read -r x
[ 5028.473839] reload-timeout.sh[165]: + wait 169
[ 5028.473996] TEST-80-NOTIFYACCESS.sh[99]: + test hup1 = hup1
[ 5028.473996] TEST-80-NOTIFYACCESS.sh[99]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-notify" ]]; do sleep .5; done'
[ 5038.477383] systemd[1]: TEST-80-NOTIFYACCESS.service: Failed with result 'exit-code'.

(note how the 'wait' is long after SIGHUP has been processed already)

Fixes https://github.com/systemd/systemd/issues/39581

Follow-up for ca8658120e
2025-12-17 18:41:59 +09:00
Mike Yuan
5a2340aeb3 core/exec-credential: fix credentials plain dir exchanging (#40108)
Follow-ups for #39637

Split out from #40093
2025-12-17 00:25:11 +01:00
Yu Watanabe
650fc62526 TEST-70-TPM2: re-enable tpm2-setup test on Alpine/postmarketOS
After 64b5c5f593, the test passes on
Alpine/postmarketOS.

This partially reverts 9fafe89bcc.
2025-12-16 21:10:12 +00:00
Mike Yuan
3602308480 TEST-54-CREDS: add test case for #40108 2025-12-16 21:28:19 +01:00
Lennart Poettering
64b5c5f593 test: prefer tests with PCR 16 over PCR 11
PCR 16 is intended for debugging purposes, and is the only PCR that can
be reset by software. Let's prefer that for testing.

PCR 11 has a purpose (i.e. kernel is measured there on UKI systems, as
are the boot phases), hence let's not use that for testing.

That should remove any interference of boot time ordering and testing
our tpm code, as we will write to PCR 16 only, and reset it before we
rely on it.

This likely, kind of fixes #39582, but the issue mixes two things, PCR
11 issues on real-life hardware, and PCR 11 isues in our artificial
tests. Only the latter is addressed by this PR, the other issue needs
more debugging, but without logs we cannot do much.
2025-12-16 22:28:10 +09:00