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

5181 Commits

Author SHA1 Message Date
Daan De Meyer
58f38e0a28 tests: Don't override QemuKvm= value if TEST_NO_KVM=0
Let's disable KVM if TEST_NO_KVM=1 is set but let's not specify anything
if it's not set so the QemuKvm= setting from mkosi.conf is used.

(cherry picked from commit c8e7cfeddc)
2024-09-10 14:56:05 +02:00
Yu Watanabe
dda8cb4a8e test: fix indentation
(cherry picked from commit fe6049d021)
2024-09-10 14:56:05 +02:00
Yu Watanabe
69282da9aa test: add test case for systemd-repart --seed=random
For issue #34257.

(cherry picked from commit 56d6ebd404)
2024-09-10 14:56:05 +02:00
Yu Watanabe
44dc95690c test: add test case that 'nspawn --network-veth' enables IP forwarding
(cherry picked from commit 08779d7c55)
2024-09-10 14:56:05 +02:00
Yu Watanabe
93759103e6 test: allow to skip matrix_run_one() if $TEST_MATCH_TESTCASE is set
(cherry picked from commit 7908e1d459)
2024-09-10 14:56:05 +02:00
Daan De Meyer
0eec580add Add $SYSTEMD_IN_CHROOT to override chroot detection
When running unprivileged, checking /proc/1/root doesn't work because
it requires privileges. Instead, let's add an environment variable so
the process that chroot's can tell (systemd) subprocesses whether
they're running in a chroot or not.

(cherry picked from commit 2701c2f67d)
2024-08-19 07:49:55 +02:00
Luca Boccassi
a08ab811de test: add TEST_SKIP to mkosi integration test wrapper
Takes a space-separate list of test names, allows to skip one or more tests

(cherry picked from commit ddc91af4ea)
2024-08-15 14:04:42 +01:00
Daan De Meyer
c3a6aa495b test: Use usual setup in integration-test-setup script
(cherry picked from commit db043a9b1a)
2024-08-15 14:04:41 +01:00
Daan De Meyer
274d5bf224 test: Fix section of StateDirectory=
(cherry picked from commit dba138b863)
2024-08-15 14:04:41 +01:00
Nick Rosbrook
6f57f9b8aa core/unit: do not use unit path cache in unit_need_daemon_reload()
When unit_need_daemon_reload() calls unit_find_dropin_paths() to check
for new drop-in configs, the manager's unit path cache is used to limit
which directories are considered. If a new drop-in directory is created,
it may not be in the unit path cache, and hence unit_need_daemon_reload()
may return false, despite a new drop-in being present. However, if a
unit path cache is not given to unit_file_find_dropin_paths() at all,
then it behaves as if the target path was found in the unit path cache.

So, to fix this, adapt unit_find_dropin_paths() to take a boolean
argument indicating whether or not to pass along the unit path cache.
Set this to false in unit_need_daemon_reload().

Fixes #31752

(cherry picked from commit 82c482d573)
2024-08-15 14:04:41 +01:00
Luca Boccassi
195124fd1c test: note in README how to get full list of Ubuntu CI jobs
(cherry picked from commit 79488ac003)
2024-08-15 14:04:41 +01:00
Nick Rosbrook
edf52384c2 sysusers: check if requested group name matches user name in queue
When creating a user, check if the requested group name matches a user
name in the queue. If that matched user name is also going to be a group
name, then use it for the new user too. In other words, allow the
following:

 u foo -
 u bar -:foo

when both foo and bar are new users.

Fixes #33547

(cherry picked from commit 18a8f03e51)
2024-08-15 14:04:41 +01:00
Yu Watanabe
b50419e838 systemctl: gracefully adjust bus transport and runtime scope when --boot-loader-entry=help
This fixes the following assertion:
===
SYSTEMD_LOG_LEVEL=debug systemctl --user -H foo --boot-loader-entry=help
Assertion 'transport != BUS_TRANSPORT_REMOTE || runtime_scope == RUNTIME_SCOPE_SYSTEM' failed at src/shared/bus-util.c:284, function bus_connect_transport(). Ignoring.
Failed to connect to bus: Operation not supported
===

Fixes a bug introduced by 97af80c5a7.
Fixes #33661.
Fixes oss-fuzz#70153.

(cherry picked from commit 1056457d11)
2024-08-15 14:04:41 +01:00
Arnaud Patard
74f830e048 src/pcrlock/pcrlock.c: Handle empty pcrlock.d directories
Running the following commands:

  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock predict --pcr=1+2+3+4+5+16

