Commit graph

4758 commits

Author SHA1 Message Date
Lennart Poettering 36769db1b0 ci: update tests to showcase new option a bit 2024-04-18 18:12:24 +02:00
Yu Watanabe 88382e8dab test: fix typo
Follow-up for 236634c82c.
2024-04-17 13:29:39 +09:00
Yu Watanabe e27f2ad6be
Merge pull request #32300 from mrc0mmand/assorted-tweaks
test: split TEST-50-DISSECT into smaller parts
2024-04-17 11:52:30 +09:00
Sam Leonard b6183109cb
test-64-udev-storage: partition disk inside testcase - testcase_multipath_basic_failover 2024-04-16 17:02:31 +01:00
Sam Leonard 211062e3b5
test-64-udev-storage: partition disk inside testcase - testcase_virtio_scsi_identically_named_partitions 2024-04-16 16:18:55 +01:00
Sam Leonard 8d82e39046
test-64-udev-storage: partition disk inside testcase - testcase_long_sysfs_path 2024-04-16 16:18:36 +01:00
Frantisek Sumsal 236634c82c test: rework systemd-sysext test
Let's rework the test a bit, namely:
  - condense the code a bit
  - drop unnecessary braces around variables
  - drop unnecessary explanations around `touch` calls
  - drop/rename functions to make the code more self-explanatory
  - simplify cleanup a bit
  - create R/O bind mounts directly (supported since util-linux 2.27)
2024-04-16 14:25:57 +02:00
Frantisek Sumsal 5f42fae2f1 test: simplify unit check 2024-04-16 14:25:57 +02:00
Frantisek Sumsal 5d259f1236 test: split some overly long lines
Let's get the line count back up again by splitting some overly long
lines in hopes to make the code slightly more readable.
2024-04-16 14:25:57 +02:00
Frantisek Sumsal ccb2671539 test: split TEST-50-DISSECT into smaller parts
As the current version has almost 2k lines.
2024-04-16 14:25:57 +02:00
Yu Watanabe 78d5bad2f5
Merge pull request #32294 from yuwata/network-generator-creds
network-generator: also load drop-ins for networkd.conf from credentials
2024-04-16 16:42:59 +09:00
Yu Watanabe 9c202ba2e2 test: add test case for 'networkctl cat' without arguments 2024-04-16 13:31:14 +09:00
Yu Watanabe 9a4a8fbe48 test: add test case for network.conf.* credential 2024-04-16 12:45:08 +09:00
Yu Watanabe a3e4edd1af test: add test for systemd-udev-load-credentials.service 2024-04-16 10:35:13 +09:00
Yu Watanabe b2800ec597 udevadm-control: check if control command really specified
Previously, 'udevadm control' only checked the number of the arguments.
So, if only `--timeout` is specified, it spuriously did nothing and succeeded.
This makes the command request at least one control command.
2024-04-16 09:42:20 +09:00
Luca Boccassi a4328b284e
Merge pull request #32258 from yuwata/network-tc-fix-stack-overflow
network/tc: fix stack overflow
2024-04-15 22:34:39 +02:00
Yu Watanabe ae9fd433d6
Merge pull request #32194 from henryli001/lihl/add-defaultUseDomains-config
network: add mechanism to configure default UseDomains= setting
2024-04-14 13:40:06 +09:00
Henry Li fb57300743 network: add mechanism to configure default UseDomains= setting, update man page and add test 2024-04-13 16:54:31 -07:00
Yu Watanabe e6fa91195b test-network: add test for stack overflow in qdisc_drop() and tclass_drop() 2024-04-13 09:39:55 +09:00
Frantisek Sumsal 844af666ed test: add instructions on how to run Coverity locally
This requires a Coverity license, so the usefulness of the instructions
is somewhat limited, but at least I won't have to re-discover everything
from scratch when I need to debug something Coverity-related again in the
future.
2024-04-12 14:42:00 +02:00
Yu Watanabe 9944629eee network/ndisc: fix verification of sender of Redirect message
The sender must be the first-hop router of the destination. Previously,
we only accepted Redirect messages whose sender is the current default
router with the highest priority.

See RFC 4861 section 8.1 for more details.

Fixes #31981.
2024-04-12 04:59:42 +09:00
Yu Watanabe 2e73aa507b network/ndisc: do not set per-route MTU and hop limit
Setting MTU announced in RA message to routes is problematic, as the
value may be larger than the device MTU (IFLA_MTU), and in such case the
route cannot be used.

These two properties are now set per-interface, and gracefully handled
such invalid cases. Hence not necessary to set them to each route.

