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

5174 Commits

Author SHA1 Message Date
Luca Boccassi
d8ec2770b7 test: skip TEST-84-STORAGETM if running with bugged libnvme
libnvme 1.11 appears to require a kernel built with NVME TLS
kconfigs, and fails hard if it is not, as the expected
privileged keyring '.nvme' is not present. We cannot just
create it from userspace, as privileged keyrings can only
be created by the kernel itself (those starting with '.').

Skip the test if the library exactly matches this version.

https://github.com/linux-nvme/nvme-cli/issues/2573

Fixes https://github.com/systemd/systemd/issues/35130

(cherry picked from commit 893aa45886)
2024-11-14 18:10:26 +00:00
Yu Watanabe
c479007d18 TEST-17-UDEV: check if udev database file is removed on remove event
(cherry picked from commit 49c46fbaf1)
2024-11-13 19:48:10 +00:00
Yu Watanabe
dc44fd69b0 core/namespace: honor MountEntry.read_only, .options, and so on in static entries
Otherwise, ProtectHome=tmpfs makes /home/ and friends not read-only.
Also, mount options for /run/ specified in MountAPIVFS=yes are not
applied.

The function append_static_mounts() was introduced in
5327c910d2, but at that time, there were
neither .read_only nor .options in the struct. But, when later the
struct is extended, the function was not updated and they were not
copied from the static table.
The fields has been used in static tables since
e4da7d8c79, and also in
94293d65cd.

Fixes #34825.

(cherry picked from commit 0cc496b2d2)
2024-11-13 19:48:10 +00:00
Luca Boccassi
dadb179bec test: delete /swapfile after swapoff
[   23.608342] TEST-55-OOMD.sh[689]: + btrfs filesystem mkswapfile -s 64M /swapfile
[   23.651930] TEST-55-OOMD.sh[704]: ERROR: cannot create new swapfile: File exists

(cherry picked from commit 78b032d727)
2024-11-13 19:48:10 +00:00
Daan De Meyer
f7d52524a7 TEST-64-UDEV-STORAGE: Don't hardcode device name in long-sysfs-path test
There's no guarantee our device will be named /dev/vda, so give it
a serial so we can query for its devname inside the test.

(cherry picked from commit 2ec809dd3b)
2024-11-13 19:48:10 +00:00
Daan De Meyer
beca1de2ef TEST-17-UDEV: Don't hardcode root device name
There's no guarantee the root device will be /dev/sda, so let's use
bootctl to get the actual path instead of harcoding it.

(cherry picked from commit 29a8e71d9c)
2024-11-13 19:48:10 +00:00
Yu Watanabe
c54a5fa6a8 test-network: add test for DHCPv4 address removal on stop
For issue #34837.

(cherry picked from commit 58a011ba48)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
0ec7854d44 bsod: make message for qrcode more useful
People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.

While at it, rename "stream" to "f" in line with the usual style.

(cherry picked from commit abf1cae0a7)
2024-11-13 19:48:10 +00:00
Mike Yuan
b2496d151a TEST-80-NOTIFYACCESS: don't specify --pid= if MAINPID= is provided explicitly
Otherwise, with recent additions, the MAINPIDFDID= generated by
systemd-notify would mismatch with overridden MAINPID=.

(cherry picked from commit c3ecb747f1)
2024-11-13 19:48:10 +00:00
Lennart Poettering
3f40451c0b test: add quick test to verify the PAM stack really ran in all run0 modes of operation
(cherry picked from commit f515ea1cd4)
2024-11-13 19:48:10 +00:00
Yu Watanabe
5cd2f61a05 TEST-02-UNITTESTS: reuse $TEST_MATCH_SUBTEST to specify unit tests to be run
Then, we can easily test specific unit tests in qemu or container.

(cherry picked from commit aa7507ea4a)
2024-11-13 19:48:10 +00:00
Luca Boccassi
4a3fc628a2 test: CET/EET are deprecated, use Europe/Berlin and Kyiv
The links moved to the legacy dataset so they won't be available by
default, so stop using them and just use the city ones instead

