Commit graph

5057 commits

Author SHA1 Message Date
Luca Boccassi f44fc531c9 test: drop unneeded firmware: uefi setting
These tests no longer need this, as they are running in nspawn, drop it
2024-06-17 11:34:52 +01:00
Luca Boccassi e1daedb4be test: check the skip condition before installing additional files 2024-06-17 11:34:52 +01:00
Lennart Poettering aa413d5fc6 ci: add superficial --quiet testcase 2024-06-13 11:31:44 +02:00
Lennart Poettering e1ef88e56e test: add test for new varlinkctl features 2024-06-13 09:37:15 +02:00
Frantisek Sumsal 2ac0e52f29 test: dump a simple summary at the end of TEST-02-UNITTEST
Let's dump a list of skipped tests and logs from failed tests at the end
of TEST-02-UNITTEST to make debugging fails in CI slightly less painful.
2024-06-12 14:04:10 +01:00
Lennart Poettering 8c5045f9b2 analyze: add verb for dumping SMBIOS Type #11 data
I find myself wanting to check this data with a quick command, and
browsing through /sys/ manually getting binary data sucks. Hence let's
do add a nice little analysis tool.
2024-06-12 12:48:28 +02:00
Matthieu Baerts (NGI0) 3f69070598 core/socket: allow MPTCP protocol
Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension
that enables a TCP connection to use different paths. It allows a device
to make use of multiple interfaces at once to send and receive TCP
packets over a single MPTCP connection. MPTCP can aggregate the
bandwidth of multiple interfaces or prefer the one with the lowest
latency, it also allows a fail-over if one path is down, and the traffic
is seamlessly re-injected on other paths.

To benefit from MPTCP, both the client and the server have to support
it. Multipath TCP is a backward-compatible TCP extension that is enabled
by default on recent Linux distributions (Debian, Ubuntu, Redhat, ...).
Multipath TCP is included in the Linux kernel since version 5.6 [2]. To
use it on Linux, an application must explicitly enable it when creating
the socket:

  int sd = socket(AF_INET(6), SOCK_STREAM, IPPROTO_MPTCP);

No need to change anything else in the application.

This patch allows MPTCP protocol in the Socket unit configuration. So
now, a <unit>.socket can contain this to use MPTCP instead of TCP:

  [Socket]
  SocketProtocol=mptcp

MPTCP support has been allowed similarly to what has been already done
to allow SCTP: just one line in core/socket.c, a very simple addition
thanks to the flexible architecture already in place.

On top of that, IPPROTO_MPTCP has also been added in the list of allowed
protocols in two other places, and in the doc. It has also been added to
the missing_network.h file, for systems with an old libc -- note that it
was also required to include <netinet/in.h> in this file to avoid
redefinition errors.

Link: https://www.rfc-editor.org/rfc/rfc8684.html [1]
Link: https://www.mptcp.dev [2]
2024-06-12 00:14:08 +01:00
Yu Watanabe 8843726ac2 test-network: wait a while for addresses to be dropped
Hopefully fixes the following failure:
```
======================================================================
FAIL: test_ipv6_token_prefixstable (__main__.NetworkdRATests.test_ipv6_token_prefixstable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5705, in test_ipv6_token_prefixstable
    self.assertNotIn('2002:da8:1:0:b47e:7975:fc7a:7d6e/64', output) # the 1st prefixstable
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '2002:da8:1:0:b47e:7975:fc7a:7d6e/64' unexpectedly found in
  '19: veth99@veth-peer: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000\n
       inet6 2002:da8:1:0:b47e:7975:fc7a:7d6e/64 scope global tentative dynamic mngtmpaddr noprefixroute \n
          valid_lft 2100sec preferred_lft 1000sec\n
       inet6 2002:da8:1:0:da5d:e50a:43fd:5d0f/64 scope global dynamic mngtmpaddr noprefixroute \n
          valid_lft 2100sec preferred_lft 1000sec\n
       inet6 fe80::1034:56ff:fe78:9abc/64 scope link proto kernel_ll \n
          valid_lft forever preferred_lft forever'
----------------------------------------------------------------------
```
2024-06-11 13:52:41 +01:00
Yu Watanabe 01420b2db5 network/ndisc: use router lifetime as one for redirect route
Previously, we did not set lifetime for redirect route, and redirect
routes were removed only when received a RA from the target address.
Thus, routes that redirect on-link addresses were never removed.

RFCs mention nothing about the lifetime of redirection. But the previous
implementation does not pass the IPv6 Core Conformance Tests.

This makes
- remember all received RAs and manage them by the sender address
  (previously, remembered only one with the highest preference),
- then use the router lifetime as one for redirect route,
- remove redirect route also when the router corresponds to the sender
  address is dropped (previously, considered only target address).

Note, even if we recieve a new RA, we do not update existing redirect
routes. The lifetime of the redirect route is updated only when a new
Redirect message is received.

