1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-09 12:58:26 +03:00

3475 Commits

Author SHA1 Message Date
Frantisek Sumsal
aadbd81f7f test: add a couple of tests for systemd-coredump 2023-03-24 11:56:33 +01:00
Zbigniew Jędrzejewski-Szmek
2f809d29e8 test-coredump-util: add tests for parse_aux()
The test files are /proc//auxv files copies from various architecutres
signified by the file name suffix.

Those tests are fairly simple, but when we run them on n architectures, we do
~n² cross-arch tests.
2023-03-23 18:06:46 +01:00
Mike Yuan
f1710073c7
Merge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccess
core: support overriding NOTIFYACCESS= through sd-notify during runtime
2023-03-24 00:11:29 +08:00
Mike Yuan
b64f5ddaca
test: add tests for NOTIFYACCESS override through sd_notify 2023-03-22 19:22:10 +08:00
Thomas Blume
c5ba7a2a4d udev-rules: fix nvme symlink creation on namespace changes
The nvme by-id symlink changes to the latest namespace when a new namespace gets
added, for example by connecting multiple NVMe/TCP host controllers via nvme
connect-all.
That is incorrect for persistent device links.
The persistent symbolic device link should continue to point to the same NVMe
namespace throughout the lifetime of the current boot.
Therefore the namespace id needs to be added to the link name.
2023-03-21 15:46:45 +01:00
Dmitry V. Levin
f0a16c9ae8 udev-rules: add another check for conflicting expressions
Log an error when a rule line contains the following kind of conflicting
match expressions:

  KEY=="foo", KEY=="bar"
2023-03-21 09:34:50 +09:00
Dmitry V. Levin
5004aa84ac udev-rules: fix check for conflicting and duplicate expressions
Fix check for conflicting and duplicate expressions of types that
support alternative patterns.

Fixes: 3ec58d0cd8f6 ("udev-rules: check for conflicting and duplicate expressions")
2023-03-19 11:32:09 +00:00
Yu Watanabe
458e8d6dd0 test-systemd-tmpfiles.py: create global temporary directory
For some unknown reasons, the temporary directory created by the test
below is not removed:
```
 # Test the case that a valid symlink is in the path.
 label = 'valid_symlink-deep'
 test_content('f= {} - - - - ' + label, label, user=user, subpath='/deep/1/2', path_cb=valid_symlink)
```
To keep /tmp clean, let's create the global temprary directory.
2023-03-18 22:27:41 +09:00
Yu Watanabe
015ddd4bf0 test-systemd-tmpfiles.py: use test_content() at one more place 2023-03-18 22:27:41 +09:00
Daan De Meyer
6742397921
Merge pull request #26783 from yuwata/loop-ref-follow-up
udev: slightly extend comment and add more tests
2023-03-17 10:00:43 +01:00
Yu Watanabe
77c6bb895a
Merge pull request #26803 from yuwata/udevadm-verify-summary
udevadm-verify: print a short summary
2023-03-17 12:14:04 +09:00
Frantisek Sumsal
e912bef85d test: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASan 2023-03-16 12:56:40 +00:00
Yu Watanabe
7b4cae904b test: add tests for summary output of udevadm verify 2023-03-16 14:54:46 +09:00
Yu Watanabe
f99deb1e94 test: reindent testsuite-17.11.sh 2023-03-16 14:54:46 +09:00
Yu Watanabe
cb6ff2a42c
Merge pull request #26771 from YHNdnzj/machinectl-edit
machinectl: add verb edit and cat to operate on .nspawn files
2023-03-16 04:02:11 +09:00
Dmitry V. Levin
f5b28e6bd8 test: fix testsuite-17.10.sh
Make sure /etc/udev/hwdb.d/ exists before creating a file inside it.

Fixes: 95cf8cae77f7 ("test: add coverage test for udevadm")
2023-03-16 03:59:01 +09:00
Dmitry V. Levin
3ec58d0cd8 udev-rules: check for conflicting and duplicate expressions
Log an error when a rule line contains conflicting match expressions, e.g.
  NAME=="value", NAME!="value"

Log a warning when a rule line contains duplicate expressions, e.g.
  NAME=="value", NAME=="value"
2023-03-16 03:49:57 +09:00
Mike Yuan
af0292844d
test: add testsuite-74.machinectl 2023-03-15 19:56:19 +08:00
Luca Boccassi
1be50af42e
Merge pull request #26804 from fbuihuu/fixes-for-test-58-repart
Fixes for test 58 repart
2023-03-15 10:56:07 +00:00
Luca Boccassi
d4b6ec980d core: make the memory pressure cgroup path writable when ProtectControlGroups=yes
The interface requires services to write to the cgroup file to activate notifications,
but with ProtectControlGroups=yes we make it read-only. Add a writable bind mount.