(cherry picked from commit aa077884c1)
2024-11-13 19:48:10 +00:00
Ronan Pigott
92eca86c15 test: exercise bypass mode on the sd-resolved stub
A basic test will verify that we provide the right flags.

(cherry picked from commit b7b1c50c6a)
2024-11-13 19:48:10 +00:00
Luca Boccassi
602e12f340 test: customize /etc/os-release instead of /usr/lib/os-release
As per spec image builders can create a local /etc/os-release
with per-image IDs, so modify that one instead of the original
one in /usr/lib. For example we do this when we build debian
unstable images in mkosi.

(cherry picked from commit 2f6fe4e113)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b0a0156bc9 TEST-60-MOUNT-RATELIMIT: disable journal ratelimiting
Otherwise, journal check in testcase_mount_ratelimit() may fail and we
need to wait 2 minutes.

(cherry picked from commit 73970cdcd1)
2024-11-13 19:48:10 +00:00
Yu Watanabe
dcae004218 TEST-60-MOUNT-RATEMINIT: split into small test cases
Then, use run_testcases().

(cherry picked from commit 805d0eed0b)
2024-11-13 19:48:10 +00:00
Yu Watanabe
3b171cb7bc TEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped
(cherry picked from commit c5928a7684)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4042a6a8f6 TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit a6092b532e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0dfd4d6996 TEST-55-OOMD: stop test units when unnecessary
Then, sleep becomes not necessary anymore. This greatly improve performance.

(cherry picked from commit 98a0bb8a64)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0932445e1e TEST-55-OOMD: split into small testcases
Then, we can run each small test cases separately.

(cherry picked from commit 6bba058076)
2024-11-13 19:48:10 +00:00
Yu Watanabe
fe5e2af10e TEST-55-OOMD: check global config earlier
'Default Memory Pressure Duration' field in oomctl, which can be configured
with DefaultMemoryPressureDurationSec= in oomd.conf, is a global config.
Let's check it earlier.

This also drops unnecessary cleanup at the beginning.

(cherry picked from commit 23fb9b63cd)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4c9e59ec9a TEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config
Fedora and friends has a drop-in config for the settings in
/usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
overridden. Let's set below in a drop-in with higher decimal prefix.

Also, rename override.conf -> 99-managed-oom-preference.conf for the same reason.

