Commit graph

4912 commits

Author SHA1 Message Date
Daan De Meyer 5748f13e54 test: Rework integration test definitions
Let's make this behave more like all the rest of the meson stuff.
This also is the first step to making it a bit more flexible so we
can define integration tests in different ways as will be seen in
the next commits.
2024-05-14 12:43:28 +02:00
Daan De Meyer cbb8c52a0f TEST-01-BASIC: Drop logic to run test without install-tests=true
We don't support this for any other tests either so let's drop the
support for running TEST-01-BASIC without installing as well to make
the upcoming commit easier to implement.
2024-05-14 12:43:28 +02:00
Daan De Meyer 3c0a1b1e70 core: Imply DefaultDependencies=no for credential mounts
Currently, on soft-reboot, /run/credentials/@system is unmounted
because it has DefaultDependencies=yes and as such will have
Conflicts=umount.target and Before=umount.target. Let's make sure
credential mounts survive soft-reboot by implying DefaultDependencies=no
for credential mounts.
2024-05-14 12:42:45 +02:00
Daan De Meyer 034e85c5f3 TEST-38-FREEZER: Relax regex a little
The state might be "freezing-by-parent" as well so let's take that
into account.

Fixes #32746
2024-05-13 15:19:40 +02:00
Daan De Meyer 82c2214539 debug-generator: Allow specifying name of unit-dropin credential
A fixed name is too rigid, let's give users the ability to define
custom drop-in names which at the same time also allows defining
multiple dropins per unit.

We use ~ as the separator because:
- ':' is not allowed in credential names
- '=' is used to separate credential from value in mkosi's --credential
  argument.
- '-' is commonly used in filenames
- '@' already has meaning as the unit template specifier which might be
  confusing when adding dropins for template units
2024-05-11 19:46:15 +02:00
Yu Watanabe 7ef26afca5 test-network: simplify and unify waiting loop
Also,
- drop unused fail_assert arguments,
- use wait_links() and check_networkd_log() in wait_activated().
2024-05-11 02:13:34 +09:00
Yu Watanabe acc06d8a68 test-network: make link_exists() take multiple arguments
This also improves performance of test_delete_links().
2024-05-11 02:13:34 +09:00
Yu Watanabe d22f2fb912 test-network: check existence of kernel bug
This adds checks for the kernel bug caused by
3ddc2231c8,
it will be fixed by
https://patchwork.kernel.org/project/netdevbpf/patch/20240510072932.2678952-1-edumazet@google.com/
2024-05-10 20:39:56 +09:00
Yu Watanabe e92d7b7dd9 test-network: introduce --no-journal option
This should be useful when the test run as a service, e.g.
running on a mkosi image.
2024-05-10 20:39:30 +09:00
Luca Boccassi 086b277dc7
Merge pull request #32743 from yuwata/test-network-for-mkosi
test-network: several improvements for running with mkosi
2024-05-10 11:27:14 +02:00
Yu Watanabe b2062ee2d9 test: wait for network interface reconfigured after updating config
Otherwise, at this stage, the interface may be in e.g. initialized or
pending state, and the drop-in file introduced by the previous command
may not be registered to the state file for the interface.

Fixes #32685.
2024-05-10 09:16:21 +02:00
Yu Watanabe 24e37929ed test-network: do not fail when /etc/protocols does not exist
Also this makes several checks more strict.
2024-05-10 15:16:20 +09:00
Yu Watanabe 2a4f9139d9 test-network: do not fail test_macvlan() with old kernel or ip command 2024-05-10 14:36:38 +09:00
Yu Watanabe e97bb361a0 test-network: do not fail if macvlan module is not available 2024-05-10 14:33:38 +09:00
Daan De Meyer 6c5d4f0645 TEST-46-HOMED: Ignore "Disk Usage" field as well
This can change between the call to homectl inspect and userdbctl
user so let's ignore it along with the other disk fields.