Will result in:

...
Floating point exception

Running the following commands:
  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock make-policy --pcr=1+2+3+4+5+16

Will result to this (partial) log:
...
Predicted future PCRs in 133us.
[]
...
Written policy digest 0000000000000000000000000000000000000000000000000000000000000000 to NV index 0x1921da6
...

So, add missing checks to handle gracefully cases where there's no variant
inside the component.

Signed-off-by: Arnaud Patard <arnaud.patard@collabora.com>
(cherry picked from commit e7a93e7521)
2024-08-15 14:04:41 +01:00
Daan De Meyer
df3736d149 test: Add a way to quickly iterate on an integration test
Rebuilding the integration test every time is very slow. Let's
introduce a way to iterate on an integration test without rebuilding
the image every time. By making a btrfs snapshot before we run the
integration test, we can then systemctl soft-reboot after running
the test to restore the rootfs to a pristine state before running
the test again.

As /run/nextroot will get nuked on reboot or soft-reboot, we introduce
a tmpfiles snippet to make sure it is recreated every (soft-)reboot
and adapt the existing tests to deal with this new symlink.

(cherry picked from commit af153e36ae)
2024-08-15 14:04:41 +01:00
Daan De Meyer
ad43f87ae8 test: Implement TEST_SHELL for mkosi based test runner
TEST_SHELL can be used to get a shell in the integration test
environment without actually immediately starting the test.

(cherry picked from commit dd1c01b20f)
2024-08-15 14:04:41 +01:00
Daan De Meyer
039af94fb5 test: Rename INTERACTIVE_DEBUG to TEST_SHELL
(cherry picked from commit 33f400a9e0)
2024-08-15 14:04:41 +01:00
Frantisek Sumsal
86d89f4a10 test: don't use /skipped for subtests
Since, at least the old framework, checks for the presence of the file
at the end and marks the whole test as skipped if it exists.

Resolves: systemd/systemd-centos-ci#728
(cherry picked from commit 4d1fbe53c1)
2024-08-15 14:04:41 +01:00
Frantisek Sumsal
2e2371c5b5 test: attempt to install sshd-session from multiple places
On Fedora the sshd-session binary is under /usr/libexec/openssh/ so
cover this path as well in the old framework.

Follow-up for aaa7b36bd1.

(cherry picked from commit ce2344bbee)
2024-08-15 14:04:41 +01:00
Michal Sekletar
1a3d8368bc socket: fix socket activation of stopped services with pinned FD store
(cherry picked from commit 941a12dcba)
2024-08-15 14:04:41 +01:00
Daan De Meyer
091c4820c4 exec-credential: Skip duplicate credentials in load_credential_glob()
We document that when multiple credentials of the same name are found,
we use the first one found so let's actually implement that behavior.

(cherry picked from commit 3de13e6148)
2024-08-15 14:04:41 +01:00
Dan Nicholson
b5448c16f8 firstboot: fix root params with creds and prompting disabled
Remove an early return that prevents --prompt-root-password or
--prompt-root-shell and systemd.firstboot=off using credentials. In that case,
arg_prompt_root_password and arg_prompt_root_shell will be false, but the
prompt helpers still need to be called to read the credentials. Furthermore, if
only the root shell has been set, don't overwrite the root password.

(cherry picked from commit 35bc4c3424)
2024-08-15 14:04:41 +01:00
Dan Nicholson
847dd914d0 firstboot: handle missing root password entries
If /etc/passwd and/or /etc/shadow exist but don't have an existing root entry,
one needs to be added. Previously this only worked if the files didn't exist.

(cherry picked from commit 2319154a6b)
2024-08-15 14:04:41 +01:00
Dan Nicholson
21d270d38f firstboot: create locked and empty root passwords consistently
Although locked and empty passwords in /etc/passwd are treated the same, in all
other cases the entry is configured to read the password from /etc/shadow.

(cherry picked from commit 5088de9daa)
2024-08-15 14:04:41 +01:00
Dan Nicholson
fdf270a89e test: extend firstboot testing
Several features were not being tested or weren't being evaluated thoroughly.

