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

3927 Commits

Author SHA1 Message Date
Yu Watanabe
9bf0fe3633
Merge pull request #28287 from yuwata/network-null-address
network: fix null address handling
2023-07-08 01:13:17 +09:00
Luca Boccassi
91c96f9b32 test: remove +x from some units 2023-07-07 12:31:28 +01:00
Luca Boccassi
544fc54d72 test: add +x to generator-utils.sh
It is marked and named as a script, so add +x otherwise Lintian complains:

 W: systemd-tests: script-not-executable [usr/lib/systemd/tests/testdata/units/generator-utils.sh]
2023-07-07 11:51:11 +01:00
Yu Watanabe
fc25920c94 test-network: add tests for null addresses
For issue #26113.
2023-07-07 19:11:37 +09:00
Yu Watanabe
14be337d04
Merge pull request #28233 from mrc0mmand/append-to-corrupted-journals
test: append to corrupted journals
2023-07-07 11:51:02 +09:00
Yu Watanabe
86f6760038 test-network: add one more testcase for DHCPv4 classless route
For issue #28280.
2023-07-07 06:57:08 +09:00
Frantisek Sumsal
29bdeb5cb3 test: append to corrupted journals
Introduce a manual test tool that creates a journal, corrupts it by
flipping bits at given offsets, and then attempts to write to the journal.
In ideal case we should handle this gracefully without any crash or
memory corruption.
2023-07-06 22:41:27 +02:00
Luca Boccassi
b2deaaf01b
Merge pull request #27584 from rphibel/add-restartquick-option
service: add new RestartMode option
2023-07-06 20:37:31 +01:00
Luca Boccassi
b9b0f338be
Merge pull request #28274 from DaanDeMeyer/dissect-root
dissect: Allow a few verbs to operate on directories as well as image files
2023-07-06 14:41:48 +01:00
Richard Phibel
e568fea9fc service: add new RestartMode option
When this option is set to direct, the service restarts without entering a failed
state. Dependent units are not notified of transitory failure.

This is useful for the following use case:

We have a target with Requires=my-service, After=my-service.
my-service.service is a oneshot service and has Restart=on-failure in
its definition.

my-service.service can get stuck for various reasons and time out, in
which case it is restarted. Currently, when it fails the first time, the
target fails, even though my-service is restarted.