Fixes #32727
2024-05-09 11:02:45 +02:00
Daan De Meyer 904b8ae47a TEST-04-JOURNAL: Sleep more in delegated cgroup filtering script
We already changed logs-filtering.service to sleep 2 seconds before
exiting to combat flakyness, let's do the same for the delegated
cgroup filtering payload.

Fixes #32696 (hopefully)
2024-05-08 12:27:35 +02:00
Daan De Meyer 65690de6f9 TEST-81-GENERATORS: Do a lazy unmounts
Otherwise we might fail if PID 1 is currently accessing these files.

Fixes #32692 (hopefully)
2024-05-08 12:27:24 +02:00
Daan De Meyer a35edc9ad4 TEST-74-AUX-UTILS: Make more robust
Let's run mkfs on the file we create instead of the loop device and
let's use udevadm wait --settle to wait for udev to settle before
doing anything with the loop device

Fixes #32680 (hopefully)
2024-05-08 11:35:15 +02:00
Daan De Meyer b438ebd7bc TEST-07-PID1: Fix race in aux-scope subtest
Currently test-aux-scope.service can get killed by the test before
it's had a chance to setup its signal handler. Make it Type=notify
to fix the race.

Fixes #32670 (hopefully)
2024-05-08 10:20:20 +02:00
Daan De Meyer 0d13ca5544 test: Mark TEST-21-DFUZZER as slow and skip it by default
The test is not really useful without sanitizers, so let's mark it
as slow and not run it by default in CI.
2024-05-07 19:06:42 +02:00
Daan De Meyer f1f87f3b2e test: Add infra to mark integration tests as slow
Some integration tests take much more time than others, let's add
a test param that can be used to configure this and integrate it
with the slow-tests meson option.
2024-05-07 19:06:42 +02:00
Daan De Meyer a77f65d0c9 ci: Print a helpful link to download and view a failed test's journal 2024-05-07 19:06:39 +02:00
Daan De Meyer ca2e19f2b7 test: Don't keep journals for skipped tests
Let's make sure we don't save journals for tests that were skipped.
2024-05-07 17:34:42 +02:00
Daan De Meyer f3548f28b3 meson: Fix formatting 2024-05-06 18:16:24 +02:00
Daan De Meyer 77962e1242 mkosi: Enable more integration tests 2024-05-06 11:57:09 +02:00
Daan De Meyer 1f2c9bda49 test: Default to linux qemu firmware
Direct kernel boot results in much faster boot times so let's use
it by default.

