1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-27 01:57:35 +03:00

4315 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
0d08149801
Merge pull request #30316 from mrc0mmand/revert-journal-upload-user
Revert "sysusers.d: create the user for systemd-journal-upload.service"
2023-12-06 22:28:34 +01:00
Zbigniew Jędrzejewski-Szmek
34f4fcb59f
Merge pull request #30302 from keszybz/systemd-edit-stdin
systemctl edit --stdin
2023-12-06 22:28:02 +01:00
Zbigniew Jędrzejewski-Szmek
fd72d1e794
Merge pull request #30085 from YHNdnzj/networkctl-edit-runtime
networkctl: introduce --runtime for editing network config under /run/
2023-12-06 22:27:01 +01:00
Zbigniew Jędrzejewski-Szmek
bfa95c369a
Merge pull request #29987 from yuwata/network-bridge-vlan
network: remove unnecessary bridge vlan IDs
2023-12-06 22:25:42 +01:00
Zbigniew Jędrzejewski-Szmek
d1f9a39ef4
Merge pull request #29853 from YHNdnzj/sleep-automated
logind: support Sleep() that automatically choose a sleep operation
2023-12-06 22:25:13 +01:00
Samuel BF
435c372ce5 journal-gatewayd: add since/until parameters for /entries
Request with Range header like 'entries=<cursor>:' (with a colon at the end,
invalid syntax per the doc), is now rejected with error 400 Bad Request.

fix #4883
2023-12-06 22:22:27 +01:00
Luca Boccassi
f9a284f02d
Merge pull request #30214 from bluca/wants_mounts_for
Add WantsMountsFor= and use it in the cryptsetup generator
2023-12-06 21:00:37 +00:00
Daan De Meyer
1500fe38b2 test: Add test case for --make-ddi=sysext
Also make sure that the sysext is big enough to not fit in the
minimum partition size so we know Minimize= is being used.
2023-12-06 12:18:32 +01:00
Frantisek Sumsal
1ea27bd79e test: load the io controller before checking if io.latency exists
Otherwise the following test gets always skipped.
2023-12-05 19:58:48 +00:00
Zbigniew Jędrzejewski-Szmek
dd0630277b TEST-26: add test for systemctl edit --stdin 2023-12-05 18:47:19 +01:00
Mike Yuan
cd4dd90b99
logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
Frantisek Sumsal
52c1fb6885 test: set correct group for systemd-journal-upload tests
We can't use the systemd-journal-upload user here, since it's created
dynamically by DynamicUser=yes. However, we can use the group specified
in SupplementaryGroups=, so do exactly that.
2023-12-05 09:07:14 +01:00
Frantisek Sumsal
30349b09bd test: reenable TEST-30 on i*86
The original reason for deny-listing it was that it's flaky there. I'm
not sure if that's still the case, but the Ubuntu CI jobs for i*86 are
gone, so this file shouldn't be needed anymore anyway.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
fc55ef9b69 test: skip TEST-36 on s390x and powerpc
As QEMU there doesn't support NUMA nodes. Also, drop the now unneeded
deny-list file for Ubuntu CI.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
6743066875 test: check if 'btrfs filesystem' supports 'mkswapfile'
Instead of deny-listing the test on Ubuntu CI, so it gets enabled
automagically once btrfs-progs is updated to a newer version there.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
a311d4dd30 test: reenable TEST-25-IMPORT in Ubuntu CI
Let's see if #13973 is still an issue.
2023-12-04 10:16:02 +01:00
Mike Yuan
2b98926f98
networkctl: introduce --runtime for editing network config under /run/ 2023-12-02 17:04:57 +08:00
Luca Boccassi
f4a35f2ad9 core: do not drop CAP_SETUID if it is in AmbientCapabilities=
Follow-up for 24832d10b604848cf46624bb439c7fac27f3ce3f
2023-12-01 10:48:14 +00:00
Yu Watanabe
a93be359ae sd-journal: fix corrupted journal handling of generic_array_bisect()
Let's consider the following case:
- the direction is down,
- no cached entry,
- the array has 5 entry objects,
- the function test_object() reutns TEST_LEFT for the 1st object,
- the 2nd, 3rd, and 4th objects are broken, so generic_array_bisect_step()
  returns TEST_RIGHT for the object.

Then, previously, generic_array_bisect_step() updated the values like the following:
  0th: (m = 5, left = 0, right = 4, i = 4) -> (m = 4, left = 0, right = 3, RIGHT)
  1st: (m = 4, left = 0, right = 3, i = 1) -> (m = 4, left = 2, right = 3, LEFT)
  2nd: (m = 4, left = 2, right = 3, i = 2) -> (m = 2, left = 2, right = 1, RIGHT) <- ouch!!
So, assert(left < right) in generic_array_bisect() was triggered.
See issue #30210.

In such situation, there is no matching entry in the array. By returning
TEST_GOTO_PREVIOUS, generic_array_bisect() handles the result so.

