1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-23 02:04:32 +03:00

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 893aa45886ef84b1827445dc438e410ad89fbbbf)
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 49c46fbaf15b95a8264d01213539914e15fdc6fe)
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
5327c910d2fc1ae91bd0b891be92b30379c7467b, 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
e4da7d8c796a1fd11ecfa80fb8a48eac9e823f06, and also in
94293d65cd4125347e21b3e423d0e245226b1be2.

Fixes #34825.

(cherry picked from commit 0cc496b2d21f73d0a03414ce40eceb9e3af76e22)
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 78b032d727e8f9e925c10c6617a1e409307ffc24)
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 2ec809dd3baf39b83b8f581e7ea837b9732f9964)
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 29a8e71d9c0858aef502f091a0ef58d5569b1c70)
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 58a011ba4865d083bffdebe33126637bc5bba511)
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 abf1cae0a75ca07f09afbb4eaa9f11fc429b1d02)
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 c3ecb747f1e35f609f15fc94ad4d5e5ca0bda4a2)
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 f515ea1cd4981ceb1a2c85d676f279db2972283f)
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 aa7507ea4a57508da0f2a7d1ae6e139793c5694a)
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 aa077884c13769ae3bd6aa98978b4ac9e64b5365)
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 b7b1c50c6afd2ab8c2c779df9b73c6dbbc773f70)
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 2f6fe4e1131d39fcafa9e00a7902919efb5361e1)
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 73970cdcd1cebe49a2858ce016c0cd4ce6037b2e)
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 805d0eed0b51e2ef761fc522f092b71dc028f700)
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 c5928a768417b298eb2741107fa7492e93d637fc)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4042a6a8f6 TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit a6092b532e1de0e1f9702f432c0c4c7de495bf4f)
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 98a0bb8a6487a1bd0767223f3738525c2b3eae52)
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 6bba058076cf4ce91fd470841d5ced47c8d32d6a)
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 23fb9b63cd12f2040419dbc846d7a87e5193935c)
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 1473836a1e3c528221439e3b0ce90e729b31adb3)
2024-11-13 19:48:10 +00:00
Yu Watanabe
04bf8544ba TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=
(cherry picked from commit 5f3cfb9d5ee334c53cc407308ba677401a6ba1cd)
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 00f546e25e8
Follow-up for 5e79dd96a88
Follow-up for 622efc544dc

(cherry picked from commit e1efa9d8044a7564844b8d599eda4b59eb1152e9)
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 5e79dd96a88
Follow-up for 622efc544dc

(cherry picked from commit 00f546e25e8e46e5e289e1f2fc2ed3dcc6999223)
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 4ca75488d935431e772c25eb6cf060ea85553158)
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 acadc9a84925fa725de1a4dbcfe2355432c0769a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
d600880c99 TEST-58-REPART: drop duplicated inclusion of util.sh
(cherry picked from commit 4ca7b553295315c759a622a47240af56e2d06b46)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4abbd3a9c6 mkosi: replace PackageManagerTrees= with SandboxTrees=
(cherry picked from commit 4e3f16b5ef122996f9545d883af74ff1235833eb)
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 e16153a40342b3da984ffbf4e382e16e713f447a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b64601d454 test: add test cases for timestamp with time zone
(cherry picked from commit 25999f868fe0e9684af7a364224ac42071b70f74)
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 cd57920fbf6a8f7769a82cfc9bebc12965de0199)
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 48878074d69a558484348f14e8887ce132938377)
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 0d7f5a9ae6f5fc70c5ad23398c2b7a515e9b1982)
2024-10-08 16:39:12 +01:00
Thomas Blume
7c399a4003 test: set TEST_NESTED_KVM as default
(cherry picked from commit 5540c37bb8b275cb58b1c936ff701d1c80503e9b)
2024-10-08 16:39:12 +01:00
Yu Watanabe
7b9e412d8a test: add test case for issue #34637
(cherry picked from commit 88d186e4829bc7ef4a4253fe2bf4857903bca830)
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 321637743313f896e275fd038996b8cfb5a070b3)
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 0c96911afb67fc1632866548efe151f6f10191b0)
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 e826a8bed447f3b3f9ad487f96ab7f8c7620c75b)
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 32951fe4de683f5d42cec2fb2e036f766b051e2b)
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 f4faac20730cbb339ae05ed6e20da687a2868e76)
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 1e2d1a7202400e08a00782f32804fdc503259806)
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 1e17e48b96bb509754a0a11ea8bd0394965564c6)
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 c8e7cfeddc7be498c688c564f31676b856181120)
2024-09-10 14:56:05 +02:00
Yu Watanabe
dda8cb4a8e test: fix indentation
(cherry picked from commit fe6049d0210c89a595ae598d87dcefe7bfbe3a1d)
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 56d6ebd40468e2a743b39ad7d87b0675bdf9a042)
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 08779d7c55add3a3bad5228d35012c15e92c47a5)
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 7908e1d459f5f2893d6aaf1d62009da7856f9410)
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 2701c2f67de592fe2565b084cfaec1667767dbaf)
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 ddc91af4eaa32511f92c83b2c24d9cc0425fd5f5)
2024-08-15 14:04:42 +01:00