We disable it for tests that need to reboot because +-50% of the
time, doing a reboot when using direct kernel boot causes qemu to
hang on reboot. Until we figure that out, let's use UEFI for the
tests that need to reboot.
2024-05-06 11:57:09 +02:00
Daan De Meyer a90bba42f4 TEST-46-HOMED: Skip barely fits test on ext4
For some reason this fails on ext4 with "No space left on device".
Until we figure out why, let's skip the test on ext4 (which is reported
as ext2/ext3 by stat).
2024-05-06 11:57:09 +02:00
Daan De Meyer 7a273d6570 TEST-46-HOMED: Only run resize tests on btrfs
Other filesystems do not support online shrinking.
2024-05-06 11:57:09 +02:00
Daan De Meyer 6ff6b2e29b TEST-53-ISSUE-16347: Add rtc configuration for qemu 2024-05-06 11:57:09 +02:00
Daan De Meyer 9e71acab00 TEST-55-OOMD: Configure init.scope credential in mkosi image 2024-05-06 11:57:09 +02:00
Daan De Meyer 8f5095ff74 TEST-55-OOMD: Skip on opensuse
opensuse does not have the stress tool packaged.
2024-05-06 11:57:09 +02:00
Richard Maw 9be49de41f TEST-55-OOMD: swapoff before adding new swapfile
When running test images built with read-only /usr
a swap partition is likely so needs to be turned off first.
2024-05-06 11:57:09 +02:00
Daan De Meyer f1d3962e61 TEST-04-JOURNAL: Skip bsod test if systemd-bsod is not installed
systemd is built without qrencode support on CentOS which means
systemd-bsod will not be installed. Let's skip the test if that's
the case.
2024-05-06 11:57:09 +02:00
Daan De Meyer f74fb048f9 TEST-04-JOURNAL: Run with persistent journal
This test depends on having the journal in /var/log/journal.
2024-05-06 11:57:09 +02:00
Daan De Meyer 0214a8fd75 TEST-04-JOURNAL: Make more robust
Avoid hitting https://github.com/systemd/systemd/issues/2913 by adding
some more sleeps. This is required to make the test pass when executed
with mkosi on my machine.
2024-05-06 11:57:09 +02:00
Daan De Meyer e86afb0314 TEST-07-PID1: Schedule exit on successful execution
The test unit has RemainAfterExit=yes so let's schedule our own
shutdown from the test itself once we finish running.
2024-05-06 11:57:09 +02:00
Richard Maw c5073aa204 TEST-07-PID1: Test access to allocated loop instead of loop0
loop0 and 1 can be used by systemd-repart and vanish
but we can guarantee that $LODEV was allocated and is available.
2024-05-06 11:57:09 +02:00
Daan De Meyer 733d0594f0 TEST-07-PID1: Lower TriggerLimitIntervalSec= unconditionally
It shouldn't hurt to do this when KVM is enabled or we're not collecting
coverage so let's just always lower the trigger limit interval.
2024-05-06 11:57:09 +02:00
Richard Maw 7590e1d037 TEST-07-PID1: Move mount units to test dir
To load the units it is sufficient to add them to the units directory
and it's a step towards not needing any customisations for this test.
2024-05-06 11:57:09 +02:00
Daan De Meyer b95bb3b3bb TEST-70-TPM2: Call udevadm wait after attaching disk image
Otherwise /dev/loop0p1 might not exist when calling
systemd-cryptsetup attach.
2024-05-06 11:57:09 +02:00
Daan De Meyer 6b146cef3f TEST-70-TPM2: Add dependency on tpm2.target
Let's make sure the TPM is available before running the test as the
test makes use of it.
2024-05-06 11:57:09 +02:00
Daan De Meyer e631cc91e0 TEST-74-AUX-UTILS: Use persistent journal
This test depends on having the journal in /var/log/journal.
2024-05-06 11:57:09 +02:00
Daan De Meyer 3d5c6ece1c TEST-74-AUX-UTILS: Drop usage of loop module
This module is builtin on ubuntu causing the test to fail. Let's
use just dummy instead. I tried replacing it with scsi_debug but
that caused issues with modprobe complaining it could not remove
scsi_debug because it was in use.
2024-05-06 11:57:09 +02:00
Daan De Meyer da87c35f35 TEST-74-AUX-UTILS: Skip run0 test if pam snippet is not installed 2024-05-06 11:57:09 +02:00
Daan De Meyer a2190c22b8 TEST-74-AUX-UTILS: Make sure at least two locales exist 2024-05-06 11:57:09 +02:00
Richard Maw 8c9d241c55 TEST-74-AUX-UTILS: Support running on UEFI systems 2024-05-06 11:57:00 +02:00
Richard Maw fe8d7d25d5 TEST-74-AUX-UTILS: Support systems with pre-existing modules config 2024-05-06 10:58:47 +02:00
Richard Maw b7b6bdc9e0 TEST-74-AUX-UTILS: Support credential-provided root SSH public key
When root authorized keys are provided by mkosi they are not
newline-terminated so appending a public key to the file results
in a corrupt key, so just to be safe we add an empty line.
2024-05-06 10:58:24 +02:00
Daan De Meyer 904fc035cb TEST-75-RESOLVED: Ignore resource record ifindex field
Depending on host configuration this may or may not be included (e.g.
on mkosi we get a result without an ifindex field). Let's strip it from
the resolved reply to avoid failing the test.
2024-05-06 10:56:55 +02:00
Daan De Meyer 9cd3e292c6 TEST-75-RESOLVED: Add missing sleep after knotc reload
We already have this workaround for knotc reload a little further
in the test, let's apply it to our first invocation of knotc reload
as well.
2024-05-06 10:56:55 +02:00