Commit graph

4832 commits

Author SHA1 Message Date
Daan De Meyer 51273281cd test: Bump mkosi integration test timeout to 1800 seconds
Same timeout as the bash framework.
2024-04-30 22:10:05 +02:00
Daan De Meyer 9a69900a4b test: Make journal storage configurable per test and make persistent for TEST-09-JOURNAL
Also fix a bug in the logic since it's 'volatile' and not 'runtime'.
2024-04-30 22:10:05 +02:00
Daan De Meyer b8afa59583 test: Drop /usr overlay workaround
/usr is not erofs anymore in the mkosi images so let's drop the
workaround where we mount a writable tmpfs on top of /usr.
2024-04-30 22:10:05 +02:00
Daan De Meyer db07533f74 Revert "TEST-25-IMPORT: Skip if importctl not installed"
This reverts commit dcb17e3295.

importctl is now correctly installed on opensuse, so no need for
this workaround anymore.
2024-04-30 22:10:05 +02:00
Daan De Meyer 27246d2bb6 TEST-71-HOSTNAME: Ignore error from reset-failed
On OpenSUSE the systemd-hostnamed does not fail and is unloaded which
causes reset-failed to fail. So let's ignore any errors from reset-failed
to make the test more robust.
2024-04-30 22:10:05 +02:00
Daan De Meyer b676bbbfc6 TEST-46-HOMED: Check for sshd pam snippet in /usr/lib/pam.d as well
opensuse ships pam snippets in /usr/lib/pam.d.
2024-04-30 22:10:05 +02:00
Daan De Meyer e290b45dfa TEST-82-SOFTREBOOT: Exit with exit status 123
Required to make mkosi consider the test successful.
2024-04-30 22:10:05 +02:00
Daan De Meyer e1f17dc641 TEST-35-LOGIN: Exclude manager entry in testcase_sanity_check()
Otherwise we try to kill the wrong session.
2024-04-30 22:10:05 +02:00
Daan De Meyer b03c2d51b2 TEST-18-FAILUREACTION: Exit with 123 on success
mkosi expects the virtual machine/container to exit with exit status
123 on success so let's make sure that's the case.
2024-04-30 22:10:05 +02:00
Daan De Meyer 8c89620e80 TEST-09-REBOOT: Make journalctl grep pattern more specific
We might be rotating because we reached limits, which is perfectly
fine, so don't fail if that happens.
2024-04-30 22:10:05 +02:00
Daan De Meyer 409c8a8ee0 TEST-13-NSPAWN: Skip on virtiofs
The rootfs only has 64K UIDs available when booting with virtiofs,
whereas the nspawn tests want to use user namespace which require
more than 64K UIDs.
2024-04-30 22:10:05 +02:00
Richard Maw 3630f5aaf8 TEST-13-NSPAWN: move disk images to /var/tmp
/tmp may not be large enough to contain disk images
and will result in strange errors when it runs out of space.
2024-04-30 22:10:02 +02:00
Richard Maw 047d5b6a32 TEST-13-NSPAWN: move container template to /usr/share
Having directories in / causes problems for make-root-on-boot images
2024-04-30 18:17:13 +02:00
Daan De Meyer b81ece59c4 TEST-04-JOURNAL: Make LogFilterPatterns= tests more robust
Let's use oneshot services as we don't need long running services
for the tests we're doing. Let's also increase the sleeps a little
as the current values weren't sufficient when running the test locally
on my machine with mkosi.
2024-04-30 18:17:13 +02:00
Daan De Meyer 191a31fbcf TEST-83-BTRFS: Skip if root filesystem is not btrfs 2024-04-30 18:17:13 +02:00
Richard Maw 37029ce769 TEST-35-LOGIN: Handle multiple lock messages per sleep
If 3 lock messages get sent when going to sleep
then we can falsely assume we have woken up if we only assume we have at least two
so checking we have more than we did before sleeping addresses that issue.
2024-04-30 18:17:13 +02:00
Daan De Meyer 27f166c523 mkosi: Use systemd.crash_action=poweroff in integration tests
Some integration tests expect to be able to reboot so switch to using
the new systemd.crash_action=poweroff instead.
2024-04-30 17:01:41 +02:00
Daan De Meyer e911a335ed mkosi: Mask systemd-networkd-wait-online when --runtime-network=none
Otherwise it will wait forever waiting for an interface to appear.
See https://github.com/systemd/systemd/issues/29388.
2024-04-30 17:01:41 +02:00
Daan De Meyer d99deaaaea mkosi: Disable --runtime-scratch=no for tests
Breaks TEST-83-BTRFS if enabled.
2024-04-30 17:01:41 +02:00
Daan De Meyer 06489e8332 mkosi: Make sure our extra kernel command line overrides the config one 2024-04-30 17:01:41 +02:00
Frantisek Sumsal 9fe18055fe test: exclude gperf files from captured coverage
Recent lcov started complaining loudly about unknown lines in gperf
files:

...
Found gcov version: 13.2.1
Using intermediate gcov format
Recording 'internal' directories:
...
Finished processing 1634 GCNO files
Apply filtering..
Message summary:
  1 error message:
    range: 1
  28 warning messages:
    gcov: 27
    usage: 1
geninfo: ERROR: (range) unknown line '33' in /build/src/home/homed-gperf.gperf: there are only 22 lines in the file.
  Use 'geninfo --filter range' to remove out-of-range lines.
        (use "geninfo --ignore-errors range ..." to bypass this error)

Since we drop the coverage of built files from the final report anyway,
let's do it also when capturing both initial and real coverage to avoid
this error.
2024-04-30 15:42:45 +02:00
Daan De Meyer c89244842b test: Don't persist journal in mkosi image if we're not debugging tests
If we're not debugging tests, there's no point in persisting the journal,
so let's use the volatile journal storage mode in that case to avoid doing
unnecessary work.

We don't disable journal storage alltogether since various tests check
that stuff is written to the journal.
2024-04-30 15:20:55 +02:00
Daan De Meyer 1ce32f2f5f TEST-81-GENERATORS: Use SYSTEMD_PROC_CMDLINE more
Makes the test more robust as the command line the image is booted
won't influence the test result.
2024-04-30 10:45:35 +02:00
Daan De Meyer 7a66f21556 core: Add systemd.crash_action= kernel command line argument
Required for integration tests to power off on PID 1 crashes. We
deprecate systemd.crash_reboot and related options by removing them
from the documentation but still parsing them.
2024-04-29 14:34:22 +02:00
Sebastian Pucilowski e6c4b5dc52 network: DHCP version logging typos
Some DHCP client log messages report "DHCP4" or "DHCP6" instead of
"DHCPv4" or "DHCPv6" as used within the rest of the codebase. Typos
fixed.
2024-04-28 11:47:55 +09:00
Daan De Meyer 4c36bbdfd7
Merge pull request #32439 from CodethinkLabs/simple-mkosi-integration-tests
Enable some simple mkosi integration tests
2024-04-26 20:48:00 +02:00
Richard Maw 66fb77a8bf test/meson.build: Add some runnable integration tests 2024-04-26 17:25:55 +01:00
Richard Maw 337d246faf TEST-81-GENERATORS: Clean /proc/cmdline of unusual mounts 2024-04-26 17:25:55 +01:00
Richard Maw 90eee2cf0f TEST-36-NUMAPOLICY: Bump PID1 strace time to 3 seconds
CI can be slow and only waiting 1 second makes it flaky there.
2024-04-26 17:25:55 +01:00
Richard Maw 4114b723f9 TEST-26-SYSTEMCTL: Create /etc/init.d if needed
OpenSUSE doesn't disable sysv compat but also may not have anything in
/etc/init.d.
2024-04-26 17:25:55 +01:00
Richard Maw dcb17e3295 TEST-25-IMPORT: Skip if importctl not installed
machinectl import-* was split out into importctl
which is a separately configurable component to machinectl
and might not always be available.
2024-04-26 17:25:34 +01:00
Richard Maw 60d064d3fd TEST-19-CGROUP: Skip on opensuse
OpenSUSE images seem to be unhappy with either how they are built
or what they are being asked to do.

