1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

3431 Commits

Author SHA1 Message Date
Luca Boccassi
28f3cbbded
Merge pull request #26734 from mrc0mmand/test-followups
Assorted test tweaks
2023-03-10 00:03:48 +00:00
Luca Boccassi
d56391b40f
Merge pull request #26731 from yuwata/mempressure-follow-ups
Mempressure follow ups
2023-03-09 22:35:29 +00:00
Lennart Poettering
a617007417 mempress: change default PSI window duration to 2s
This changes the PSI window duration we default to for watching memory
pressure events from 1s to 2s. This is because apparently the kernel
will soon disallow window durations other than 2s for unprivileged
processes.

Hence, we'll bump the threshold from 100m to 200ms, and the window from
1s to 2s.
2023-03-09 22:31:20 +01:00
Yu Watanabe
054749e413 core: add missing MemoryPressureWatch= and MemoryPressureThresholdSec= setting
Follow-up for #26393.

Addresses https://github.com/systemd/systemd/pull/26393#issuecomment-1458655798.
2023-03-09 23:43:04 +09:00
Frantisek Sumsal
715b4c26dc test: fall back to /sys/fs/cgroup/systemd if necessary
Necessary for some CI setups where we boot an nspawn container on a host
with older systemd with legacy hierarchy, so systemd mounts its stuff
under /sys/fs/cgroup/systemd.
2023-03-09 15:27:48 +01:00
Frantisek Sumsal
b3ba7d6274 test: force mkfs.btrfs to overwrite any existing file systems
mkfs.btrfs (unlike mkfs.ext4) checks if the target already contains
a file system and refuses to continue if so. This causes spurious fails
in case the random garbage on the temporary device matches a valid FS
header:

[   19.723806] testsuite-64.sh[355]: + udevadm lock --device=/dev/mapper/encbtrfs0 --device=/dev/mapper/encbtrfs1 --device=/dev/mapper/encbtrfs2 --device=/dev/mapper/encbtrfs3 mkfs.btrfs -M -d raid1 -m raid1 -L btrfs_mencdisk -U deadbeef-dead-dead-beef-000000000003 /dev/mapper/encbtrfs0 /dev/mapper/encbtrfs1 /dev/mapper/encbtrfs2 /dev/mapper/encbtrfs3
[   19.918934] testsuite-64.sh[2494]: ERROR: /dev/mapper/encbtrfs0 appears to contain an existing filesystem (hfsplus)
[   19.920490] testsuite-64.sh[2494]: ERROR: use the -f option to force overwrite of /dev/mapper/encbtrfs0

Let's force mkfs.btrfs to overwrite the file system in such case.
2023-03-09 13:50:15 +01:00
Frantisek Sumsal
cca295ab7a test: don't fail if we can't remove the scsi_debug module
Let's make the cleanup 'best effort' operation, as sometimes we might
not be able to remove the scsi_debug module, and we don't really care
if it stays loaded:

[   88.521333] testsuite-17.sh[1827]: ID_TEST=test
[   88.522015] testsuite-17.sh[1679]: + rmmod scsi_debug
[   88.524795] testsuite-17.sh[1828]: rmmod: ERROR: Module scsi_debug is in use
[   88.527786] testsuite-17.sh[1679]: + cleanup_17_10
2023-03-09 13:32:56 +01:00
Frantisek Sumsal
72f6d0e556 test: bump the D-Bus related timeouts to 120s
Let's attempt to reduce the amount of flakes further when the AWS region
we run in is under heavy load and the hypervisor stars stealing our CPU
time.

Follow-up to e0cbb73911 and c78d18215b.
2023-03-09 13:27:57 +01:00
Frantisek Sumsal
15eda898af test: ignore busctl tree fails
As the test runs during machine bootup where jobs run in parallel,
busctl might attempt to introspect a job that already finished and fail.
Since in this case we're more interested in crashes/leaks, let's ignore
the exit code.

