Commit Graph

5622 Commits

Author SHA1 Message Date
Luca Boccassi
0ec19b311b test: add link to Ubuntu autopkgtest status page in README
Known issues will be listed there by the team managing the infra
2025-01-16 14:50:55 +01:00
Lennart Poettering
09fbff57fc pid1: add GracefulOptions= setting to .mount units
This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking compat,
but is generally be useful.
2025-01-15 21:05:06 +01:00
Lennart Poettering
ef5f72437e run0: allow explicit control of service manager activation for run0 sessions
This adds a new --lightweight=yes/no switch which allows controlling
whether the invoked service will have the service manager around or not.

Moreover, this changes that if the target user is root it will now
support to the lightweight mode, i.e. run0 towards root will no longer
pull in the service manager (a real tty login via getty still will
though!).

My thinking here is that quickly raising privileges via run0 probably
shouldn't be considered a proper login but just something short lived,
temporary for a single command or similar.
2025-01-15 17:03:21 +01:00
Lennart Poettering
cf8f6cd057 logind: introduce "user-light" session class
This new session class is to "user" what "background" is to
"background-light": it doesn't cause the per-user service manager to
start.

This new session class is now the default if no session class was
provided at session registration time and the following conditions hold:

1. The session is not graphical
2. The user is not a regular user (but not root)

Or in other words root and system users won't get a service manager
started automatically if they go through a PAM session as part of things
like cron or ftp. They will however still get one if they log in
graphically.

This changes behaviour a bit, but hopefully in OK was.

This also makes "background-light" for system users incl. root.

This addresses one of the ideas discussed in #34988.
2025-01-15 17:03:21 +01:00
Lennart Poettering
d2c7f8242b logind: register PAM sessions via Varlink instead of D-Bus (#35264)
This makes things a bit faster (because it cuts down a bit on
roundtrips) and prepares ground so that one day we can let logind run in
earlier boot already, making it a bit less special.

communication between logind and pid1 is still dbus only, hence there's
a lot of room for further improvement I guess.
2025-01-15 16:53:43 +01:00
Lennart Poettering
fc6192f52b machine: introduce io.systemd.MachineImage.SetPoolLimit (#35953)
This PR introduces io.systemd.MachineImage.SetPoolLimit method which is
alternative to DBus's SetPoolLimit.

This is last function for org.freedesktop.machine1 Dbus interface
2025-01-15 16:52:24 +01:00
Lennart Poettering
2baca6c22b logind: add basic Varlink API
For now this only covers CreateSession() and ReleaseSession(), i.e. the
two operations pam_systemd cares about.
2025-01-15 11:56:47 +01:00
Ivan Kruglov
4daecc8af5 machine: tests for io.systemd.MachineImage.SetPoolLimit 2025-01-15 02:47:58 -08:00
Daan De Meyer
ac75c51927 test: Drop sandbox() from integration test wrapper
With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.
2025-01-15 10:21:33 +01:00
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 b8582198ca
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 d87dc74e8f
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