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

3484 Commits

Author SHA1 Message Date
Frantisek Sumsal
98fa6c7210 test: explicitly pull in systemd-userdbd.socket
Since we don't run preset-all on the test image, the
systemd-userdbd.socket remains disabled. Let's pull it in explicitly
to give systemd-userdbd some coverage as well.
2023-03-27 13:29:12 +02:00
Yu Watanabe
cccc14c5a8
Merge pull request #26973 from mrc0mmand/userdbctl-tests
test: add a couple of tests for userdbctl
2023-03-26 09:49:27 +09:00
Yu Watanabe
6fc0d6b5ac
Merge pull request #26983 from mrc0mmand/coredump-test-followup
test: don't expand the subshell expression prematurely
2023-03-26 09:47:49 +09:00
Frantisek Sumsal
237d81fdb3 test: filter the merged coverage report instead
So we don't have to do this twice - once for the base report and then
for each "real" one.

Follow-up to 7fdd6e157a.
2023-03-25 17:55:41 +01:00
Frantisek Sumsal
93fe228bb1 test: add a couple of tests for userdbctl 2023-03-25 14:13:00 +01:00
Frantisek Sumsal
7fdd6e157a test: do an initial coverage capture
I noticed that our coverage reports miss some files completely - this
happens when the test doesn't touch the code in them at all, so the
generated coverage data (and resulting reports) have no information
about them. Let's fix this by doing an initial zero coverage capture
that contains a zeroed counter for every instrumented line in every
file, so when we later merge it with a capture from the test, it shows up
with a missing coverage instead of not showing at all.
2023-03-25 12:29:40 +00:00
Frantisek Sumsal
91c031f169 test: drop unnecessary return
Return code of the EXIT trap handler is ignored in bash.
2023-03-25 12:17:11 +01:00
Frantisek Sumsal
370fa624f5 test: don't touch the /failed marker in the subtest scripts
As it is already handled by the "main" script (testsuite-74.sh).
2023-03-25 12:15:33 +01:00
Frantisek Sumsal
0b189ac84c test: don't expand the subshell expression prematurely
We need to expand the subshell expression during the `bash -c`
invocation, not before, to take the desired effect, as now it expands to:

timeout 30 bash -c 'while [[ 0 -eq 0 ]]; do sleep 1; done'

instead of the expected:

timeout 30 bash -c 'while [[ $(coredumpctl list -q --no-legend 770 | wc -l) -eq 0 ]]; do sleep 1; done'

Follow-up to aadbd81f7f.
2023-03-25 12:10:58 +01:00
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: 3ec58d0cd8 ("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: 95cf8cae77 ("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 6bb0084204
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 3b7101183c
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