Follow-up for #32195.
2024-04-12 04:59:38 +09:00
Frantisek Sumsal 6d13aacaac test: make sd-journal-gatewayd tests even more debug-able
Unfortunately bfd30e8af6 is not enough and the test fails, that still
occasionally occur, don't provide enough information to see what's
wrong. Let's rework the test a little to improve this, namely:

  - redirect curl's output into a temporary file instead of piping it
    directly into the "check" expression; that way we can simply dump
    the temporary file when the test fails, providing potentially
    crucial information. We don't want to always dump everything to
    stdout, as some of the tests request an entire system journal (note
    that shell redirection instead of `curl -o file` is used
    intentionally, so the output file is always nuked first)
  - by dropping the pipes in curl commands we can re-enable pipefail
  - also, split some very long commands to multiple lines to (slightly)
    improve readability

Follow-up for bfd30e8af6.
2024-04-11 14:42:45 +02:00
Frantisek Sumsal 8d9cdb31f7 test: make the output of TEST-69 less painful to read
The logs from TEST-69 still contain a lot of unnecessary shell
metacharacters, so to make the output more readable let's just set
TERM=dumb, instead of having to strip everything semi-manually. Also,
move the related --background= tweak to TEST-69, since it's relevant
only for that particular test.

Follow-up for 8d4bfd38ed.
2024-04-11 11:35:17 +02:00
Luca Boccassi 798ea5c05a
Merge pull request #32181 from YHNdnzj/open-file
Some fixes/improvements for OpenFile=
2024-04-10 23:15:56 +01:00
Luca Boccassi d0ea800943
Merge pull request #32195 from yuwata/network-ndisc-mtu
network: several cleanups for IPv6 MTU
2024-04-10 23:12:21 +01:00
Luca Boccassi bf5e509840
Merge pull request #32166 from yuwata/network-rfc7217-dad
network: generate another address on conflict
2024-04-10 22:59:01 +01:00
Mike Yuan 48c21790ba
test: merge TEST-77-OPENFILE into TEST-23-UNIT-FILE
And add coverage for #32179
2024-04-10 21:49:28 +08:00
Yu Watanabe a0430b0d95 test-network: add test case for ndisc MTU option 2024-04-10 12:24:33 +09:00
Frantisek Sumsal 515eb678a0 test: wait until the test container is fully booted up
TEST-69 still occasionally times out in CI and appears to be stuck on
boot, so let's see if this helps the situation a bit.
2024-04-09 21:39:46 +02:00
Frantisek Sumsal 8d4bfd38ed test: disable background color for nspawn containers
As it makes the logs really messy in certain tests.
2024-04-09 21:39:46 +02:00
Frantisek Sumsal 04f0c6752c test: set pexpect's logfile early
So we capture the container's boot as well.
2024-04-09 21:39:46 +02:00
Frantisek Sumsal 721e78ff73 test: give sd-resolved enough time to timeout
The timeout on sd-resolved's side is 5-10s (UDP or TCP), but dig's
default timeout is 5s. Let's give sd-resolved enough time to timeout
before either giving up or checking if it served stale data on dig's
side.

Resolves: #31639
2024-04-09 21:39:46 +02:00
Frantisek Sumsal bfd30e8af6 test: let curl show a potential error in silent mode
I collected a couple of fails in this particular test, but without any
output they're impossible to debug. Let's make this slightly less
annoying and let curl show an error (if any) even in silent mode.

This patch uncovers that curl has been (silently) complaining about not
being able to write to the output destination, because `grep -q`
short-circuits on the first match and doesn't bother reading the rest,
so replace `grep -q` with `grep ... >/dev/null` to force grep to always
read the whole thing from curl.
2024-04-09 21:39:46 +02:00
Frantisek Sumsal d4e11f30bc test: forward journal to console in TEST-24-CRYPTSETUP
If we fail to mount the encrypted /var during boot we're left with
nothing to debug, so let's do the same thing we do for TEST-08-INITRD
and forward journal to the console.
2024-04-09 21:39:46 +02:00
Yu Watanabe ce4ed0ad99 test-network: add test case for regenerating prefix stable address on conflict
For issue #31605.
2024-04-10 04:36:03 +09:00
Luca Boccassi 0f0d001254
Merge pull request #32104 from yuwata/network-ndisc-redirect
network/ndisc: add support for Redirect message
2024-04-08 20:03:32 +01:00
Luca Boccassi 1b0cc135d0 test-execute: check for s390x first and duplicate test
s390x will define both s390x and s390, so exec-personality-s390.service is ran
in both cases but fails on s390x, as the personality returned is s390x.
Split the test and check specifically for s390x.
2024-04-08 07:29:06 +09:00
Lennart Poettering 625646815b test: add integration test for unpriv mountfsd/nsresourced 2024-04-06 16:09:10 +02:00
Luca Boccassi 3abc3671f5
Merge pull request #31131 from poettering/dlopen-kmod
turn libkmod into a dlopen() dependency, too
2024-04-06 13:19:27 +01:00
Zbigniew Jędrzejewski-Szmek c1e7f938ca
Merge pull request #31435 from bluca/portable_fix_versioned
portable: assorted bug fixes
2024-04-05 17:04:17 +02:00
Yu Watanabe 9dcdf16b25 test-network: add test cases for Redirect and Neighbor Advertisement message handling 2024-04-05 06:22:42 +09:00
Yu Watanabe 36ca167220
Merge pull request #31373 from yuwata/network-neighbor-advertisement
network: add basic support of neighbor advertisement
2024-04-05 05:54:12 +09:00
Zbigniew Jędrzejewski-Szmek cdba129b71 TEST-50: add tests for riscv{32,64}
Requested for the testing of F40 riscv bringup. Numbers copied from
https://uapi-group.org/specifications/specs/discoverable_partitions_specification/.