(cherry picked from commit 1473836a1e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
04bf8544ba TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=
(cherry picked from commit 5f3cfb9d5e)
2024-11-13 19:48:10 +00:00
Luca Boccassi
d2c8426a59 core: do not fail if ignorable img.v/ vpick dir is missing
Do not fail if the directory is missing entirely, other than just empty

Follow-up for 00f546e25e
Follow-up for 5e79dd96a8
Follow-up for 622efc544d

(cherry picked from commit e1efa9d804)
2024-11-13 19:48:10 +00:00
Luca Boccassi
2494dc1961 core: do not fail if ignorable img.v/ vpick dir is empty
If the vpick directory is configured to be ignored if missing, do not
fail and just skip ahead.

Follow-up for 5e79dd96a8
Follow-up for 622efc544d

(cherry picked from commit 00f546e25e)
2024-11-13 19:48:10 +00:00
John A. Leuenhagen
799ae7fa38 TEST-74-AUX-UTILS: add tests for 'run0 -D'
(cherry picked from commit 4ca75488d9)
2024-11-13 19:48:10 +00:00
Yu Watanabe
ec37980695 TEST-64-UDEV-STORAGE: insert udevadm settle more
Hopefully fixes #34073.

(cherry picked from commit acadc9a849)
2024-11-13 19:48:10 +00:00
Yu Watanabe
d600880c99 TEST-58-REPART: drop duplicated inclusion of util.sh
(cherry picked from commit 4ca7b55329)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4abbd3a9c6 mkosi: replace PackageManagerTrees= with SandboxTrees=
(cherry picked from commit 4e3f16b5ef)
2024-11-13 19:48:10 +00:00
WilliButz
b96e3bbd9f test/repart: add test case for hash size derived from max data size
(cherry picked from commit e16153a403)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b64601d454 test: add test cases for timestamp with time zone
(cherry picked from commit 25999f868f)
2024-11-13 19:48:10 +00:00
Frantisek Sumsal
c5baa5d9d9 test: drop removed SCSI passthrough feature
This feature has been deprecated since QEMU 5.0 and finally removed in
QEMU 9.1 [0] which now causes issues when running the storage tests on
latest Arch:

------ testcase_long_sysfs_path: BEGIN ------
...
qemu-system-x86_64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Property 'virtio-blk-pci.scsi' not found
E: qemu failed with exit code 1

[0] a271b8d7b2

(cherry picked from commit cd57920fbf)
2024-10-09 15:32:29 +01:00
Yu Watanabe
259a8413a6 test: add test cases for --volatile= with -U
For issue #34254.

(cherry picked from commit 48878074d6)
2024-10-08 16:39:12 +01:00
Luca Boccassi
906a3d37ce mkosi: mark test as skipped when QEMU crashes
On Ubuntu/Debian infrastructure QEMU crashes a lot, so mark the test
as skipped in that case as there's nothing we can do about it and
we shouldn't mark runs as failed

(cherry picked from commit 0d7f5a9ae6)
2024-10-08 16:39:12 +01:00
Thomas Blume
7c399a4003 test: set TEST_NESTED_KVM as default
(cherry picked from commit 5540c37bb8)
2024-10-08 16:39:12 +01:00
Yu Watanabe
7b9e412d8a test: add test case for issue #34637
(cherry picked from commit 88d186e482)
2024-10-08 16:39:12 +01:00
Michal Koutný
84cd501ae4 test: Add test for per-device cgroup properties
Reported in #34126

(cherry picked from commit 3216377433)
2024-10-08 16:39:12 +01:00
Daniel Dawson
7323feef9b systemd-integritysetup: accept integrity-algorithm=xxhash64
Signed-off-by: Daniel Dawson <danielcdawson@gmail.com>
(cherry picked from commit 0c96911afb)
2024-10-08 16:39:12 +01:00
Ivan Kruglov
0cd10d410b machine: resolve race condition in TEST-13-NSPAWN.machinectl.sh
I encountered this race condition while working on TEST-13-NSPAWN.varlinkctl.sh.
The long-running machine's init script sometimes does not have time to start and
register signals. As result, occasiounally failed tests.

(cherry picked from commit e826a8bed4)
2024-10-08 16:39:12 +01:00
Simon Pilkington
bc0ba0030b creds: fix cat with encrypted credentials
Fixes: https://github.com/systemd/systemd/issues/34547
(cherry picked from commit 32951fe4de)
2024-10-08 16:39:12 +01:00
Daan De Meyer
3f313d0d49 test: Run TEST-74-AUX-UTILS in virtual machine
Various tests skip themselves when running in a container so make
sure the test runs in a virtual machine so we get full coverage.

(cherry picked from commit f4faac2073)
2024-10-08 16:39:12 +01:00
Luca Boccassi
2552348da2 portable: ensure PORTABLE_FORCE_ATTACH works even when there is a leftover unit
Force means force, we skip checks with PID1 for existing units, but
then bail out with EEXIST if the files are actually there. Overwrite
everything instead.

(cherry picked from commit 1e2d1a7202)
2024-09-11 13:19:25 +02:00
Luca Boccassi
a2c84836ef test: mount ld.so.cache in minimal nspawn container if present
In some cases (SUSE Tumbleweed) this is needed as a library (libz) is
not in the default path, so it fails to run.

(cherry picked from commit 1e17e48b96)
2024-09-11 13:19:25 +02:00
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