Commit graph

3386 commits

Author SHA1 Message Date
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
Frantisek Sumsal ca8b1d68c5 test: avoid matching other fields than __SEQNUM=
The current unanchored grep sometimes matches MESSAGE=/_CMDLINE= fields
that contain "__SEQNUM=" instead of just the __SEQNUM= field, causing
spurious test fails:

[  721.546372] testsuite-04.sh[1013]: ++ cut -d= -f2
[  721.555858] testsuite-04.sh[1011]: ++ journalctl -o export -n 1
[  721.573037] testsuite-04.sh[1012]: ++ grep -a __SEQNUM=
[  721.767294] testsuite-04.sh[562]: + SEQNUM1='495773
[  721.769671] testsuite-04.sh[562]: ++ grep -a __SEQNUM
[  721.771323] testsuite-04.sh[562]: grep -a __SEQNUM'
[  721.772938] testsuite-04.sh[562]: + systemd-cat echo yo
[  721.921413] testsuite-04.sh[562]: + journalctl --sync
[  722.088945] testsuite-04.sh[1018]: ++ journalctl -o export -n 1
[  722.104040] testsuite-04.sh[1019]: ++ grep -a __SEQNUM=
[  722.117239] testsuite-04.sh[1020]: ++ cut -d= -f2
[  722.314936] testsuite-04.sh[562]: + SEQNUM2=495786
[  722.317906] testsuite-04.sh[562]: + test 495786 -gt '495773
[  722.319737] testsuite-04.sh[562]: ++ grep -a __SEQNUM
[  722.321609] testsuite-04.sh[562]: grep -a __SEQNUM'
[  722.323536] testsuite-04.sh[562]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 276: test: 495773
[  722.325744] testsuite-04.sh[562]: ++ grep -a __SEQNUM
[  722.327498] testsuite-04.sh[562]: grep -a __SEQNUM: integer expression expected
[  722.329528] testsuite-04.sh[562]: + journalctl --rotate --vacuum-size=16M

$ build/journalctl --file /var/tmp/systemd-test.0HpVjt/system.journal -o export | grep -a __SEQNUM=
...
__SEQNUM=214849
__SEQNUM=214850
MESSAGE=++ grep -a __SEQNUM=
_CMDLINE=grep -a __SEQNUM=
__SEQNUM=214851
...
__SEQNUM=214860
MESSAGE=++ grep -a __SEQNUM=
_CMDLINE=grep -a __SEQNUM=
__SEQNUM=214861
__SEQNUM=214862
__SEQNUM=214863
...

Let's anchor the expression to avoid this.

Follow-up to f28ed2c1be.
2023-02-17 07:03:00 +09:00
Luca Boccassi 53fda560dc core: add support for Startup memory limits
We support separate Startup configurations for CPU and I/O, so
add it for memory too. Only cover cgroupsv2 settings.
2023-02-15 20:01:16 +00:00
Luca Boccassi 010c73c68e
Merge pull request #26307 from yuwata/test-execute-credentials
test-execute: drop capabilities when testing with user manager
2023-02-15 19:59:28 +00:00
Luca Boccassi 6f97aae029
Merge pull request #26213 from poettering/journal-rework-seqnum
journal sequence number rework
2023-02-15 19:58:58 +00:00
Luca Boccassi 9ecf865433
Merge pull request #26417 from yuwata/sysusers-root-group
sysusers: also create root group
2023-02-15 17:03:59 +00:00
Dmitry V. Levin 30fd9a2dab treewide: fix a few typos in NEWS, docs and comments 2023-02-15 10:41:03 +00:00
Yu Watanabe 6f31095105 test-sysusers: add test for basic.conf 2023-02-15 10:54:25 +09:00
Yu Watanabe b7cca6cc5a test-execute: add basic tests for LoadCredential= and SetCredential= 2023-02-15 10:10:54 +09:00
Yu Watanabe 4e032f654b test-execute: drop capabilities when testing with user manager
Before this, tests are split into two categories, system and user, but
both are running in fully privileged environment. Hence, unprivileged
user scope was mostly not covered by the test.

Let's run all tests in both system and user scopes, and drop capabilities
when Manager is running in user scope.

This also makes the host environment protected more from the test run.
2023-02-15 10:10:54 +09:00
Yu Watanabe 0b75493da0 tree-wide: fix typo and comment style update 2023-02-15 10:08:16 +09:00
Quentin Deslandes 41b7fcc5e8 journald: fix ignored filtering patterns for delegated cgroups
If a service defines Delegate=yes, its subcgroup won't inherit the
LogFilterPatterns= option, because the option is stored on the unit's
cgroup attributes, not on the subcgroup.