The behavior we're looking for is that until my-service is not restarted
anymore, the target stays pending waiting for my-service.service to
start successfully or fail without being restarted anymore.
2023-07-06 14:33:52 +02:00
Daan De Meyer
12d58b6c74 dissect: Add --mtree-hash= option
Let's make including hashes in the mtree output configurable to allow
speeding up the --mtree command in cases where file hashes are not
required.
2023-07-06 12:11:45 +02:00
Daan De Meyer
2292fa1e31 dissect: Allow a few verbs to operate on directories as well as image files
--copy-to, --copy-from, --list and --mtree are useful for image directories
as well as image files, so for those verbs, let's check if we were passed
a directory and skip all the image file setup if that's the case.
2023-07-06 12:11:42 +02:00
Lennart Poettering
9103278ff7
Merge pull request #28265 from yuwata/network-captive-portal-follow-ups
network: several follow-ups for captive portal support
2023-07-06 11:39:24 +02:00
Yu Watanabe
62eaf8d039 test-network: drop ExecReload= in networkd.service and udevd.service
Follow-up for 0e07cdb0e7 and
f84331539d.
2023-07-06 14:55:58 +09:00
Mike Yuan
bf3dfa6202
TEST-03-JOBS: test indirect PropagatesStopTo= 2023-07-06 05:12:04 +08:00
Luca Boccassi
79be4b7da8
Merge pull request #28255 from yuwata/sd-device-fix-clone
sd-device: fix device_clone_with_db()
2023-07-05 21:38:52 +01:00
Frantisek Sumsal
ba4a1cd8a8 test: replace readfp() with read_file()
ConfigParser.readfp() has been deprecated since Python 3.2 and was
dropped completely in Python 3.11.
2023-07-05 21:38:24 +01:00
Yu Watanabe
beebaeeb3f test: change partition label to test if the outdated devlinks are removed
The change is intended to reproduce the issue #27983, though the
original issue is highly racy, and the test does not reproduce it
reliably. But, anyway, it is better to change the partition label to
test the devlink removal.
2023-07-05 23:46:01 +09:00
Lennart Poettering
529ba8a1a3
Merge pull request #26844 from YHNdnzj/propagate-stop-fixup
core: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=
2023-07-05 15:56:21 +02:00
Luca Boccassi
11d797d3b9
Merge pull request #28207 from poettering/initrd-creds
various credential improvements (including initrd creds, creds in generators, fstab + getty creds)
2023-07-05 10:29:33 +01:00
Yu Watanabe
051c0f8926
Merge pull request #28228 from yuwata/repart-free-area
repart: fix free area calculation
2023-07-05 16:36:16 +09:00
Yu Watanabe
937625c7c7 test: update test for free area calculation in repart 2023-07-05 10:40:56 +09:00
Yu Watanabe
beba8f2e1e test: add reproducer for issue #28225 2023-07-05 10:40:53 +09:00
Mike Yuan
5db456d065
test: add test cases for issue #26839 in TEST-03-JOBS 2023-07-05 08:15:35 +08:00
Lennart Poettering
de70ecb328 import-creds: add support for binary credentials specified on the kernel cmdline 2023-07-04 23:19:48 +02:00
Lennart Poettering
53888c3393 test: verify that the getty generator with creds works 2023-07-04 23:14:21 +02:00
Lennart Poettering
51235f2fe6 test: add simple fstab credential test 2023-07-04 23:09:39 +02:00
Lennart Poettering
4a262d5677 test: add test for initrd credentials
This extends the test framework a bit, and allows adding additional
initrds to the qemu invocation, which we use here to place credentials
in the new /run/systemd/@initrd/ credentials dir which are then passed
to the host.
2023-07-04 23:05:23 +02:00
Frantisek Sumsal
6bbfa9c214 test: measure subtest runtime 2023-07-04 21:55:53 +02:00
Lennart Poettering
c86a95082b systemctl: implement a new "whoami" verb, that just returns unit of caller/PID 2023-07-04 01:05:02 +01:00
Frantisek Sumsal
f2492d39ba test: wait for the interface to become routable after reconfiguring
Since 6e8477edd3 TEST-75 started failing with:

[  571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[  571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[  571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[  571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[  571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ

Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.
2023-07-04 08:10:11 +09:00
Yu Watanabe
d979b39811
Merge pull request #28245 from rpigott/dhcp6-relax-assert
relax data assert in dchp6_option_parse_string
2023-07-04 08:06:13 +09:00
Ronan Pigott
1219391c9f test-network: add test for an invalid captive portal uri
This could probably be extended to include many more invalid uri
2023-07-03 13:47:12 -07:00
Lennart Poettering
f4b24db7c3 test: add test case for recent OnSuccess=/OnFailure= state machine changes 2023-07-03 17:31:25 +02:00
Yu Watanabe
e4948bb2cd test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).
2023-07-03 16:13:49 +09:00
Yu Watanabe
7e30527806 test-network: check route more strictly 2023-07-03 16:06:17 +09:00
Yu Watanabe
86c2a76e09
Merge pull request #28132 from rpigott/dhcp-captive-portal
Implement RFC8910: captive portal dhcp options
2023-07-03 14:51:56 +09:00
Ronan Pigott
dbe960f07f test-network: add tests for captive portal dhcp options 2023-07-02 01:13:43 -07:00
Frantisek Sumsal
a5e478b24c test: fix test_vxlan with the latest iproute2
Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72
2023-06-30 17:33:40 +00:00
Frantisek Sumsal
06afda6b38 core: reorder systemd arguments on reexec
When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

See: https://github.com/systemd/systemd/issues/28184
2023-06-29 22:20:41 +01:00
Yu Watanabe
856a247e19 test-network: add test for global IPv6PrivacyExtensions= setting 2023-06-29 21:58:23 +09:00
Frantisek Sumsal
69eeb6f15e test: use correct path for systemd-battery-check
Follow-up to #28185.
2023-06-29 13:06:42 +01:00
Yuxiang Zhu
b67e8a4e3e
network: Add IgnoreDdontFragment= option for Fragmentation control (#28131)
From `ip-link(8)`:
> [no]ignore-df - enables/disables IPv4 DF
                      suppression on this tunnel.  Normally datagrams
                      that exceed the MTU will be fragmented; the
                      presence of the DF flag inhibits this, resulting
                      instead in an ICMP Unreachable (Fragmentation
                      Required) message.  Enabling this attribute causes
                      the DF flag to be ignored.

If this option is enabled for a GRE/GRETAP tunnel, the `DF` flag in the outer IP header
will not inherit the inner IP header's `DF` flag.

This is useful to transfer packets that exceed the MTU of the underlay
network.
2023-06-29 12:11:52 +02:00
Yu Watanabe
be994c2640 battery-check: several follow-ups
Follow-ups for e3d4148d50.

- add reference to initrd-battery-check.service in man page, and move
  its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
  indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),

etc, etc...
2023-06-29 15:41:00 +09:00
Lennart Poettering
580a007bb6 test: add test for new XDG_STATE_HOME handling 2023-06-28 22:09:19 +02:00
Lennart Poettering
f9c91932b4 execute: add support for XDG_STATE_HOME for placing service state data in --user mode
This adds support for the new XDG_STATE_HOME env var that was added to
the xdg basedir spec. Previously, because the basedir spec didn't know
the concept we'd alias the backing dir for StateDirectory= to the one
for ConfigurationDirectory= when runnin in --user mode. With this change
we'll make separate. This brings us various benefits, such as proper
"systemctl clean" support, where we can clear service state separately
from service configuration, now in user mode too.

This does not come without complications: retaining compatibility with
older setups is difficult, because we cannot possibly identitfy which
files in existing populated config dirs are actually "state" and which
one are true" configuration.

Hence let's deal with this pragmatically: if we detect that a service
that has both dirs configured only has the configuration dir existing,
then symlink the state dir to the configuration dir to retain
compatibility.

This is not great, but it's the only somewhat reasonable way out I can
see.

Fixes: #25739
2023-06-28 22:01:55 +02:00
Luca Boccassi
1c53c3bab1
Merge pull request #28178 from mrc0mmand/nss-tests
test: add a couple of tests for nss-myhostname & nss-mymachines
2023-06-28 19:41:11 +01:00
Frantisek Sumsal
2b5e786005 test: enable LSan for certain wrapped binaries
So we're able to detect memory leaks in our NSS modules.

An example after introducing a memory leak in nss-myhostname.c:

testsuite-71.sh[2881]: =================================================================
testsuite-71.sh[2881]: ==2880==ERROR: LeakSanitizer: detected memory leaks
testsuite-71.sh[2881]: Direct leak of 2 byte(s) in 1 object(s) allocated from:
testsuite-71.sh[2881]:     #0 0x7fa28907243b in strdup (/usr/lib64/libasan.so.8.0.0+0x7243b)
testsuite-71.sh[2881]:     #1 0x7fa286a7bc10 in gethostname_full ../src/basic/hostname-util.c:67
testsuite-71.sh[2881]:     #2 0x7fa286a74af9 in gethostname_malloc ../src/basic/hostname-util.h:24
testsuite-71.sh[2881]:     #3 0x7fa286a756f4 in _nss_myhostname_gethostbyname4_r ../src/nss-myhostname/nss-myhostname.c:79
testsuite-71.sh[2881]:     #4 0x7fa288f17588 in getaddrinfo (/lib64/libc.so.6+0xf4588)
testsuite-71.sh[2881]:     #5 0x7fa2890a4d93 in __interceptor_getaddrinfo.part.0 (/usr/lib64/libasan.so.8.0.0+0xa4d93)
testsuite-71.sh[2881]:     #6 0x55a54b2b7159 in ahosts_keys_int.part.0 (/usr/bin/getent.orig+0x4159)
testsuite-71.sh[2881]: SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).
2023-06-28 17:04:31 +02:00
Frantisek Sumsal
0f90d4f0c3 test: add a couple of tests for nss-mymachines 2023-06-28 17:04:31 +02:00
Lennart Poettering
f70c90f5ca analyze: add new "pcrs" verb
It shows the PCRs we know about along with their name strings and
current values.
2023-06-28 16:50:50 +02:00