(cherry picked from commit 38688bbc8f)
2024-08-15 14:04:41 +01:00
Daan De Meyer
852be5a77f test: Don't mount build sources into image when running non-interactively
(cherry picked from commit 578ee05155)
2024-08-15 13:08:37 +01:00
Michal Koutný
8ea1e6450c test: Fail cgroup delegation test when user cannot be created
It means: a) user cannot be created, something's wrong in the
test environment -> fail the test; b) user already exists, we shall not
continue and delete (foreign) user.

(cherry picked from commit 3e6e3e6d40)
2024-08-15 13:08:37 +01:00
Daan De Meyer
161286e989 resize-fs: Put minimal ext4 size in the same ballpark as the other filesystems
TEST-46-HOMED fails on ext4 because the filesystem is deemed to small
for activation by cryptsetup. Let's bump the minimal filesystem size for
ext4 a bit to be in the same ballpark as ext4 and btrfs to avoid weird
errors due to impossibly small filesystems.

Also use U64_MB while we're touching this.

(cherry picked from commit ae07feb401)
2024-08-15 13:08:37 +01:00
Michal Koutný
64b63f6cd0 test: Reorganize testcase of cgroup delegation
There are multiple subtests, just move them around into functions
(leveraging the testcase_* convention) to make space for new related
subtests.

(cherry picked from commit 4f0541dc59)
2024-08-15 13:08:37 +01:00
Daan De Meyer
67ad9221b7 TEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option
This allows mkosi to combine fstab.extra with its own fstab.extra so
that it doesn't override the one we pass for the test.

(cherry picked from commit ebe17e3f9e)
2024-08-15 13:08:37 +01:00
Luca Boccassi
277204f1a3 test: fix D-Bus policy override for TEST-73-LOCALE
We don't need to allow non-root, and the policy needs to specify destination
and interface too, to narrow it down

Follow-up for 7b5c38a91d

(cherry picked from commit a4c436c9d8)
2024-08-15 11:06:58 +01:00
Mike Yuan
6a3cb4cd11 core/unit: ignore dropins for masked units completely when checking need_reload
Follow-up for 19a44dfe45

If a drop-in is set from upper level, e.g. global unit_type.d/,
even if a unit is masked, its dropin_paths would still be partially
populated. However, unit_need_daemon_reload() would always
compare u->dropin_paths with empty strv in case of masked units,
resulting in it always returning true. Instead, let's ignore
dropins entirely here.

Fixes #33672

(cherry picked from commit 11b3775f51)
2024-07-22 14:27:30 +02:00
David Tardon
f81659f5f3 test: add a reproducer for #33672
(cherry picked from commit 8b6de9e638)
2024-07-22 14:27:30 +02:00
Mike Yuan
7da84cc154 test-execute: ExecStop= and friends should not get credentials
See #32583

(cherry picked from commit 60b218e36e)
2024-07-22 14:27:30 +02:00
Luca Boccassi
8f58652f5e test: override blocking localed policy in TEST-73-LOCALE
On Debian and derivatives writing calls to localed are blocked as other
tools are used to change settings, override that policy for the tests

(cherry picked from commit 7b5c38a91d)
2024-07-22 14:27:30 +02:00
Daan De Meyer
a40eb432cb test: Set priority for TEST-73-LOCALE
I don't know why yet, but TEST-73-LOCALE can take more than 10
minutes. Until we figure out why, let's give it a higher priority
so it doesn't bottleneck the test run.

(cherry picked from commit 14963ea90d)
2024-07-22 10:26:01 +01:00
Daan De Meyer
172ffeb813 TEST-06-SELINUX: Disable RuntimeBuildSources=
Otherwise fixfiles will try to relabel it which could potentially
lead to disaster. We also change the recommendation in HACKING.md
to set the default so that TEST-06-SELINUX can override it.

(cherry picked from commit 575f954b5d)
2024-07-22 10:26:01 +01:00
Daan De Meyer
2fd3514456 test: Add missing --no-rebuild to doc
Otherwise meson will try to rebuild all targets.

(cherry picked from commit b5eaa52d49)
2024-07-22 10:26:01 +01:00
Daan De Meyer
c54eab5dd0 mkosi: Streamline running the integration tests without building systemd
Let's document in detail how to build the integration test image and run
the integration tests without building systemd. To streamline the process,
we stop automatically using binaries from build/ when invoking mkosi directly
and don't automatically use a tools tree anymore if systemd on the host is too
old. Instead, we document these options in HACKING.md and change the mkosi meson
target to automatically use the current build directory as an extra binary search
path for mkosi.