The listed device-mapper failure is just one of the strange errors,
I have also seen it fail to propagate cgroup properties into new cgroups
that were previously guaranteed to exist.
2024-04-26 17:23:53 +01:00
Richard Maw 8ccba68cb5 TEST-17-UDEV: Skip credentials test if service not loaded
It does not appear to exist on OpenSUSE yet.
2024-04-26 17:22:10 +01:00
Frantisek Sumsal 516652bbfd test: mountnfsd -> mountfsd
I keep accidentally writing mountnfsd instead of mountfsd, and a couple
of instances managed to get into the repo.
2024-04-26 17:14:07 +02:00
Richard Maw ab5f60cb23 test: Disable network by default in mkosi tests 2024-04-26 15:55:42 +01:00
Daan De Meyer dcbf0be1b7 TEST-50-DISSECT: Don't log image contents to console
These can contain quite a few files, so let's not write every single
file and directory straight to the console to speed things up.
2024-04-26 13:51:49 +02:00
Daan De Meyer 536b5c0748
Merge pull request #32445 from DaanDeMeyer/mkosi-images
mkosi: Build minimal images and enable related integration tests
2024-04-25 21:59:23 +02:00
Daan De Meyer c77dad706b mkosi: Build minimal images and enable related integration tests
This commit adds definitions to build the minimal_0 and minimal_1
images with mkosi and includes them into the system image. We also
move the building of the various app-xxx and similar images that are
extremely minimal into the tests itself by moving the related logic
from install_verity_minimal() into a new function
install_extension_images() in util.sh. Because the mkosi /usr is
read-only, we now place the extension images in /tmp instead of
/usr/share.

Co-authored-by: Richard Maw <richard.maw@codethink.co.uk>
Co-authored-by: sam-leonard-ct <sam.leonard@codethink.co.uk>
2024-04-25 21:06:30 +02:00
Daan De Meyer 69dc36f69b TEST-50-DISSECT: Make sure logging sockets are mounted into images
Otherwise we lose valuable logging from systemd-executor when things
go wrong since it can only log to the journal and not to the console
in these cases.
2024-04-25 19:39:31 +02:00
Luca Boccassi d1c4174d69
Merge pull request #32475 from bluca/skip
test: skip testsuite-50.mountnfsd if kernel/polkit are too old
2024-04-25 18:48:57 +02:00
Daan De Meyer cf5e1b5d39 test: Skip meson integration tests if SYSTEMD_INTEGRATION_TESTS != 1
We cannot mark a test suite as excluded by default in meson. Instead,
let's require that SYSTEMD_INTEGRATION_TESTS=1 and skip any integration
test if it's not set. This is effectively the same as excluding it by
default. If the integration-test option is enabled, we'll set the
environment variable by default, just like we do with SYSTEMD_SLOW_TESTS
and the slow-tests meson option.
2024-04-25 17:06:40 +02:00
Luca Boccassi f9419fe610 test: skip testsuite-50.mountnfsd if kernel/polkit are too old
Need full support of pidfd to work, so skip the test if it's not
available
2024-04-25 13:32:35 +01:00
Luca Boccassi c790537b89 test: use sd-analyze for kernel version check in TEST-62 2024-04-25 13:32:10 +01:00
Lennart Poettering 3c1d1ca146 manager: switch service unit type over to using new handoff timestamping logic
Also: rename Handover → Handoff. I think it makes it clearer that this
is not really about handing over any resources, but that the executor is
out off the game from that point on.
2024-04-25 13:40:41 +02:00
Daan De Meyer 2fcf8bf3b1
Merge pull request #32465 from CodethinkLabs/mkosi-debug
mkosi: Build images and run mkosi tests with --debug to aid debugging in CI
2024-04-24 21:02:41 +02:00
Daan De Meyer 5ae6ff1258 TEST-50-DISSECT: Skip mutable sysext tests on virtiofs
virtiofs cannot be used as the upper fs for overlayfs, so skip all
the sysext mutable tests that would try to use virtiofs as the
upper fs.
2024-04-24 19:30:00 +02:00
Richard Maw 125b2fee18 test: Add --debug when running mkosi through integration-test-wrapper 2024-04-24 18:27:07 +01:00
Daan De Meyer c709499a4e TEST-50-DISSECT: Use --apparent-size when calling du
Otherwise if the file is full of holes we get the wrong size and
we'll fail later on.
2024-04-24 15:51:37 +02:00
Daan De Meyer 2a9184b902 TEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported 2024-04-24 15:51:35 +02:00
Richard Maw 2fd849016b test: Shut down tests on crash
If an assert in systemd fails it can't shut down normally.

By default it freezes. For interactive runs we want the crash shell
to enable further debugging, but during test runs we want it to exit
without having to wait for the test timeout.

By deactivating the crash shell, enabling reboot, and configuring qemu
so that it shuts down instead of rebooting we can shut down instead.

Because by default UEFI will enroll keys and then reboot
we also have to set --qemu-firmware-variables=custom
so it doesn't need to auto-enroll.

Because mkosi has to handle not receiving an EXIT_STATUS notification
it falls back to the exit code of qemu, which in the case of reboot
would be 0, we also override the success exit status to 123
and check that we got that as an exit code from mkosi.
2024-04-24 11:01:45 +02:00