1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-31 05:47:30 +03:00

5613 Commits

Author SHA1 Message Date
Sea-Eun Lee
015a3b8cb1 oomd: support reloading configuration at runtime 2025-01-14 14:42:23 +01:00
Daan De Meyer
3c2fa8e050 fmf: Only move logs if corresponding directory exists
Otherwise find fails with an error.
2025-01-14 12:07:53 +01:00
Daan De Meyer
1d77ac19cf test: Only move journal file if we didn't just unlink it 2025-01-14 10:21:45 +01:00
Daan De Meyer
79ac78e368 test: Fix bug in integration test wrapper 2025-01-13 11:06:37 +01:00
Daan De Meyer
e0c2fd6a33 fmf: Skip TEST-21-DFUZZER
Similar to Github Actions, since we don't build with sanitizers in
the packit job, let's skip TEST-21-DFUZZER.
2025-01-10 16:14:01 +01:00
Daan De Meyer
53546c71fe fmf: Use different heuristic on beefy systems
If we save journals in /tmp, we can run a larger number of tests in
parallel so let's make use of the larger number of CPUs if the tests
run on a beefy machine.
2025-01-10 16:14:01 +01:00
Daan De Meyer
c32a8cdaa0 fmf: Bump inotify limits to avoid systemd-nspawn failures 2025-01-10 16:14:01 +01:00
Daan De Meyer
1f17ec0ed4 test: Move StateDirectory= directive into dropin
The integration-test-setup calls require StateDirectory= but some
tests override the test unit used which then won't have StateDirectory=
so let's move StateDirectory= into the dropin as well to avoid this
issue.
2025-01-10 16:14:01 +01:00
Daan De Meyer
84b30442d2 test: Don't register machines with machined unless we're in interactive mode 2025-01-10 16:14:01 +01:00
Daan De Meyer
e49fdecd16 test: Add option to save in progress test journals to /tmp
The journal isn't the best at being fast, especially when writing
to disk and not to memory, which can cause integration tests to
grind to a halt on beefy systems due to all the systemd-journal-remote
instances not being able to write journal entries to disk fast enough.