It'd be nice to do the same in TEST-58, but the code there is rather involved
and I don't have a system to test on. We can probably try that later on when F40
is available.
2024-04-04 20:07:57 +02:00
Yu Watanabe 87a33c0740 netowrk/ndisc: drop NDisc configurations when received NA without Router flag
Closes #28421.
2024-04-05 02:16:03 +09:00
Daan De Meyer 7b62a246a6
Merge pull request #32033 from DaanDeMeyer/unit-creds
debug-generator: Add unit and drop-in credentials
2024-04-04 18:27:20 +02:00
Lennart Poettering 1d98716ef7 libkmod: turn into dlopen() dependency
As it turns out libkmod has quite a bunch of deps, including various
compressing libs and similar. By turning this into a dlopen()
dependency, we can make our depchain during install time quite a bit
smaller. In particular as inside of containers kmod doesn't help anyway
as CAP_SYS_MODULE is not available anyway.

While we are at it, also share the code that sets up logging/kmod
context.

After:

$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
    libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
        libaudit.so.1 => /lib64/libaudit.so.1
            libcap-ng.so.0 => /lib64/libcap-ng.so.0
                ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libm.so.6 => /lib64/libm.so.6
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
        libseccomp.so.2 => /lib64/libseccomp.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
    libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
        libacl.so.1 => /lib64/libacl.so.1
            libattr.so.1 => /lib64/libattr.so.1
        libcap.so.2 => /lib64/libcap.so.2
        libcrypt.so.2 => /lib64/libcrypt.so.2
        libgcrypt.so.20 => /lib64/libgcrypt.so.20
            libgpg-error.so.0 => /lib64/libgpg-error.so.0
        liblz4.so.1 => /lib64/liblz4.so.1
        libcrypto.so.3 => /lib64/libcrypto.so.3
            libz.so.1 => /lib64/libz.so.1
        libpam.so.0 => /lib64/libpam.so.0
            libeconf.so.0 => /lib64/libeconf.so.0
        liblzma.so.5 => /lib64/liblzma.so.5
        libzstd.so.1 => /lib64/libzstd.so.1
    libc.so.6 => /lib64/libc.so.6

Before:

$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
    libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
        libaudit.so.1 => /lib64/libaudit.so.1
            libcap-ng.so.0 => /lib64/libcap-ng.so.0
                ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libkmod.so.2 => /lib64/libkmod.so.2
            libzstd.so.1 => /lib64/libzstd.so.1
            liblzma.so.5 => /lib64/liblzma.so.5
            libz.so.1 => /lib64/libz.so.1
            libcrypto.so.3 => /lib64/libcrypto.so.3
            libgcc_s.so.1 => /lib64/libgcc_s.so.1
        libm.so.6 => /lib64/libm.so.6
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
        libseccomp.so.2 => /lib64/libseccomp.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
    libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
        libacl.so.1 => /lib64/libacl.so.1
            libattr.so.1 => /lib64/libattr.so.1
        libcap.so.2 => /lib64/libcap.so.2
        libcrypt.so.2 => /lib64/libcrypt.so.2
        libgcrypt.so.20 => /lib64/libgcrypt.so.20
            libgpg-error.so.0 => /lib64/libgpg-error.so.0
        liblz4.so.1 => /lib64/liblz4.so.1
        libpam.so.0 => /lib64/libpam.so.0
            libeconf.so.0 => /lib64/libeconf.so.0
    libc.so.6 => /lib64/libc.so.6
2024-04-04 18:16:45 +02:00
Daan De Meyer 8595f578fe debug-generator: Add unit and drop-in credentials
These allow adding extra units and drop-ins via credentials.
2024-04-04 16:17:38 +02:00
Daan De Meyer 3cb618084a network-generator: Add logging
We stick to debug logging because in some cases network-generator
will fall back to trying another parsing function if one fails, so
if we return an error it's not necessarily a failure.
2024-04-04 14:46:40 +02:00
Luca Boccassi 26cbb21449
Merge pull request #32019 from bluca/gcrypt_dlopen
gcrypt: dlopenify for libsystemd
2024-04-03 16:10:00 +01:00