Follow-up to 16600a8661.
2023-03-09 11:34:14 +01:00
Zbigniew Jędrzejewski-Szmek
ba0e70673c
Merge pull request #26038 from lilyinstarlight/fix/fstab-generator-sysroot-without-cmdline
fstab-generator: use correct targets when /sysroot is specificied in fstab only
2023-03-09 08:51:31 +01:00
Dmitry V. Levin
b27e5e2aca udev_rules_parse_file: issue diagnostics about line continuation at EOF
When udev rules file ends with a line continuation, the parser
used to silently ignore the line without any diagnostics at all.
It's time to break the vow of silence and let the parser issue some
error diagnostics.
2023-03-08 18:55:40 +00:00
Dmitry V. Levin
5040401b43 test: check udevadm verify diagnostics of unused labels 2023-03-08 18:55:40 +00:00
Dmitry V. Levin
45183cdd6d test: add a test for udevadm verify 2023-03-08 18:55:40 +00:00
Frantisek Sumsal
bb076d77f4 test: add a couple of tests for systemd-id128 2023-03-08 16:28:37 +01:00
Frantisek Sumsal
c38cad7aea test: add a couple of tests for systemd-escape 2023-03-08 16:28:37 +01:00
Frantisek Sumsal
16600a8661 test: add a couple of tests for busctl 2023-03-08 12:53:44 +09:00
Lennart Poettering
4601243375 test: add test for new /sbin/mount.ddi helper 2023-03-06 22:54:52 +01:00
Yu Watanabe
25e12db5e4
Merge pull request #26650 from yuwata/udev-trigger
test: generate debugging logs for udevd after restart
2023-03-06 16:36:34 +09:00
Yu Watanabe
af766bb844 test: trigger new events after all currently queued events are processed
Otherwise, udevd may be busy and udevadm may not receive the reply
for the control packet within the time limit.
2023-03-03 23:25:01 +09:00
Lennart Poettering
16a9ad557d
Merge pull request #26355 from poettering/journal-no-rtc
journald: support ordering journal entries by boot ID if no RTC is available
2023-03-03 13:13:13 +01:00
Yu Watanabe
b6b5135e66 test: generate debugging logs for udevd after restart 2023-03-03 19:48:40 +09:00
Michal Koutný
edd84b8e4b meson: Copy files with git only in true git repository
When mkosi is run from git-worktree(1), the .git is not a repository
directory but a textfile pointing to the real git dir
(e.g. /home/user/systemd/.git/worktrees/systemd-worktree). This git dir
is not bind mounted into build environment and it fails with:

> fatal: not a git repository: /home/user/systemd/.git/worktrees/systemd-worktree
> test/meson.build:190:16: ERROR: Command `/usr/bin/env -u GIT_WORK_TREE /usr/bin/git --git-dir=/root/src/.git ls-files ':/test/dmidecode-dumps/*.bin'` failed with status 128.

There is already a fallback to use shell globbing instead of ls-files,
use it with git worktrees as well.
2023-03-02 15:04:40 +00:00
Lennart Poettering
4601c7aa8f test: add test for journals without RTC
This adds a test for checking we can safely order boot IDs via the
timestamp of their most recent known entry. It takes a set of journal
files (supplied by a user) and that are partially corrupted, and ensures
we get a clear, defined order of boot IDs out of it.
2023-03-02 10:18:24 +01:00
Frantisek Sumsal
90169eb92a test: a couple of format-related tweaks 2023-03-01 17:53:55 +01:00
Frantisek Sumsal
ea91b45e0e test: skip the hwdb update related tests w/ sanitizers and w/o accel
systemd-hwdb update is an expensive operation by itself, and when
running with sanitizers and in a VM without acceleration this cost is
exacerbated even further, making the test run for a very long time.

For example, in the daily CentOS CI ppc64le job with ASan+UBSan one
systemd-hwdb update takes more than 7 minutes; in the regular Arch job
with KVM it takes over 2 minutes.

Since the hwdb update is also tested in other places (like
TEST-01-BASIC and the test-hwdb meson test), let's skip it if we detect
we run with sanitizers and with plain QEMU.
2023-03-01 17:53:55 +01:00
Lennart Poettering
3b7101183c test: add test for the new memory pressure unit file settings, and that they work 2023-03-01 09:43:24 +01:00
Lennart Poettering
d7fce219ae test: test setting ambient caps via pam_systemd.so 2023-02-28 21:42:29 +01:00
David Tardon
95cf8cae77 test: add coverage test for udevadm 2023-02-27 07:22:20 +09:00
Luca Boccassi
f50535afad analyze: add 'malloc' verb to dump malloc_info()
Gets the memory state of the manager:

root@image:~# systemd-analyze malloc
<malloc version=1>
<heap nr=0>
<sizes>
  <size from=33 to=33 total=396 count=12/>
  <unsorted from=20385 to=20385 total=20385 count=1/>
</sizes>
<total type=fast count=0 size=0/>
<total type=rest count=14 size=36589/>
<system type=current size=1691648/>
<system type=max size=1839104/>
<aspace type=total size=1691648/>
<aspace type=mprotect size=1691648/>
</heap>
<total type=fast count=0 size=0/>
<total type=rest count=14 size=36589/>
<total type=mmap count=0 size=0/>
<system type=current size=1691648/>
<system type=max size=1839104/>
<aspace type=total size=1691648/>
<aspace type=mprotect size=1691648/>
</malloc>
2023-02-23 18:59:06 +00:00
Yu Watanabe
752e92615d test-execute: add test for PrivateNetwork= with/without mount namespacing 2023-02-23 15:09:13 +09:00
Frantisek Sumsal
6299b6e5e6 test: add coverage for #24177
Original issue: https://bugzilla.redhat.com/show_bug.cgi?id=1985288
2023-02-23 04:52:46 +09:00
Daan De Meyer
4d8ff4e868 repart: Exclude APIVFS mountpoint directories
Also exclude APIVFS and temporary files directories from the copy
operation so that these files don't accidentally end up in images.
2023-02-22 12:44:39 +01:00
Daan De Meyer
b63bd125d4 copy: Support both inode exclusion and contents exclusion
In some cases, we want to exclude a directory's contents but not
the directory itself. In other cases, we want to exclude a directory
and its contents. Let's extend the denylist logic in copy.h to support
both by changing the denylist from a set to hashmap so we can store the
deny type as the value.