Follow-up for 6bb0084204bd93122c9f04391b80aea5a8a0ff08
2023-03-15 09:23:17 +01:00
Franck Bui
693c3e1a59 test: assume run-unit-tests.py and unit tests are installed in the same directory
This avoids hard coding the path of the directory where the unit tests are
installed.
2023-03-15 09:19:33 +01:00
Daan De Meyer
3a36d19938
Merge pull request #26662 from yuwata/test-execute-network-namespace-path
test-execute: add tests for NetworkNamespacePath=
2023-03-14 11:16:15 +01:00
Yu Watanabe
91ea97356c test-50-dissect: add test for long reference name 2023-03-14 18:53:55 +09:00
Franck Bui
1b971e0117 tests: don't use absolute paths when installing binaries in TEST-58-REPART
Let image_install figures the binary paths out itself as not all distributions
ship the mkfs.* tools in the same location. For example openSUSE ships
mksquashfs in /usr/bin/.
2023-03-14 10:11:27 +01:00
Franck Bui
8fd25ba343 tests: fix inverted condition in testsuite-58.sh 2023-03-14 10:07:06 +01:00
Mike Yuan
880adc6edd test: testsuite-26: remove duplicate source 2023-03-14 12:32:16 +09:00
Yu Watanabe
4fed028ae4
Merge pull request #26781 from mrc0mmand/tests-again
test: add a couple of tests for systemd-path
2023-03-14 03:27:45 +09:00
Yu Watanabe
d77d42ed3a systemctl: refuse to acquire dbus connection with --global
Maybe, better to check the runtime scope each verb for better log
message, but this is a good start point to not trigger assertion.

Fixes oss-fuzz#56915 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56915).

Fixes #26402 and #26754.
2023-03-13 12:27:34 +01:00
Frantisek Sumsal
8093693275 test: add a couple of tests for systemd-path 2023-03-13 11:59:18 +01:00
Yu Watanabe
c9501b03cd
Merge pull request #26641 from medhefgo/boot-elf2efi
boot: Drop gnu-efi / Add elf2efi.py
2023-03-11 17:15:01 +09:00
Dmitry V. Levin
b2f7bb760a udev_rules_parse_file: issue diagnostics about duplicate LABEL tokens
When a rules contains several LABEL tokens, the parser used to silently
discard all of them besides the last one without any diagnostics at all.
It's time to break the vow of silence and let the parser issue a warning.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin
c8f39ddcf6 testsuite-17.11.sh: check udevadm verify --root 2023-03-10 17:10:41 +00:00
Dmitry V. Levin
e8c53080c4 udevadm verify: load all rules from the system if no rules were given
When udevadm verify is invoked without positional arguments, that is,
when no udev rules files are specified, load all rules files from the system
like the udev daemon does, and verify them.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin
197f695a75 testsuite-17.11.sh: prepare to test udevadm verify --root 2023-03-10 17:10:41 +00:00
Dmitry V. Levin
99f2445171 testsuite-17.11.sh: create all files in a temporary directory
Make sure the test would not collide with anything else by moving
all files it created into a temporary directory.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin
0b1ee3e311 testsuite-17.11.sh: robustify unknown user/group checks
Use certainly invalid user/group names in the tests that check
unknown user/group diagnostics.
2023-03-10 17:10:41 +00:00
Luca Boccassi
5c67a8a188 test: run script from /tmp, not /run
On Debian the test fails because /run is noexec. Simply create the
script in /tmp (and use a BindPath=), as other tests are doing.

Follow-up for 3b7101183cac4b35a8bd6ea2c1de9260c33f977f
2023-03-10 11:01:22 +00:00
Jan Janssen
e8509329d7 ci: Adjust for new EFI build 2023-03-10 11:41:08 +01:00
Jan Janssen
dfca5587cf tree-wide: Drop gnu-efi
This drops all mentions of gnu-efi and its manual build machinery. A
future commit will bring bootloader builds back. A new bootloader meson
option is now used to control whether to build sd-boot and its userspace
tooling.
2023-03-10 11:41:03 +01:00
Lennart Poettering
862481ece0
Merge pull request #26693 from poettering/udev-loop-links
udev: add /dev/loop/by-inode/… + /dev/loop/by-ref/… loopback block device symlinks
2023-03-10 09:34:31 +01:00
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
Lennart Poettering
f5e46b9e09 test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks
Let's test that everything we just added works in combination.
2023-03-09 22:29:11 +01:00
Frantisek Sumsal
4af346a8d8 test: exercise JSON transformations in busctl 2023-03-09 16:33:08 +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