Closes #32527.
2024-06-06 11:19:55 +01:00
Daan De Meyer 1a48d8549f core: Fix CPUQuotaPerSecUSec unit file serialization
CPUQuota= can deal with float percentages perfectly fine these days
(up to two places after the dot), so let's take that into account
when serializing the value to the transient unit file so we don't lose
precision when specifying e.g. "CPUQuota=0.5%".
2024-06-05 16:50:36 +02:00
Yu Watanabe dadf2bd4f4 test-network: introduce a .network file to protect existing interfaces 2024-06-03 18:41:26 +01:00
Yu Watanabe 653c38b3eb test-network: show PID and Invocation ID of networkd
Then, we can easily find relevant journal entry on failure.
This is especially useful when the test is running with --no-journal.
2024-06-03 18:41:26 +01:00
Yu Watanabe 6fec598290 test-network: flush stream buffer and journals before/after running test 2024-06-03 18:41:26 +01:00
Yu Watanabe 22fa8f6724 test-network: generate debugging logs of networkd-persistent-storage.service 2024-06-03 18:41:26 +01:00
Luca Boccassi 80a3eb5ab5 test: disable TEST-21-DFUZZER in mkosi, as it is very flacky
Can be re-enabled once https://github.com/systemd/systemd/issues/33156
is solved
2024-06-03 19:37:17 +02:00
Luca Boccassi d6243ebedd journald: enable persistent FD Store to fix logging during soft-reboot
A unit with StandardOutput=journal (the default) will get its stdout/stderr sockets
disconnected when journald stops, as the file descriptors on journald's side are
not preserved (it works on restart, as the FD Store keeps them open during restarts).
Set FileDescriptorStorePreserve=yes so that the journal FD's stay open during a soft
reboot, and applications don't get broken stdout/stderr.
2024-06-03 16:30:54 +01:00
Luca Boccassi 88c2ef1f75 Revert "test: Run end.sh when running integration tests with mkosi"
It seems this introduced a regression in the CentOS CI;

14:25:58 FAILED TASKS:14:25:58 -------------
14:25:58 TEST-03-JOBS
14:25:58 TEST-52-HONORFIRSTSHUTDOWN
14:25:58 TEST-63-PATH

Revert for now.

This reverts commit da3c6fc553.
2024-06-03 16:29:23 +01:00
Daan De Meyer 9619fdc102
Merge pull request #33157 from DaanDeMeyer/end
test: Run end.sh when running integration tests with mkosi
2024-06-02 21:04:56 +02:00
Daan De Meyer da3c6fc553 test: Run end.sh when running integration tests with mkosi 2024-06-02 19:15:21 +02:00
Daan De Meyer 7c0ab0cdf2 TEST-16-EXTEND-TIMEOUT: Convert to oneshot service
To match the other service units more and allow adding more
ExecStart= lines via dropins.
2024-06-02 19:15:21 +02:00
Yu Watanabe 46322f2742 test: exit earlier when cgroup user xattr is not supported
Also, use trap for cleaning up the test environment.
2024-06-01 22:35:07 +09:00
Yu Watanabe 5f03c19f7b test: reduce number of 'systemctl daemon-reload' a bit 2024-06-01 22:28:32 +09:00
Yu Watanabe 7faf8987ed test: sync journal in short-living services
This also adjusts LogLevelMax=.

Hopefully, this makes the test much stabler.
2024-06-01 22:25:50 +09:00
Yu Watanabe 77356099ce test-network: add missing sleep()
Fixes a bug introduced by 7ef26afca5.