We also modify the repart ExcludeFiles= option to make use of this. If
a directory to exclude ends with a "/", we'll only exclude its contents.
Otherwise, we'll exclude the full directory.
2023-02-22 12:44:36 +01:00
Yu Watanabe
a2e41b817b test: add another stress test for devlink creation 2023-02-22 19:08:26 +09:00
Yu Watanabe
60c5bd7759 tree-wide: fix typo 2023-02-22 14:46:19 +09:00
Yu Watanabe
086234e39b
Merge pull request #26491 from dtardon/list-paths
Add systemctl list-paths
2023-02-22 09:29:54 +09:00
Yu Watanabe
a06f85a073
Merge pull request #26527 from mrc0mmand/more-tests
test: provide coverage for #26467 and #26483
2023-02-22 08:01:07 +09:00
Aidan Dang
d59025698f Enable TPM by default with SetCredentialEncrypted 2023-02-21 21:07:02 +01:00
Frantisek Sumsal
adae3552f0 test: add coverage for #26483 2023-02-21 19:39:52 +01:00
Frantisek Sumsal
4190124b3c test: add coverage for #26467 2023-02-21 19:39:52 +01:00
David Tardon
a2ceb88005 test: add a minimal test for list-paths 2023-02-21 19:03:26 +01:00
Daan De Meyer
6c53840958
Merge pull request #26518 from DaanDeMeyer/mkosi-stuff
mkosi: Drop build script workarounds
2023-02-21 18:23:06 +01:00
Lennart Poettering
c56be2c294 bootctl: add new --print-root-device option
We already have this nice code in system that determines the block
device backing the root file system, but it's only used internally in
systemd-gpt-generator. Let's make this more accessible and expose it
directly in bootctl.

It doesn't fit immediately into the topic of bootctl, but I think it's
close enough and behaves very similar to the existing "bootctl
--print-boot-path" and "--print-esp-path" tools.

If --print-root-device (or -R) is specified once, will show the block device
backing the root fs, and if specified twice (probably easier: -RR) it
will show the whole block device that block device belongs to in case it
is a partition block device.

Suggested use:

        # cfdisk `bootctl -RR`

To get access to the partition table, behind the OS install, for
whatever it might be.
2023-02-21 18:19:38 +01:00
Daan De Meyer
01a0756427 mkosi: Move more logic to the postinst script
Let's move stuff that only applies to the final image to the
postinst script. Let's also move out some of the static files to
mkosi.extra/ instead of hardcoding them in scripts.
2023-02-21 15:20:18 +01:00
Yu Watanabe
53b3512f9c
Merge pull request #26499 from mrc0mmand/assorted-tweaks
A couple of test tweaks for recent CI fails
2023-02-21 05:55:37 +09:00
Daan De Meyer
0cd90cf4f3
Merge pull request #26437 from DaanDeMeyer/repart-exclude
repart: Add ExcludeFiles= option
2023-02-20 15:49:29 +01:00
Daan De Meyer
a9af827613 repart: Add ExcludeFiles= option 2023-02-20 13:51:46 +01:00
Frantisek Sumsal
85cce734c9 test: ignore missing coverage in TEST-78
gcov is incompatible with DynamicUser=true without additional tweaks, so
let's ignore its complaints in this test, as working around it is not
worth it (in this case).
2023-02-20 10:50:06 +01:00
Frantisek Sumsal
27c814666f test: disable pipefail when testing interactive firstboot
Otherwise we might get unexpected test fails due to SIGPIPE:

```
[   14.334917] testsuite-74.sh[565]: + grep -q '^root:.*:0:0:.*:/bin/fooshell$' test-root/etc/passwd
[   14.335670] testsuite-74.sh[681]: + systemd-firstboot --root=test-root --prompt-root-shell
[   14.336382] testsuite-74.sh[680]: + echo -ne '\n/bin/barshell\n'
[   14.336980] testsuite-74.sh[680]: .//usr/lib/systemd/tests/testdata/units/testsuite-74.firstboot.sh: line 166: echo: write error: Broken pipe
```
2023-02-20 10:48:32 +01:00
Lennart Poettering
dd131fcf8c test: add test for new "systemctl --kill-value=" functionality
(as side-effect this also tests the new systemd-notify --exec switch)
2023-02-17 09:55:35 +01:00