Fixes a bug introduced by ab8f553d1e09088fb1f633e014299e7bf6c30c9e.

Fixes #30210.
2023-12-01 09:56:10 +09:00
Frantisek Sumsal
ee77e0b2de test: ignore gcov errors with RestrictFileSystems=
The errors are valid, since the file system is indeed not writable, but
we don't care about the missing coverage data in this case.

Follow-up to 4a43c2b3a1.
2023-11-29 22:50:37 +00:00
Luca Boccassi
c9be8e420e cryptsetup: use WantsMountsFor= for key/header when nofail is set
The header and keyfile are necessary only for opening the device, not
for closing, so it is not necessary to deactivate the generated
cryptsetup unit when the header or keyfile backing store are removed.

This is especially useful in the case of softreboot, when the new
mount root is setup under /run/nextroot/ but we don't want to close
the cryptsetup devices for encrypted /var/ or so, and we simply
mount it directly on /run/nextroot/var/ before the soft-reboot.
2023-11-29 11:04:59 +00:00
Luca Boccassi
9e615fa3aa core: add WantsMountsFor=
This is the equivalent of RequiresMountsFor=, but adds Wants= instead
of Requires=. It will be useful for example for the autogenerated
systemd-cryptsetup units.

Fixes https://github.com/systemd/systemd/issues/11646
2023-11-29 11:04:59 +00:00
janana
c1a2ada897 rules: go to the end of rules indeed when dm is suspended
The previous patch 466266c does not make sense indeed, that is to say, if the SYSTEMD_READY is not recorded in the database, the GOTO="systemd_end" will not be applied.

The IMPORT{db} is actually a matching token, it returns false when there is no SYSTEMD_READY recorded in the database.

The previous patch 466266c tended to inherit the state of SYSTEMD_READY from the database and skip to the end of current rule file. But when the database does not contain SYSTEMD_READY, e.g., the dm-* is not set db_persistent during initrd and the database will be cleared after switching root, the following rules will still be applied not as expected.
2023-11-29 09:57:55 +01:00
Luca Boccassi
499d32655f
Merge pull request #30203 from yuwata/resolve-dump-cache
resolve: fix varlink message verification
2023-11-28 15:35:11 +00:00
Luca Boccassi
3dfbddf3ee
Merge pull request #30216 from poettering/loginctl-table-tweaks
loginctl: minor tweaks to tabular output
2023-11-28 15:33:35 +00:00
Lennart Poettering
8bfa22f079 loginctl: set appropriate ersatz strings for all tables 2023-11-28 11:33:01 +01:00
Yu Watanabe
5edb35ef7a test: check journal files are not corrupted after soft-reboot 2023-11-28 18:28:18 +09:00
Yu Watanabe
038e455462 test: verify json format passed through varlink
This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal,
as the expected logs from test-varlink-idl makes the post script fail.
Saving logs in journal is simply noisy, and we will output anyway after
qemu or nspawn finished by check_result_{qemu,nspawn}_unittests().
2023-11-28 04:13:44 +09:00
Yu Watanabe
fa316d553c test: show saved journal files after TEST-02-UNITTESTS 2023-11-28 04:10:25 +09:00
Yu Watanabe
a97d617f18 test: drop remaining console output
Follow-up for fa6f37c04391d0103c95e24813ad345c2d5c4b67.

Partially reverts d5ab23aa54229e9e89427e7d20883bd8c93fd976 and
3540ce8587cbd21ce9c2dbec72ea7fa3d1b38a5f.
2023-11-28 04:10:25 +09:00
Yu Watanabe
24baa46289 test: add simple coverity test for 'resolvectl show-cache' 2023-11-28 04:10:25 +09:00
Luca Boccassi
04fc5b6047
Merge pull request #30170 from bluca/exec_bpf_fd
core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set
2023-11-27 15:44:50 +00:00
Frantisek Sumsal
7a2d6c2d08 test: drop 'noearly' from crypttab
It's a Debian thing, we don't support it.

[   30.639971] testsuite-64.sh[475]: + systemctl restart cryptsetup.target
[   30.697667] systemd-cryptsetup[3389]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700529] systemd-cryptsetup[3390]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700594] systemd-cryptsetup[3391]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.704638] systemd-cryptsetup[3392]: Encountered unknown /etc/crypttab option 'noearly', ignoring
2023-11-25 22:30:01 +01:00
Frantisek Sumsal
d1ac1aa5ca test: drop invalid LogTarget= assignment
It's been there since the test was introduced and I'm not really sure
what was the original intention behind it, but it makes systemd sad:

[    4.909056] systemd[1]: /usr/lib/systemd/tests/testdata/units/testsuite-44.service:13: Unknown key name 'LogTarget' in section 'Service', ignoring.
2023-11-25 21:59:57 +01:00
Frantisek Sumsal
60f9c49b16 test: remove the reboot counter just before spawning container/VM
Doing that in test_run() is not enough, since it's called only once and
spawns all QEMU/nspawn jobs.
2023-11-25 20:22:24 +01:00
Frantisek Sumsal
fa6f37c043 test: don't redirect stdout/stderr to console
Turns out that redirecting a lot of output to the console can have some
funny effects, like random kernel soft lockups. I spotted this in
various CIs, but it remained almost entirely hidden thanks to
`softlockup_panic=1`, until 1a36d2672f which introduced a couple of
tests that log quite a lot in a short amount of time. This, in
combination with newer kernel version, which, for some reason, seem to
be more susceptible to such soft lockups, made the Arch Linux jobs soft
lockup quite a lot, see [0].

While debugging this I also noticed that runs which don't redirect
stdout/stderr to the console are noticeably faster, e.g.:

    # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:24.64
    # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:17.95

    # TEST-71 nspawn + QEMU, StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 2:04.70
    # TEST-71 nspawn + QEMU, StandardOutput=journal
    Elapsed (wall clock) time (h:mm:ss or m:ss): 1:44.48

    # TEST-04 QEMU, StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 4:22.70
    # TEST-04 QEMU, StandardOutput=console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 5:04.67

Given all this, let's effectively revert ba7abf79a5, and dump the
testsuite-related journal messages only after the test finishes, so they
don't go through the slow console.

Resolves: systemd/systemd-centos-ci#660

[0] https://github.com/systemd/systemd-centos-ci/issues/660
2023-11-24 18:00:07 +01:00
Frantisek Sumsal
4a43c2b3a1 test: add a couple of tests for RestrictFileSystems= 2023-11-24 17:49:28 +01:00
Frantisek Sumsal
c5035a30e2 test: don't make the final vacuum multiple of 8M
As this would usually mean we'd nuke everything, since there are two
open journals - system and user - both being 8M in size.
2023-11-24 11:51:27 +01:00
Frantisek Sumsal
09bdb9f121 test: clean up the save_journal() stuff a bit
Let's save all journals from the test machine instead of calling export
on each journal file separately, which makes the code less complicated
(and probably faster).
2023-11-24 11:51:27 +01:00
Luca Boccassi
31897753fb
Merge pull request #30024 from keszybz/one-doc-thingy
Serialize units ratelimits and document StartLimitIntervalSec=infinity
2023-11-22 17:42:51 +00:00
Zbigniew Jędrzejewski-Szmek
6ef512c0bb core: serialize and deserialize unit start ratelimits
The logic is taken from dump ratelimit: if the config changes, we discard the
counters. This allows the user apply new limits and "start from scratch" in
that case.

This actually makes StartLimitIntervalSec=infinity (or with a large interval)
work as expected, because the counter is maintained even if daemon-reload
operations are interleaved.
2023-11-22 12:12:35 +00:00
Lennart Poettering
5e5d4d36b4 test: make sure pcrlock tests run headless
We want the tests to fail rather than hang if unlock via tpm doesn't
work.
2023-11-21 23:43:23 +00:00
Yu Watanabe
b65c539088 test-network: add tests for [DHCPv4] AllowList= and DenyList=
We have not tested if the settings actually filter DHCP servers.
Let's add a test case for the settings.

Note, the .network file used here has been unused since
0730e3767d91e020985dc5c7c2178460f627581a. So, we can freely reuse it
without changing other test cases.

Closes #30107.
2023-11-22 05:37:04 +09:00
Frantisek Sumsal
7ec22d7d4b bsod: install the signal handler only just before we need it
Otherwise we might get stuck in sd_journal_wait(), since it handles
EINTR internally.

Resolves: #30084
2023-11-21 16:58:33 +00:00
Luca Boccassi
fe68cbda00
Merge pull request #30108 from mrc0mmand/packit-testing-farm
packit: run tests on Fedora Rawhide via Testing Farm
2023-11-20 23:02:42 +00:00
Frantisek Sumsal
f258a76332 test: don't use ddebug() before it's defined
I'm pretty sure this is not the only case, but it's the one I recently
noticed. Even though we call ddebug() from a function, that function is
called before ddebug() is defined, resulting in the same issue as if we
called just ddebug() in its place, i.e.:

..//test-functions: line 276: ddebug: command not found
2023-11-20 21:26:17 +01:00
Frantisek Sumsal
6162caa288 test: move a couple of binaries to the BASICTOOLS array
As they're not optional.
2023-11-20 21:26:14 +01:00
Frantisek Sumsal
8ddbd9e078 test: support NO_BUILD=yes on Fedora 2023-11-20 21:26:11 +01:00
Frantisek Sumsal
b54bc139ae test: make the LOOKS_LIKE_* variables proper booleans 2023-11-20 21:26:08 +01:00
Luca Boccassi
42c1df5e2d test: add simple test case for invalid userspace log records 2023-11-20 14:27:38 +01:00