(cherry picked from commit d279ec4a50)
2024-07-18 21:14:03 +02:00
Daan De Meyer
102ed56c61 mkosi: Remove enforcing=0 from default kernel command line
We already have selinux=0 in the default kernel command line so
enforcing=0 is redundant. Instead, pass in enforcing=0 when we
enable selinux in TEST-06-SELINUX.

(cherry picked from commit f5c44df929)
2024-07-18 21:12:25 +02:00
Daan De Meyer
1be0b1f54b TEST-13-NSPAWN: make sure we don't load libnss_systemd
Let's make sure we don't load libnss_systemd.so from bash as the
necessary environment variables aren't set to make that work when
we're running with sanitizers enabled.

We can't add a sanitizer wrapper for bash as the wrapper runs using
bash so you end up in a loop.

(cherry picked from commit 5ac0dc70ff)
2024-07-16 15:15:21 +02:00
Daan De Meyer
89904fc10c systemd-networkd-tests: Skip tests requiring dhcpd if it is not available
dhcpd is not available on CentOS Stream 10

See https://github.com/systemd/systemd/issues/33717

(cherry picked from commit 985d5b4bc2)
2024-07-16 15:15:08 +02:00
Daan De Meyer
c3342c3dc7 TEST-55-OOMD: Remove the opensuse user@ dropin
Required to make TEST-55-OOMD pass on OpenSUSE.

(cherry picked from commit f65ec2e904)
2024-07-16 15:15:01 +02:00
Daan De Meyer
1a995b9d66 TEST-64-UDEV-STORAGE: Use max_ioqpairs instead of num_queues
Fixes a deprecation warning from qemu.

(cherry picked from commit d97b48176b)
2024-07-16 15:14:47 +02:00
Daan De Meyer
a8a7a6716e test: do not attempt to set xattr on tmpfs
This is only possible since a recent kernel version, and fails otherwise,
like on CentOS 9

(cherry picked from commit ff8c89aa5a)
2024-07-16 15:14:28 +02:00
Luca Boccassi
976a0d998e test: install split-out sshd-session binary if present
Archlinux split out one ssh binary, install it in the legacy test
setup if present for the tests that need ssh