Fixes #33098.
2024-06-01 08:25:10 +02:00
Daan De Meyer f4a0dd0ef6
Merge pull request #33105 from DaanDeMeyer/sanitizers
Sanitizers
2024-05-31 19:44:05 +02:00
Daan De Meyer 605d72cb14 TEST-21-DFUZZER: Stop marking as slow
This was a workaround to not run TEST-21-DFUZZER without sanitizers.
Now that we're going to get sanitizer support, let's run it by default
again.
2024-05-31 17:26:13 +02:00
Daan De Meyer e690a8cd09 TEST-69-SHUTDOWN: Order after systemd-user-sessions.service
Make sure that we're allowed to login by ordering ourselves after
systemd-user-sessions.service.
2024-05-31 17:26:13 +02:00
Daan De Meyer 80a5f762bb
Merge pull request #33121 from yuwata/test-integration-tests-mkosi
Test: several integration test improvements
2024-05-31 15:40:43 +02:00
Yu Watanabe 1f4345b5ed networkd-test: first wait for interface being configured
DNS setting propagation to resolved may take some time.
2024-05-31 10:00:21 +02:00
Yu Watanabe 7ae191a5ea test: optionally allow to disable user service manager, and disable it on TEST-64
The test triggers many uevents, and running both system and user service
managers make the test slow.
2024-05-31 16:29:19 +09:00
Yu Watanabe 052500a072 test: make it sure that devices are processed by udevd before running subtests 2024-05-31 16:10:55 +09:00
Yu Watanabe 60914351c8 test: lock device on sfdisk or mkfs, and extend timeout
Hopefully fixes #33111.
2024-05-31 16:09:31 +09:00
Luca Boccassi 0630069f0b
Merge pull request #33081 from keszybz/networkctl-formatting
Fix formatting of speeds in networkctl
2024-05-30 16:33:38 +02:00
Daan De Meyer 6b572e88a3 test-network: Add dirs_exist_ok=True to cp_r()
Let's not fail if directories already exist in cp_r().
2024-05-30 12:47:45 +02:00
Daan De Meyer f824a33a79 test-execute: Load systemd-asan-env environment file if available
When DynamicUser= is enabled, we need LD_PRELOAD to be configured
correctly as the tests will load systemd's nss module which will complain
when built with sanitizers if the sanitizer libraries were not loaded
first.
2024-05-30 12:47:45 +02:00
Daan De Meyer 9029f20b35 TEST-02-UNITTESTS: Pass asan environment to units if it is available
Some tests (e.g. test-udev.py) might trigger one of our NSS modules
which means LD_PRELOAD has to be configured properly.
2024-05-30 12:47:45 +02:00
Daan De Meyer aae2990907 TEST-79-MEMPRESS: Load systemd-asan-env if available
Required since we run with DynamicUser=1.
2024-05-30 12:47:45 +02:00
Daan De Meyer 0cd488617c TEST-36-NUMAPOLICY: Skip when running with sanitizers
The test does not work under sanitizers as strace is used. Until the
test is fixed to not use strace let's skip it when running with
sanitizers.
2024-05-30 12:47:43 +02:00
Zbigniew Jędrzejewski-Szmek 11226bf19b shared/format-table: do not print '.0'
This makes output a bit shorter and nicer. For us, shorter output is generally
better.

Also, drop unnecessary UINT64_C macros. The left operand is always uint64_t,
and C upcasting rules mean that it doesn't matter if the right operand is
narrower or signed, the operation is always done on the wider unsigned type.
2024-05-30 11:38:30 +02:00
Daan De Meyer 8acb02f395 TEST-02-UNITTESTS: Fix exit code checks 2024-05-30 09:59:30 +02:00
Daan De Meyer 412e2a6487 TEST-05-RLIMITS: Bump memory limits
When running with sanitizers we need more memory otherwise the unit
gets OOM killed.
2024-05-30 09:59:30 +02:00
Daan De Meyer eb47645e21 test: Use virtio-scsi for keydev drive
Otherwise qemu defaults to ide for which the module isn't always
available (e.g. it's missing in the debian linux cloud images).
2024-05-29 15:24:03 +02:00
Daan De Meyer ac09c21d45 TEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller
The virtio-scsi driver is available in the KVM/cloud kernel
packages provided by distributions whereas the megasas2 driver is
not. Let's switch to virtio-scsi so we can switch back to the KVM/cloud
kernel packages.
2024-05-29 15:24:03 +02:00
Daan De Meyer d12fedd25e mkosi: Run integration tests as root
This allows running integration tests that support it in nspawn
instead of qemu. This both gives extra coverage and speeds things up.
2024-05-29 14:10:50 +02:00
Daan De Meyer 1e5a1bbe02 test: Run tests that don't need a vm in systemd-nspawn
If we're not running the test as root, stick to using a virtual
machine, as mkosi can't do rootless nspawn yet.
2024-05-29 14:10:50 +02:00
Daan De Meyer a635b33214
Merge pull request #32562 from Werkov/test-cgroup-opensuse
Revert "TEST-19-CGROUP: Skip on opensuse"
2024-05-29 11:01:00 +02:00
Yu Watanabe 45af01d311 test-network: update comment about status of kernel regression 2024-05-29 09:07:48 +09:00
Yu Watanabe acddb3cb79 test-network: tun/tap fd may be owned by tentative worker processes
PID1 may invoke a helper process, e.g. sd-close, during the test.
So, processes other than networkd and PID1 may be shown.
```
testtap99: tap pi multi_queue vnet_hdr persist filter
        Attached to processes:systemd-network(2852)(sd-close)(2863)systemd(1)
```

Closes #33055.
2024-05-28 16:39:51 +02:00
Luca Boccassi 78247be91d
Merge pull request #33063 from keszybz/wiki-links
Update wiki links
2024-05-28 16:21:45 +02:00
Yu Watanabe 47e881ee65 test: lock device when sfdisk or mkfs
Or, trigger devices after the command incase the device is dm or md.

Fixes #33056.
2024-05-28 15:43:55 +02:00