Let's introduce an option to allow writing in progress test journals
to use /tmp which can be used on beefy systems with lots of memory to
speed things up.
2025-01-10 16:13:58 +01:00
Daan De Meyer
96403d5121 tree-wide: Fix python formatting
The new release of ruff formats a few more things which causes linter
failures in CI so let's fix those formatting nits.
2025-01-10 14:58:56 +09:00
Yu Watanabe
ac27ee5fcb
fmf: Move meson logs and failed test journals to test artifacts dir (#35939) 2025-01-10 14:57:57 +09:00
Daan De Meyer
8965d57f4b fmf: Use one fewer than number of available CPUs again
This effectively reverts b8582198ca1e6fe390f7169e623a9130b68a6b36
as I can not get the testing farm bare metal machines working
downstream and even if I managed to, without also using the testing
farm bare metal machines upstream (for which there is no capacity),
the setup would very quickly bitrot anyway so we'll just run the
container based tests for now.
2025-01-09 15:45:41 +01:00
Daan De Meyer
6e761c5a93 fmf: Log clock source 2025-01-09 15:24:51 +01:00
Daan De Meyer
0e444c948e fmf: Move meson logs and failed test journals to test artifacts dir 2025-01-09 15:13:18 +01:00
Lennart Poettering
c0041cd8f1
pam: add session class "none" to disable logind sessions (#35171)
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.

---

Closes: #34988
2025-01-09 14:08:06 +01:00
Daan De Meyer
606034cc1e
machine: introduce io.systemd.Machine.OpenRootDirectory method (#35880)
This PR introduces io.systemd.Machine.OpenRootDirectory method which is
DBus's alternative to OpenMachineRootDirectory.
2025-01-09 13:06:38 +01:00
Daan De Meyer
103e92810a mkosi: Re-enable TEST-21-DFUZZER when running with sanitizers
Similar to how CentOS CI did it previously, let's only run
TEST-21-DFUZZER when built with sanitizers for maximum effect.
2025-01-09 11:48:23 +00:00
Daan De Meyer
c286e8b616
Two integration test fixes (#35937) 2025-01-09 12:25:41 +01:00
Daan De Meyer
e1c883bf32 fmf: Force SELinux relabel when running within testing farm
We expect to run as root within testing farm and to have permissions
to do selinux relabelling so let's enable it explicitly.
2025-01-09 11:59:34 +01:00
Daan De Meyer
de19520ec9 TEST-06-SELINUX: Add knob to allow checking for AVCs
When running the integration tests downstream, it's useful to be
able to test that a new systemd version doesn't introduce any AVC
denials, so let's add a knob to make that possible.
2025-01-09 11:59:30 +01:00
Daan De Meyer
794d456cf4 test: Only plug in integration-test-setup.sh in interactive mode
If we're not running interactively, there's no point in the features
from integration-test-setup.sh which are intended for interactive
development and debugging so lets skip adding it in that case.
2025-01-09 11:28:15 +01:00
Daan De Meyer
90538ede55 test: Drop set -x from integration-test-setup.sh 2025-01-09 11:27:51 +01:00
Ivan Kruglov
3ddd3adfcd machine: tests for io.systemd.Machine.OpenRootDirectory 2025-01-09 10:51:18 +01:00
Yu Watanabe
cdd53cb74b sd-device: make sd_device_new_from_path() accept relative path to device node
Even though udevadm accepts relative syspath, previously, udevadm
could not use relative path to device node:
===
$ cd /dev
$ udevadm info sda
Bad argument "sda", expected an absolute path in /dev/ or /sys/ or a unit name: Invalid argument
$ udevadm info /usr/../dev/sda
Unknown device "/usr/../dev/sda": No such device
===
With this change, both the above cases work fine.

Note, still sd_device_new_from_devname() requires absolute path starts
with /dev/, for safety.
2025-01-09 09:57:19 +01:00
Daan De Meyer
b8582198ca fmf: Use different heuristic for number of process with many CPUs
Downstream we sometimes end up with machines with lots of CPUs which
leads to running out of memory when trying to run the tests in VMs.
So let's switch to a different heuristic when we have lots of CPUs to
avoid running out of memory.
2025-01-09 09:15:18 +01:00
Lennart Poettering
0ee1171cbb
nsresource: optionally mangle userns names passed to nsresourced (#35900)
We enforce quite strict rules on naming userns we assign uid ranges to
for users. So strict that they are hard to get right for clients. hence,
let's optionally mangle provided strings so that they work for us.

This should make it much easier to work with the API, as something
reasonable happens regarldess what kind of garbage a client sets as
name.

mangling the name is opt-in for clients, so that there's tight control
for the client on the name, but also "fire and forget".
2025-01-08 21:36:37 +01:00
Lennart Poettering
a241b796fa
pid1: allow removal of foreign-owned subcgroups of cgroups owned by some user (#35922)
This improves operation in unprivileged userns environments, where
unpriv user code might invoke a container with a delegated userns UID
range, and thus ends up with a subcgroup owned by another UID. With this
patch any user is always allowed to remove their own cgroups even if it
has subcgroups owned by other users.

This removes a DoS of sorts, and enforces the rule that users strictly
own everything below cgroups they own.
2025-01-08 21:36:16 +01:00
Daan De Meyer
44368f84d7 fmf: Dump CPU and memory information 2025-01-08 21:14:58 +01:00
Lennart Poettering
1d5fd2e621 test: add testcase that verifies we can safely delete subcgroups owned by other users if we own the parent
This is a test for the previous commits: we create an unpriv, delegated cgroup in
--user mode, then create a subcgroup that is owned by some other user
(to mimic the case where an unpriv user got a userns with delegated UIDs
assigned), and then try to stop the unit. traditionally this would fail,
because our unpriv systemd --user instance can't remove the subcrroup
owned by someone else. With the earlier patches this is addressed.
2025-01-08 15:27:25 +01:00
Lennart Poettering
a73ddc7182 test: make sure the userns long name mangling codepaths are tested 2025-01-08 15:12:02 +01:00
Daan De Meyer
8e3347f3bd fmf: Only mess with /etc/yum.repos.d when running within testing farm
If running tmt locally to debug the test script, make sure we don't
mess with /etc/yum.repos.d.
2025-01-08 13:37:23 +01:00
Daan De Meyer
fc1b08dee2 fmf: Fix glob
Globs inside quotes aren't expanded and we need the glob to be more
specific to avoid matching multiple entries inside the tmt source
directory.
2025-01-08 11:15:43 +01:00
Daan De Meyer
0a85b37579 fmf: Fix dist-git example
All that's needed is dist-git-source: true so remove the other settings
that aren't required.
2025-01-08 10:25:50 +01:00
Daan De Meyer
0250db0139 fmf: Don't fail if we can't put selinux in permissive mode
The tests might be running unprivileged or in an environment without
selinux so let's not fail if we can't put it in permissive mode.
2025-01-08 10:25:05 +01:00
Lennart Poettering
0dfd89fa32
udev: introduce io.systemd.Udev varlink interface (#35721)
Replaces #25523.
2025-01-07 16:49:37 +01:00
Daan De Meyer
3c9ffd2e4b fmf: Check out target branch in packit 2025-01-07 15:27:19 +01:00
Luca Boccassi
f2b34ce7f3 test: add test case for AddDependencyUnitFiles assert
Follow-up for d87dc74e8f1a30d72a0f202e411400bab34ab55a
2025-01-07 11:35:03 +00:00
Yu Watanabe
d5c4c4d45c TEST-17-UDEV: wait for udevd being restarted after exit control command
Also wait for created devices being processed before running tests.
2025-01-07 20:31:15 +09:00
Daan De Meyer
2144b5dccf
machine: introduce io.systemd.Machine.{CopyFrom, CopyTo} methods (#34913)
This PR introduces io.systemd.Machine.CopyFrom and CopyTo method which
are DBus alternatives of:
- CopyFromMachine
- CopyToMachine
- CopyFromMachineWithFlags
- CopyToMachineWithFlags

The PR also contain tests
2025-01-06 23:16:33 +01:00
Luca Boccassi
861d0c081a
tree-wide: drop references to CentoS/RHEL 7 and 8 (#35881) 2025-01-06 18:38:05 +00:00
Yu Watanabe
220f7aac8c test-network: drop workaround for old CentOS release 2025-01-07 02:06:04 +09:00
Yu Watanabe
1761c35275 test-network: nowadays it runs not only on CentOS 2025-01-07 02:06:04 +09:00
Daan De Meyer
0eb7e29dfb fmf: Support being used downstream in dist-git tests
We can use our upstream fmf definitions to run downstream tests in
the Fedora systemd dist-git repository
(https://src.fedoraproject.org/rpms/systemd). To have access to the
dist-git sources when running the tests, we enable dist-git-source: true
downstream which makes the sources available in $TMT_SOURCE_DIR so
let's make sure we use those sources if they're available.
2025-01-06 16:30:23 +01:00
Daan De Meyer
9e76e9c9dc fmf: Insist on mkosi sha being available
Let's assume the workflow file containing the mkosi always being
available.

Also fix the detection while we're at it by not leaving the systemd
directory.
2025-01-06 16:29:28 +01:00
Ivan Kruglov
825fff7fac machine: move io.systemd.Machine.Map* tests into right position 2025-01-06 14:51:57 +01:00
Ivan Kruglov
24b7e0b894 machine: tests for io.systemd.Machine.{CopyFrom, CopyTo} methods 2025-01-06 14:51:57 +01:00
Daan De Meyer
28baef47a3 mkosi: Migrate more deprecated options 2025-01-06 12:07:53 +01:00
Daan De Meyer
b0b88f18b3 packit: Move fmf metadata into upstream
This moves https://src.fedoraproject.org/tests/systemd into upstream
so it's one less moving piece that we need to remember. While we're at
it, do various cleanups as well:

- Remove non-packit logic
- Set NO_BUILD in mkosi.local.conf as it's not picked up from the
  process environment
- Don't set unused environment variables
- Remove workdir logic as we run in an ephemeral VM already
- Drop --verbose from meson test to reduce noise
  from passed tests
- Use mkosi sandbox and drop duplicated deps from metadata file
- Stop running the unit tests as they already run as part of the rpm
  build and as part of the integration tests.
- Various style fixes
2025-01-05 23:21:36 +01:00
Daan De Meyer
c008b70370 mkosi: Update to latest 2025-01-05 21:18:32 +01:00