(cherry picked from commit aaa7b36bd1)
2024-07-11 13:48:52 +02:00
Daan De Meyer
54eb9b9301 TEST-06-SELINUX: Various fixes
- Stop installing the policy in the initramfs as it's not really
supported anyway (https://github.com/fedora-selinux/selinux-policy/issues/2221)
- Stop relabeling on first boot and prefer to do it at image build time
- Disable mkosi relabeling by default but enable it in CI
- Build image as root in CI so the SELinux relabeling works properly

(cherry picked from commit dedd712dd9)
2024-07-11 12:48:41 +02:00
Daan De Meyer
74475a5169 test: Switch to ncat instead of nc
ncat is available in CentOS Stream 9 without having to enable EPEL.

(cherry picked from commit e842deeac6)
2024-07-11 12:48:24 +02:00
Daan De Meyer
0c51e28088 TEST-55-OOMD: Switch to stress-ng
stress-ng is available in OpenSUSE and in CentOS Stream without needing
EPEL so let's switch to it instead of stress.

(cherry picked from commit 3e3a15c06e)
2024-07-11 12:48:18 +02:00
Daan De Meyer
00bcc619db mkosi: Adapt configuration to take into account configuration rework
In https://github.com/systemd/mkosi/pull/2847, the '@' specifier is
removed, CLI arguments take priority over configuration files again
and the "main" image is defined at the top level instead of in
mkosi.images/. Additionally, not every setting from the top level
configuration is inherited by the images in mkosi.images/ anymore,
only settings which make sense to be inherited are inherited.

This commit gets rid of all the usages of '@', moves the "main" image
configuration from mkosi.images/system to the top level and gets rid
of various hacks we had in place to deal with quirks of the old
configuration parsing logic.

We also remove usages of Images= and --append as these options are
removed by the mentioned PR.

(cherry picked from commit 20345a86b7)
2024-07-09 15:18:51 +02:00
Luca Boccassi
abba1e6bc2 sysusers: handle NSS errors gracefully
If the io.systemd.DynamicUser or io.systemd.Machine files exist,
but nothing is listening on them, the nss-systemd module returns
ECONNREFUSED and systemd-sysusers fails to creat the user/group.

This is problematic when ran by packaging scripts, as the package
assumes that after this has run, the user/group exist and can
be used. adduser does not fail in the same situation.

Change sysusers to print a loud warning but otherwise continue
when NSS returns an error.

(cherry picked from commit fc9938d6f8)
2024-07-05 20:00:04 +02:00
Luca Boccassi
160b539a9d os-util: avoid matching on the wrong extension-release file
The previous commit tries to extract a substring from the
extension-release suffix, but that is not right, it's only the
images that need to be versioned and extracted, use the extension-release
suffix as-is. Otherwise if it happens to contain a prefix that
matches the wrong image, it will be taken into account.

Follow-up for 37543971af

(cherry picked from commit 92d1fe3efa)
2024-07-05 20:00:04 +02:00
Franck Bui
ea92f16422 test: fix TEST-74-AUX-UTILS.ssh.sh on SUSE
(cherry picked from commit 252542ffc3)
2024-07-05 20:00:04 +02:00
Franck Bui
f52475dcf3 test: preserve symlink in inst_recursive()
On SUSE this function is used to copy symlinks installed in *.wants/
directories.

(cherry picked from commit 855bad331e)
2024-07-05 20:00:04 +02:00
Franck Bui
10b7e0a0af test: fix TEST-24-CRYPTSETUP on SUSE
/etc/systemd/journald.conf.d drop-in dir already exists on SUSE.

(cherry picked from commit 56a894e888)
2024-07-05 20:00:04 +02:00
Franck Bui
4f7d6885a1 test: install /etc/hosts
Needed for resolving the "localhost" hostname.

(cherry picked from commit a09825ce9f)
2024-07-05 20:00:04 +02:00
Daniel Rusek
e94e33b566 test: split the resolved test suite into separate test cases
Although being far from ideal and the first two test cases have to be run
before the setup phase otherwise they will fail, it still makes the test
suite look much better and easier to read

(cherry picked from commit a9d472d6e4)
2024-07-05 20:00:04 +02:00
Daan De Meyer
6c8e99dedd TEST-54-CREDS: Use UEFI firmware if available
On aarch64, SMBIOS is only available when using UEFI, so let's make
sure that the creds test uses UEFI when available so that it can
read creds from SMBIOS when running in a virtual machine.

(cherry picked from commit 436474dd43)
2024-07-05 20:00:04 +02:00
Daan De Meyer
78631dcafd TEST-18-FAILUREACTION: Set auto firmware
This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.

(cherry picked from commit f392be9e77)
2024-07-05 20:00:04 +02:00
Daan De Meyer
71fb49d02c TEST-09-REBOOT: Set auto firmware
This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.

(cherry picked from commit 3cf38516bb)
2024-07-05 20:00:04 +02:00
Daan De Meyer
938f7b6f29 TEST-06-SELINUX: Explicitly pull in autorelabel.service
(cherry picked from commit 7c04137a6f)
2024-07-05 20:00:04 +02:00
Daan De Meyer
37412c952d TEST-70-TPM2: Use UEFI firmware if available
On x86 this doesn't matter but on aarch64 we need to make sure UEFI
is used so that /sys/kernel/security/tpm0/binary_bios_measurements
is there which is required for TEST-70-TPM2.

(cherry picked from commit 98f2a332cb)
2024-07-05 20:00:04 +02:00
Daan De Meyer
711f843e3a TEST-45-TIMEDATE: Use syslog identifier journalctl match
Using a unit match is racy whereas a syslog identifier match is
reliable.

(cherry picked from commit 24284098a4)
2024-07-05 20:00:04 +02:00
Daan De Meyer
dc0167b674 TEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic
When running the test on aarch64 the symlinks look as follows:

"""
[root@H ~]# ls /dev/disk/by-path
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0       platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part1  platform-4010000000.pcie-pci-0000:00:05.0-nvme-16
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part  platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part2  platform-4010000000.pcie-pci-0000:00:05.0-nvme-17
"""

So let's make the PCI patterns a little more generic so they match
both the x86 and the aarch64 paths.

(cherry picked from commit 72d121b601)
2024-07-05 20:00:04 +02:00
Daan De Meyer
ffc8126cc6 test: pull in multi-user.target explicitly
Let's make sure we pull in multi-user.target so that we get a console
when a test fails and we're running meson test with --interactive.

(cherry picked from commit 32f3617fd7)
2024-07-05 20:00:04 +02:00
Daan De Meyer
b908f492bc TEST-64-UDEV-STORAGE: Fix python 3.9 compatibility
Using double quotes in f-strings only works from python 3.12 onwards.
Use single quotes to make sure python 3.9 works as well.

Also clean up quotes a little in general.

(cherry picked from commit 4e469c0af2)
2024-07-05 20:00:04 +02:00
Daan De Meyer
1c4f25c296 TEST-64-UDEV-STORAGE: Use bus pci slot 1 instead of 0
Trying to use bus pci slot 0 fails on aarch64 so let's use 1 instead.

The error:

"""
qemu-system-aarch64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Unsupported PCI slot 0 for standard hotplug controller. Valid slots are between 1 and 31.
"""

(cherry picked from commit 7f07f9c8cd)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
9663bb7410 TEST-58-REPART: reverse order of diff args
I expect the test output to be the second argument, so we're diffing "expected"
and "output", not the other way around.

I noticed this when working on https://github.com/systemd/systemd/pull/33081.

(cherry picked from commit 6bb3ea655d)
2024-07-05 20:00:04 +02:00
Yu Watanabe
81acc5b39a test-execute: add a test case for issue #33299
(cherry picked from commit 956a9f00b4)
2024-07-05 20:00:04 +02:00
Yu Watanabe
54910267ba test-network: check if static routes not overridden by NDisc routes
(cherry picked from commit 62fb079a3b)
2024-07-05 20:00:04 +02:00
Luca Boccassi
058fca7e6c mkosi: add support for TEST_SAVE_JOURNAL to integration test wrapper
Same variable and values as supported by the shell suite

(cherry picked from commit 59d4970a55)
2024-07-05 20:00:04 +02:00
Luca Boccassi
771bb489bf test: skip TEST-69-SHUTDOWN on Debian
There is a regression in the login package, skip the test until
it is fixed. https://bugs.debian.org/1075733

(cherry picked from commit 92d9d5ca70)
2024-07-05 11:38:42 +02:00
Luca Boccassi
c26e56d08f install: allow removing symlinks even for units that are gone
If a symlink is leftover, still allow cleaning it up via 'disable'. This
happens when a unit is stopped and removed, but not disabled, and a reload
has already happened. At that point, cleaning up the old symlinks becomes
impossible through the APIs, and needs to be done manually. Always allow
cleaning up symlinks, if they exist, by only erroring out if there is an
OOM.

Follow-up for f31f10a620

(cherry picked from commit 5163c9b1e5)
2024-06-18 20:41:01 +02:00
Yu Watanabe
4cc6da9a5d test-network: mention that the captive portal option is supported since v2.20
The current latest release is v2.19, hence the test is typically skipped now.

(cherry picked from commit 4f6d8ab076)
2024-06-18 20:41:01 +02:00
Luca Boccassi
7d65709901 test: use 'auto' instead of 'uefi' for automated fallback
mkosi will prefer UEFI if the architecture supports it, but fallback
to 'linux' if it doesn't.

(cherry picked from commit 80468db8fa)
2024-06-18 20:41:01 +02:00
Luca Boccassi
6178aa4bbc test: support TEST_NO_QEMU in mkosi integration wrapper
Same as the old integration test suite, allow skipping tests that
require qemu.
ppc64el's vsock support doesn't appear to work, so we'll skip it,
as it is already done in the legacy framework.

(cherry picked from commit 464d182b3e)
2024-06-18 20:41:01 +02:00
Luca Boccassi
a36cb5660e test: support TEST_NO_KVM
The shell integration suite allows to manually deselect KVM, so
suppor the same env var for the same purpose in python.

(cherry picked from commit 7d2701e7d1)
2024-06-18 20:41:01 +02:00
Luca Boccassi
df1e7d9572 test: drop obsolete comment
We want to keep various logic here instead of mkosi, so drop the
temporary comment

(cherry picked from commit 626518ecd5)
2024-06-18 20:41:01 +02:00
Luca Boccassi
51a2e7be5e test: drop unneeded firmware: uefi setting
These tests no longer need this, as they are running in nspawn, drop it

(cherry picked from commit f44fc531c9)
2024-06-18 20:41:01 +02:00
Luca Boccassi
50b53b8221 test: check the skip condition before installing additional files
(cherry picked from commit e1daedb4be)
2024-06-18 20:41:01 +02:00
Frantisek Sumsal
4a468387ac 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.

(cherry picked from commit 2ac0e52f29)
2024-06-18 20:41:01 +02: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