Fixed by using the unit's cgroup attributes instead.
2023-02-08 16:52:51 +01:00
Lennart Poettering f28ed2c1be test: add basic seqnum test 2023-02-08 13:52:14 +01:00
Lennart Poettering 2bc70e2e9d logs-show: show seqnum info in export+json output mode 2023-02-08 13:42:29 +01:00
Luca Boccassi 398dc7d39b core: imply DeviceAllow=/dev/tpmrm0 with LoadCredentialEncrypted
If the device access policy is restricted, add implicitly access to the TPM
if at least one encrypted credential needs to be loaded.

Fixes https://github.com/systemd/systemd/issues/26042
2023-02-08 10:59:55 +00:00
Luca Boccassi b0fc23fae5 cryptenroll: do not implicitly verify with default tpm policy signature
If it was not requested to use a tpm2 signature file when enrolling, do
not fallback to the default /run/systemd/tpm2-pcr-signature.json as it
likely will be unrelated if it exists.

Fixes https://github.com/systemd/systemd/issues/25435
2023-02-08 10:58:57 +00:00
Yu Watanabe 8586e8ab84
Merge pull request #26324 from yuwata/argv-util-update-short-name
argv-util: also update short invocation name
2023-02-07 12:08:07 +09:00
Yu Watanabe 577a0fd59b test: use notice log level to make easily filter out logs from PID1 2023-02-06 22:50:03 +09:00
Zbigniew Jędrzejewski-Szmek 7a17e41dcf test: drop whitespace after shell redirection operators
(The one case that is left unchanged is '< <(subcommand)'.)

This way, the style with no gap was already dominant. This way, the reader
immediately knows that ' < ' is a comparison operator and ' << ' is a shift.

In a few cases, replace custom EOF replacement by just EOF. There is no point
in using someting like "_EOL" unless "EOF" appears in the text.
2023-02-06 09:19:04 +01:00
Luca Boccassi 9a101c5d4c
Merge pull request #26269 from keszybz/sysusers-empty-etc-and-improved-messages
sysusers: improve messages and autocreate /etc
2023-02-01 23:14:59 +00:00
Luca Boccassi e5cf396181
Merge pull request #26287 from medhefgo/mkosi-auto-enroll
ci: Test with secure boot enabled under mkosi
2023-02-01 21:51:04 +00:00
Frantisek Sumsal cc3826155d
Merge pull request #26285 from yuwata/test-lvextend
test: add a testcase for lvextend
2023-02-01 20:59:04 +00:00
Zbigniew Jędrzejewski-Szmek 92fc007902
Merge pull request #26219 from yuwata/localed-follow-ups
locale: check conversion before polkit
2023-02-01 17:18:35 +01:00
Jan Janssen 2de6cc18f9 ci: Test with secure boot enabled under mkosi
This gives us some nice test coverage for secure boot enrolling and the
stub secure boot workound. The authenticated EFI variables are already
created by mkosi, all we need to do is request secure boot to be used.
2023-02-01 17:16:03 +01:00
Yu Watanabe d60e348261 test: add a testcase for lvextend
For RHBZ#2158628 (https://bugzilla.redhat.com/show_bug.cgi?id=2158628)
2023-02-02 00:40:57 +09:00
Yu Watanabe 5479d0f83a test: make helper_check_device_units() log unit name 2023-02-01 23:04:13 +09:00
Zbigniew Jędrzejewski-Szmek 3e74e6a15b test-sysusers: check that sysusers creates /etc when missing 2023-02-01 11:38:35 +01:00
Lennart Poettering e9125200ac
Merge pull request #26245 from ldv-alt/tmpfiles-fixes
tmpfiles: fix specifier expansion in arguments of C and L lines
2023-01-30 17:14:03 +01:00
Yu Watanabe 808f7c94f0
Merge pull request #23956 from mrc0mmand/resolved-ipv6
test: cover (not only) IPv6 in the resolved test suite
2023-01-30 19:21:19 +09:00
Daan De Meyer 60f42f7ec2 test-systemd-tmpfiles: Fix execution when user is not in /etc/passwd
We might be running in a chroot as a uid that doesn't exist in /etc/passwd.
Let's make sure we don't fail in this scenario.

We pass $HOME when resetting the env so that we can find a home directory
and skip tests that depend on user name/group.
2023-01-29 17:49:38 +00:00
Yu Watanabe 21a9c92625 test: add tests for localectl --no-convert 2023-01-28 15:06:00 +09:00
Frantisek Sumsal 42262f3e1b test: wrap delv & dig when running with sanitizers
On Arch both delv and dig pull in libnss_resolve:

```
$ grep resolve /etc/nsswitch.conf
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
```
2023-01-27 16:40:52 +01:00
Frantisek Sumsal 270e9dcdb8 test: don't hang indefinitely on no match 2023-01-27 15:45:00 +01:00
Frantisek Sumsal 05bb428952 test: add a test for the OPENPGPKEY RR 2023-01-27 15:45:00 +01:00
Frantisek Sumsal 3095bd2cca test: add a couple of SRV records to check service resolution 2023-01-27 15:45:00 +01:00
Frantisek Sumsal 5c9111fe77 test: cover IPv6 in the resolved test suite 2023-01-27 15:45:00 +01:00
Daan De Meyer 2ecc7a5bca repart: Add roothash to output of all verity siblings
This can be used to match verity partitions together using the repart
JSON output.
2023-01-25 19:50:44 +00:00
Michael Biebl d173c9ebb0 test: skip firstboot --prompt-keymap check if keymaps are missing
Fixes: #26165
2023-01-25 19:46:33 +00:00
Luca Boccassi 1fd579061a locale: rename new XKB variables to match Debian/Ubuntu's
Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.

Follow-up for https://github.com/systemd/systemd/pull/25805

See:
 https://github.com/systemd/systemd/issues/24228
 https://github.com/systemd/systemd/pull/25412
2023-01-24 22:09:58 +01:00
Frantisek Sumsal b0c110967b
Merge pull request #26164 from mrc0mmand/test-bus-timeout
test: bump the client-side timeout in sd-bus as well
2023-01-24 08:49:29 +00:00
Zbigniew Jędrzejewski-Szmek d4fc020996
Merge pull request #26153 from DaanDeMeyer/repart-remove-userns
mkfs-util: Remove user namespace owner => root mapping
2023-01-23 21:46:55 +01:00
Luca Boccassi 020b2e41ea core: ensure init.scope is realized after drop-ins have been loaded
If we add a drop-in for init.scope (e.g.: to set some memory limit),
it will be loaded long after the cgroup has already been realized.
Do it again when creating the special unit.
2023-01-23 21:40:54 +01:00
Luca Boccassi deeebc95af
Merge pull request #25805 from yuwata/locale-xkb-save-vconsole
locale: also save X11 keyboard settings to /etc/vconsole.conf
2023-01-23 19:40:12 +00:00
Frantisek Sumsal d932022ddf test: bump the container spawn timeout to 60s
As 30s might be not enough on busy systems (and we already bumped the
reboot timeout from 30s to 60s for this reason).
2023-01-23 19:13:49 +01:00
Frantisek Sumsal e0cbb73911 test: bump the client-side timeout in sd-bus as well
Since c78d18215b D-Bus services now have 60s to start, but the client
side (sd-bus) still waits only for 25s before giving up:

```
[  226.196380] testsuite-71.sh[556]: + assert_in 'Static hostname: H' ''
[  226.332965] testsuite-71.sh[576]: + set +ex
[  226.332965] testsuite-71.sh[576]: FAIL: 'Static hostname: H' not found in:
[  228.910782] sh[577]: + systemctl poweroff --no-block
[  232.255584] hostnamectl[565]: Failed to query system properties: Connection timed out
[  236.827514] systemd[1]: end.service: Consumed 2.131s CPU time.
[  237.476969] dbus-daemon[566]: [system] Successfully activated service 'org.freedesktop.hostname1'
[  237.516308] systemd[1]: system-modprobe.slice: Consumed 1.533s CPU time.
[  237.794635] systemd[1]: testsuite-71.service: Main process exited, code=exited, status=1/FAILURE
[  237.818469] systemd[1]: testsuite-71.service: Failed with result 'exit-code'.
[  237.931415] systemd[1]: Failed to start testsuite-71.service.
[  238.000833] systemd[1]: testsuite-71.service: Consumed 5.651s CPU time.
[  238.181030] systemd[1]: Reached target testsuite.target.
```

Let's override the timeout in sd-bus as well to mitigate this.

Follow-up to c78d18215b.
2023-01-23 18:44:55 +01:00