1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

3354 Commits

Author SHA1 Message Date
Yu Watanabe
5ca6e6b81a test: split out host_has_{btrfs,mdadm}() from TEST-64-UDEV-STORAGE
(cherry picked from commit 5b4fa6f13cf860afa53c71b52e4ceca25f8f13a5)
(cherry picked from commit a40677469af941118a2d86a386cc7a7ad8ff17ca)
(cherry picked from commit a5ebe751c78cf7fc8af5060b981555adaa5ff34d)
(cherry picked from commit b17e7fca359a04f5d589944e507bda70dd147339)
2024-01-26 21:35:39 +00:00
Frantisek Sumsal
d33ecbc398 test: temporarily adjust the default mount rate limit
(Hopefully) a temporary workaround for #30573 where starting a user
session when PID 1 is rate limited stalls even after it leaves the rate
limited state:

[   11.658201] H systemd[1]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=4208 reply_cookie=0 signature=so error-name=n/a error-mes>
[   11.658233] H systemd[1]: Event source 0x559babdd8bb0 (mount-monitor-dispatch) left rate limit state.
[  101.562697] H busctl[784]: Failed to get credentials: Transport endpoint is not connected
[  101.563480] H systemd[1]: systemd-journald.service: Got notification message from PID 300 (WATCHDOG=1)
[  101.563725] H testsuite-74.sh[784]: BusAddress=unixexec:path=systemd-run,argv1=-M.host,argv2=-PGq,argv3=--wait,argv4=-pUser%3dtestuser,argv5=-pPAMName%3dlogin,argv6=systemd-stdio-bridge,argv7=-punix:path%3d%24%7bXDG_RUNTIME_DIR%7d/bus
[  101.564136] H systemd[1]: Successfully forked off '(sd-expire)' as PID 787.
[  101.564754] H systemd[1]: Successfully forked off '(sd-expire)' as PID 788.
[  101.564831] H testsuite-74.sh[381]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-74.busctl.sh failed'

The issue appeared after ee07fff03b which does a bunch of mounts/umounts
that get PID 1 into a rate limited state, and is frequent enough to be
annoying, so let's temporarily bump the rate limit to alleviate that.

(cherry picked from commit c707e346fbf4d8dba262f1af4fd25e2cb6b109b6)
(cherry picked from commit 4d60fb706918f32f3097687929debeb10a34bee9)
(cherry picked from commit 7215018ffcba7a783cbc19249c360bdf91f9aa8b)
(cherry picked from commit 202ae4d60de9c627d502c4a326956b81942021ed)
2024-01-26 21:35:39 +00:00
Frantisek Sumsal
a30781ec16 test: install correct kpartx udev rules on Debian
Resolves: #30703
(cherry picked from commit 519f0074cf87391b17a82ea983daed6183d62fb6)
(cherry picked from commit 44b9b9aca8019866d509f8770401acd5dde5f328)
(cherry picked from commit 4a08f3bde06c141f4eae7452c30ca93e6b035d94)
(cherry picked from commit a0ab92d4701eeefcc2a55b80046518ad8a6ad17e)
2024-01-26 21:35:39 +00:00
Yu Watanabe
11e885ffa3 test-network: add test case for issue #30403
(cherry picked from commit 5e46ca9890bb463644f91426678570edc2891163)
(cherry picked from commit fbe064cc74a7a25060d4311b5f3a616b02f3e9c9)
(cherry picked from commit d948b169ad6285adb2f5b32bbaccb013d4223f87)
(cherry picked from commit 29c975fca07b1e73908ca4fd07205431c4ff1696)
2023-12-24 10:01:00 +01:00
Frantisek Sumsal
2b1cc75930 test: install all necessary units & generators for LVM on Debian
And derivates.

Replaces: #30458
(cherry picked from commit f9ba9d3eb7c350f31132ccd9ed1ee3c0c693f5c5)
(cherry picked from commit b1dba6bcaae70849394f34be8850f2e5e2559633)
(cherry picked from commit dc7bc3d34e1cf87e6cf93ba901bd21af24b1ae71)
(cherry picked from commit 850d3d70bcab501fcc2a5df033435c0c0dd6664d)
2023-12-24 10:01:00 +01:00
Frantisek Sumsal
00a1ba3549 test: mask the mdmonitor.service
It's pulled in by one of the udev rules (63-md-raid-arrays.rules) and it
fails every time, because there's no valid email address in
/etc/mdadm.conf:

[    5.778153] testsuite-64.sh[403]: mdadm: array /dev/md/mdmirror started.
[    5.819137] kernel: md/raid1:md127: not clean -- starting background reconstruction
[    5.819141] kernel: md/raid1:md127: active with 2 out of 2 mirrors
[    5.819159] kernel: md127: detected capacity change from 0 to 129024
[    5.821950] kernel: md: resync of RAID array md127
...
[    5.887192] mdadm[424]: mdadm: No mail address or alert command - not monitoring.
[    5.890772] systemd[1]: Starting mdmonitor.service...
[    5.891718] systemd[1]: Started mdmonitor.service.
[    5.892570] systemd[1]: mdmonitor.service: Main process exited, code=exited, status=1/FAILURE
[    5.892618] systemd[1]: mdmonitor.service: Failed with result 'exit-code'.

And as we (re)assemble the MD devices multiple times, this gets quite
noisy, especially since we later start hitting the service start rate
limit.

Fedora has the mdmonitor.service patched, so it won't start without
/etc/mdadm.conf being present, but Arch uses the upstream unit which
doesn't have such guard.

Let's just mask the service completely, which replaces all that noise
with one warning:

[    6.553583] testsuite-64.sh[294]: + udevadm wait --settle ...
[    6.580700] systemd[1]: sys-devices-virtual-block-md127.device: Failed to enqueue SYSTEMD_WANTS job, ignoring: Unit mdmonitor.service is masked.

(cherry picked from commit 22e31655f3f9f54d932d4f48b92b36698e701729)
(cherry picked from commit ef548643668491d4a8371186d2575eb4e4499b4e)
(cherry picked from commit d2e8e28637d56e891c1882d8edda2985935a1bdd)
(cherry picked from commit ad7fbe4ec4325d3526f681b2d408b81fd19cdc0b)
2023-12-24 10:01:00 +01:00
Yu Watanabe
0c8872aa40 test-network: add test for small MTU for vcan
Prompted by https://github.com/systemd/systemd/issues/30140#issuecomment-1837973580.

(cherry picked from commit 470a329d9849d108e28f72d00dd130d130cebb01)
(cherry picked from commit 16f193d51861db4befd6228b773cf7a86c03339a)
(cherry picked from commit 6f584de56e86170c8e4bd426a4b4829b8343f1c0)
(cherry picked from commit 1cdd0c2804c9e991d5d083a32da36cc69a0b78dc)
2023-12-24 10:01:00 +01:00
Yu Watanabe
84732d642f parse-util: accept arbitrary MTU size when AF_UNSPEC
When [Link] MTU= is specified in a .network file, we have no idea about
that what kind of interface will be configured with the .network file.
The maximum and minimum MTU size depend on the kind of interface.
So, we should not filter MTU eagerly in the parser.

Closes #30140.

(cherry picked from commit a0460dfed617a73f7dbf36a6eb7e474e887ae780)
(cherry picked from commit 2fa0b50566829a2e72b61d9f453a5314192c19ab)
(cherry picked from commit cf8969ee3270413a8340cc824a9faa134227420c)
(cherry picked from commit 6ce4af1a43c4c26a2c1ff0d2a8a768c300fb69ce)
2023-12-24 10:01:00 +01:00
Yu Watanabe
768eca0286 network-generator: refuse unexpected trailing strings
(cherry picked from commit b86f60bfb3340a9fa27cb6f127fba7c827481b50)
(cherry picked from commit c2cc0ca17923034130a0dc1118b20f5a96db8d95)
(cherry picked from commit 7c894f8281818374306e912eaa7b975ca59c22ed)
2023-12-24 10:01:00 +01:00
Yu Watanabe
22378de9d9 network-generator: allow to specify both IPv4 and IPv6 DNS servers
Follow-up for 923599523c10d8897551e081e6b00cd8002309c3.

(cherry picked from commit 816c269e55220924c4f8b712afd976e83ec0359e)
(cherry picked from commit 6db250e4aee95a6c79f2724092e79b2162d70540)
(cherry picked from commit eb808e153462c67452dc25aba7466bfdce2f4f83)
2023-12-24 10:01:00 +01:00
Yu Watanabe
5926b8970d test: set working directory even if it is expected that the command fails
Otherwise, parsing may unexpectedly succeeds but fail to run writing
.network files with permission error.

Follow-up for 6bc5de53e8410fdec817300185b7ad72cd7775dd.

(cherry picked from commit 9e6d58796158d0418e0e4ba641db5b00aacee695)
(cherry picked from commit 2bc39320fc05ff133620e30be134a1d3f4383be7)
(cherry picked from commit a1295dd327d259c21b19e3d83a420cd1fb4c5765)
2023-12-24 10:01:00 +01:00
Frantisek Sumsal
fe417a55ec test: add a couple of tests for systemd-network-generator
Only for ip= stuff, for now.

(cherry picked from commit 6bc5de53e8410fdec817300185b7ad72cd7775dd)
(cherry picked from commit 75b2890c5d2ac1536459e7470f59369ad3e50a62)
(cherry picked from commit 4763b5d3fbd9b7ee70a6fba724de0f3beee84122)
2023-12-24 10:01:00 +01:00
Yu Watanabe
662ff90023 test: add test cases for issue #30357
(cherry picked from commit 9d51ab78300364c71a0e1f138e1d2cbc65771b93)
(cherry picked from commit d644d2f562051a86f7a8b2a8e382cee315463bd9)
(cherry picked from commit 948239494414da16147162871bac109b197c35e7)
(cherry picked from commit e60c4b4512c1885fdae7c00550516ef46bf08546)
2023-12-24 10:01:00 +01:00
Frantisek Sumsal
c548994873 test: backup /etc/udev/udev.conf only if it exists
On Fedora systemd recently moved all of its configuration files to
/usr/lib/ [0], so make sure we account for this case as well.

[   42.450325] testsuite-17.sh[800]: + mkdir -p /run/udev/rules.d
[   42.466504] testsuite-17.sh[800]: + cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp
[   42.503348] testsuite-17.sh[802]: cp: cannot stat '/etc/udev/udev.conf': No such file or directory

[0] 29eb35530b

(cherry picked from commit e23fc070e287397d2f047028f953986356badf2f)
(cherry picked from commit 49cc12975c761701e2dc0dc84ee1928b38f98c54)
(cherry picked from commit a22613dd2a13d4f66eef4f132a9c654b87e9b61f)
(cherry picked from commit 82cbbce8e7074f80222477982fb5267c072ea9a0)
2023-12-24 10:01:00 +01:00
Frantisek Sumsal
e0d8abd272 test: reset systemd-udevd.service restart counter
Since we restart systemd-udevd here a couple of times, we might hit the
rate limit in later tests:

[   26.028355] testsuite-17.sh[2074]: + udevadm control -e
[   26.028355] testsuite-17.sh[2074]: + udevadm control -l emerg
[   26.126160] systemd[1]: systemd-udevd.service: Start request repeated too quickly.
[   26.126213] systemd[1]: systemd-udevd.service: Failed with result 'start-limit-hit'.
[   26.140310] systemd[1]: Failed to start systemd-udevd.service.
[   26.140897] systemd[1]: systemd-udevd-control.socket: Failed with result 'service-start-limit-hit'.
[   26.141286] systemd[1]: systemd-udevd-kernel.socket: Failed with result 'service-start-limit-hit'.
[   26.142225] testsuite-17.sh[2074]: + udevadm control -l alert
[   26.149206] udevadm[2088]: Failed to send request to set log level: No such file or directory

Follow-up to: 6ef512c0bb

(cherry picked from commit ad23ff13deb4e057d435adb941e58cd552beac02)
(cherry picked from commit 7d029ce868c42f668e692d7a3bf9e22c778840ab)
(cherry picked from commit 8e43acfd06b917a3f056761f2a413d9584b4769e)
(cherry picked from commit 0984feb087c55558094340d6c8fa8d9010059cdd)
2023-12-24 10:01:00 +01:00
janana
976e089877 rules: go to the end of rules indeed when dm is suspended
The previous patch 466266c does not make sense indeed, that is to say, if the SYSTEMD_READY is not recorded in the database, the GOTO="systemd_end" will not be applied.

The IMPORT{db} is actually a matching token, it returns false when there is no SYSTEMD_READY recorded in the database.

The previous patch 466266c tended to inherit the state of SYSTEMD_READY from the database and skip to the end of current rule file. But when the database does not contain SYSTEMD_READY, e.g., the dm-* is not set db_persistent during initrd and the database will be cleared after switching root, the following rules will still be applied not as expected.

(cherry picked from commit c1a2ada89708d6aeeada496712cb24a4a58e75cc)
(cherry picked from commit 7237dfc88257656540c1dc237bb03258fe7886ac)
(cherry picked from commit 85ee15a81300f6ecf41b8d0f89672cc338a9b098)
2023-12-06 20:35:33 +00:00
Frantisek Sumsal
6fbdf48d2b test: drop 'noearly' from crypttab
It's a Debian thing, we don't support it.

[   30.639971] testsuite-64.sh[475]: + systemctl restart cryptsetup.target
[   30.697667] systemd-cryptsetup[3389]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700529] systemd-cryptsetup[3390]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700594] systemd-cryptsetup[3391]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.704638] systemd-cryptsetup[3392]: Encountered unknown /etc/crypttab option 'noearly', ignoring

(cherry picked from commit 7a2d6c2d08ec1e1ebe1eeae46dad4c7e5e084eae)
(cherry picked from commit 472cfea5e3a0f32100430c5d51341b37c27e2532)
(cherry picked from commit 1c89efb03dd4dc55d097bf4435ed80cb9d3764d6)
2023-12-06 20:35:33 +00:00
Frantisek Sumsal
ebaf37889a test: drop invalid LogTarget= assignment
It's been there since the test was introduced and I'm not really sure
what was the original intention behind it, but it makes systemd sad:

[    4.909056] systemd[1]: /usr/lib/systemd/tests/testdata/units/testsuite-44.service:13: Unknown key name 'LogTarget' in section 'Service', ignoring.

(cherry picked from commit d1ac1aa5ca8981e00ac97050c257ff5ee6665770)
(cherry picked from commit 87ac9e3a733a6940a39b161767e34cba9546fa34)
(cherry picked from commit 9560c621fa0e06835ae8f0c6f33bfe986cebe82c)
2023-12-06 20:35:33 +00:00
Yu Watanabe
9be6ba4ac7 network/dhcp: actually refuse to assign DHCP option when an invalid string is passed
Prompted by #30029.

(cherry picked from commit fbf946ce22ef778bf6bf04c117b75c9c63ac7e66)
(cherry picked from commit f0e8b27466cfda5886c8316866deecd36b5143ab)
(cherry picked from commit 60097b792d198d3cd2c2ad7ec44c7ba0cf0d835a)
2023-12-06 20:35:33 +00:00
Luca Boccassi
94d4d9e3e3 portablectl: fix detaching when an extension image has been deleted
(cherry picked from commit ba8eda568c760cc1b4eb9edcfd1b29818619ce70)
(cherry picked from commit 2d6ee8dba28c8215da6da41738ca20a536d148c4)
(cherry picked from commit c223ca51ac99b682be2ed87ed5fc84c95ecf2161)
2023-12-06 20:35:33 +00:00
Frantisek Sumsal
f002c6a680 test: retry the property check a couple of times
41e4ce06fe shortened existing sleeps, which resulted in the check being
sometimes done before the property had a chance to update. Let's do what
what we do with the rest of the checks and retry it a couple of times.

Resolves: #29923
(cherry picked from commit 4e55082f74e7be0669912862a95ed669197ffdb4)
(cherry picked from commit 35724455b225c61890061c24551469064fd0ba65)
(cherry picked from commit c77b806c73495943c9818b4f3c6cdd687e2ac9ee)
2023-11-10 00:22:41 +00:00
Peter Hutterer
fd2a611f8c analyze: handle CAP_BPF support
(cherry picked from commit 4f7a629e6c11fb2f060f18a62d073410ffa5a0ca)
(cherry picked from commit f58b5ce7dc8232f2305b9c8ce2e73b626a9d0dd8)
(cherry picked from commit cc09085ac30cec40a6863a018471fad65973f6bd)
2023-11-10 00:22:41 +00:00
Frantisek Sumsal
86e5493ffd test-network: copy rules from source & build trees if needed
When running with --build-dir= we need to copy over udev rules from
$BUILD_DIR/udev.d/ and $SOURCE_TREE/udev.d/ to make stuff work as
expected.

(cherry picked from commit 33b0e0c09a438fd565b6c4d059bd14cc9651c40b)
(cherry picked from commit 359fed84eea82238a7ccdf5eb76d635afefdcaa4)
(cherry picked from commit aefe546793830371e8bac3f0e12891862df7b89d)
2023-11-10 00:22:41 +00:00
Daniel P. Berrangé
a26ba37b9d test-systemd-tmpfiles: skip when /tmp has unexpected ownership
The systemd-tmpfiles binary will report a fatal error if /tmp is not owned
either by root, or by the current user:

  Detected unsafe path transition /tmp (owned by nobody) →
    /tmp/test-systemd-tmpfiles.a8qc6n18 (owned by berrange)
    during canonicalization of
    tmp/test-systemd-tmpfiles.a8qc6n18/test-content.7chd7rdi

When doing development inside a 'toolbox' container (which is required
on a Fedora SilverBlue distro), /tmp is owned by 'nobody', because it
has been passed through from the host and host UID 0 gets mapped to
UID 65536 by usernamespaces. This triggers the unsafe path transition
error message.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 8473ece90e53040931c880bcbff623f1a5c037cd)
(cherry picked from commit c7482035e3cefbfae2a1cc4b4529ebb705d67531)
(cherry picked from commit 95cbb9e857dc9dec07041d9d85a09928d44107c1)
2023-11-10 00:22:41 +00:00
Franck Bui
07ec2e08f0 test: install af_packet kernel module on openSUSE
Currently needed by test-dhcp-server unit test, af_packet is not built-in on
openSUSE distributions.

(cherry picked from commit a1af99df8e29ffb55b0c698eeda2c9bf795fc0e1)
(cherry picked from commit db2193609e554732c0288ccf27d5e58083f9219c)
(cherry picked from commit 0a48f8ac7b0e4cf288b9f2aa05257424d2926288)
2023-11-10 00:22:41 +00:00
Luca Boccassi
1e5f1147a2 test: fix check in test unit in TEST-50-DISSECT
'[[ not found'

(cherry picked from commit c7986bc9b64e095399c3e380441b4de26d1276a1)
(cherry picked from commit 52d4f5ec539c746c9a61a3bb4607f965a36675fe)
(cherry picked from commit 5b900490f97f47f8b23803778bc74b6047916638)
2023-11-10 00:22:41 +00:00
Maanya Goenka
2a397a0a80 fix: do not check/verify slice units if recursive errors are to be ignored
Before this fix, when recursive-errors was set to 'no' during a systemd-analyze
verification, the parent slice was checked regardless. The 'no' setting means that,
only the specified unit should be looked at and verified and errors in the slices should be
ignored. This commit fixes that issue.

Example:

Say we have a sample.service file:

[Unit]
Description=Sample Service

[Service]
ExecStart=/bin/echo "a"
Slice=support.slice

Before Change:

systemd-analyze verify --recursive-errors=no maanya/sample.service
Assertion 'u' failed at src/core/unit.c:153, function unit_has_name(). Aborting.
Aborted (core dumped)

After Change:
systemd-analyze verify --recursive-errors=no maanya/sample.service
{No errors}

(cherry picked from commit f660c7fa56b247c278fdb2ebcfea37912f249524)
(cherry picked from commit e48c57c5c2f6af3601f6e0f66d77e548efe14f93)
(cherry picked from commit 3f5729a51a2ae55a1017e00da81a261585f3f2d8)
2023-11-10 00:22:41 +00:00
Frantisek Sumsal
300725ebb2 test: wait for the swtpm socket to appear
On slower/overloaded systems it may take a bit for the swtpm socket
to show up:

I: Started swtpm as PID 189419 with state dir /tmp/tmp.pWqUutuGUj
I: Configured emulated TPM2 device tpm-spapr
+ tee /var/tmp/systemd-test-TEST-70-TPM2_1/console.log
+ timeout --foreground 1200 /bin/qemu-system-ppc64le -smp 4 ...
qemu-system-ppc64le: -chardev socket,id=chrtpm,path=/tmp/tmp.pWqUutuGUj/sock: Failed to connect to '/tmp/tmp.pWqUutuGUj/sock': No such file or directory
E: qemu failed with exit code 1

Spotted regularly in the ppc64le cron job and in some Ubuntu CI/CentOS CI
pr runs [0].

[0] https://github.com/systemd/systemd/pull/29183#issuecomment-1721727927

(cherry picked from commit 18c3ffbfcc2d4d6d1a4680092123e510945f7a78)
(cherry picked from commit 2171f689b8596458e21ac75766326431c7d151cc)
(cherry picked from commit bf449d79bb687cb9283d9290db9cd6306fd70943)
2023-09-28 18:49:38 +01:00
Frantisek Sumsal
c08e879669 test: don't panic on soft lockups
We can't do anything about them anyway, and most importantly this seems
to alleviate systemd/systemd-centos-ci#660, which should make the CIs
a bit less angry (at least until the issue is addressed properly).

(cherry picked from commit 3a89904e45cbbd96fb1c5d0768de5e5fcdaaa508)
(cherry picked from commit af7d007f897818068965a6500798815cc1335b72)
(cherry picked from commit 4dfce10b1261aa47ad47dedc4cccf0e26799d6e5)
2023-09-28 18:49:38 +01:00
Yu Watanabe
0531c47e96 wait-online: request that at least one managed online interface exists
Fixes a regression caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d.

I thought the commit does not cause any severe regression. However,
drivers for network interfaces may be loaded later. So, we should wait
if no network interface is found.

Fixes #27822.

(cherry picked from commit 2f96a29c2c55bdd67cdd8e0b0cfd6971968e4bca)
(cherry picked from commit abbd24e8a51d9b6ffcf99c8cfe89d9faba23ebdb)
2023-09-08 16:35:10 +01:00
Yu Watanabe
5ad5807106 test-network: add testcase for no managed interface
(cherry picked from commit 56dfde0d5451380bfc119742cd8f6d8aed2bc9d0)
2023-09-08 16:35:10 +01:00
Yu Watanabe
8c9b36f1be test-network: split out wait-online related test case
(cherry picked from commit b09ec84700d4a645e047e156284ada54fe8b6d7d)
2023-09-08 16:35:10 +01:00
Luca Boccassi
5090681624 portablectl: fix regression when using --force without extension parameters
c18f4eb9e96836a made it possible to use --force with various verbs, by
going through the newer D-Bus methods. Except it didn't, as it regressed
during PR review refactorings, and nobody noticed because there were no
tests for it. Fix it, and add tests.

Follow-up for c18f4eb9e96836a6a8285ec42fd8a34c8909f6d9

(cherry picked from commit bdfa3f3a5c6d16d56d432e7bc52be0c03a5ce6ad)
(cherry picked from commit 0f27d7b9f9cda1aa4e0d56cabd517e9a95026cf2)
(cherry picked from commit 8f3ec30c467947b7d5e28c70a3bb8bd70eb229b3)
2023-08-10 09:43:05 +01:00
Yu Watanabe
0efa20c2ee network-generator: make network file generated from ip=dhcp matches only physical interfaces
Otherwise, it also matches later created virtual devices, and that
breaks networks generated and managed by container management services,
like docker.

Closes #28626.

(cherry picked from commit c25aa6c8acc6d95eaacae7858a7057907d61a25e)
(cherry picked from commit d39bfd26d47793fc95aabfd9ff4f32e8d63d1021)
(cherry picked from commit 2c2b89aeded6aa34526a7d1a59232e7bd7495f40)
2023-08-10 09:43:05 +01:00
Franck Bui
f33be2e66b test: install systemd-homed for openSUSE
This new sub-package has been recently introduced.

(cherry picked from commit 33ce0a899258ed8dfb4a234a9f67e678127d41f9)
(cherry picked from commit 65d5b3561c2692e947327e9a77d3b1b4d932c828)
(cherry picked from commit 8541307b23b7ecef25bc7cb2c7aa86d0075b962a)
2023-08-10 09:43:05 +01:00
Franck Bui
d1f141dbff test: console fonts are located in /usr/share on openSUSE
(cherry picked from commit ba0ff9fc0fa657024edd7a4a0aab01aa95b39ff5)
(cherry picked from commit ca0c8adf9d6d348cd59e12282e1effab4a39c5f3)
(cherry picked from commit c65270ef5fd525e2353e02c7a1e5b029f52bab82)
2023-08-10 09:43:05 +01:00
Luca Boccassi
d55810e027 Revert "test-network: drop ExecReload= in networkd.service and udevd.service"
The required change is in v253 but not in any older releases, so this
test change needs to be reverted.

This reverts commit 27c9d9bf3dc030a5e3048ceec7e7348e694b3870.
2023-07-09 14:32:26 +01:00
Frantisek Sumsal
6700231d52 test: replace readfp() with read_file()
ConfigParser.readfp() has been deprecated since Python 3.2 and was
dropped completely in Python 3.11.

(cherry picked from commit ba4a1cd8a863f65ff016be72e520c323aa1e1a6f)
(cherry picked from commit 7dc6cccc4b3b699ba36da31a410af91badd0f13a)
2023-07-08 10:42:52 +01:00
Yu Watanabe
7cf1bc00b0 test-network: add one more testcase for DHCPv4 classless route
For issue #28280.

(cherry picked from commit 86f6760038477e9e27ccea580f1b3b27328a98a7)
(cherry picked from commit f74337b7565348a9bd44baae27917b2a202dcf1a)
2023-07-08 10:42:52 +01:00
Yu Watanabe
27c9d9bf3d test-network: drop ExecReload= in networkd.service and udevd.service
Follow-up for 0e07cdb0e77d0322bc866b5e13abbe38e988059d and
f84331539deae28fbeb42d45ad0c8d583b3372a3.

(cherry picked from commit 62eaf8d039a14e7bc4e682fa3ad4b3bfe366c29a)
(cherry picked from commit 21181e2e1c1648b163213d6371f1592710220b93)
2023-07-08 10:42:52 +01:00
Yu Watanabe
bf8ffee6ec test: update test for free area calculation in repart
(cherry picked from commit 937625c7c72e503d03b406de3e1859d7f00dbdcf)
(cherry picked from commit f03f365dc134c4dcbc375f431f0ead321b02dfe1)
2023-07-08 10:42:52 +01:00
Yu Watanabe
68fba1a7ef test: add reproducer for issue #28225
(cherry picked from commit beba8f2e1e5f08041d2a9955398a64d92dcc75a0)
(cherry picked from commit 2cda7651ac9013f870b8b2853e229f672dba4a47)
2023-07-08 10:42:52 +01:00
Yu Watanabe
9aab5b81a5 test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).

(cherry picked from commit e4948bb2cdd1c8d1b6fc357e5b817170612aae33)
(cherry picked from commit 16ddaafe3e061752787df0cff097d8bcf4e72625)
2023-07-08 10:42:52 +01:00
Yu Watanabe
d4147bd6bc test-network: check route more strictly
(cherry picked from commit 7e30527806956b7240ca7bf8d92038170fda44d0)
(cherry picked from commit a8db4fcac4cfe372df7fb3444eff76223dcde6b1)
2023-07-08 10:42:52 +01:00
Frantisek Sumsal
0e2a4bb013 test: fix test_vxlan with the latest iproute2
Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72
(cherry picked from commit a5e478b24c7c6bcb210a2fa7d3ccce1d381a19b7)
(cherry picked from commit 67aaab3381e8304993a0d33d25e2fdbe49373dd5)
2023-07-08 10:42:52 +01:00
Frantisek Sumsal
163be31d38 core: reorder systemd arguments on reexec
When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

See: https://github.com/systemd/systemd/issues/28184
(cherry picked from commit 06afda6b38d5d730fca3c65449096425933272bc)
(cherry picked from commit 884ab38057dca70b8779c85884f4646057e80921)
2023-07-08 10:42:52 +01:00
Frantisek Sumsal
7d667e5341 test: enable LSan for certain wrapped binaries
So we're able to detect memory leaks in our NSS modules.

An example after introducing a memory leak in nss-myhostname.c:

testsuite-71.sh[2881]: =================================================================
testsuite-71.sh[2881]: ==2880==ERROR: LeakSanitizer: detected memory leaks
testsuite-71.sh[2881]: Direct leak of 2 byte(s) in 1 object(s) allocated from:
testsuite-71.sh[2881]:     #0 0x7fa28907243b in strdup (/usr/lib64/libasan.so.8.0.0+0x7243b)
testsuite-71.sh[2881]:     #1 0x7fa286a7bc10 in gethostname_full ../src/basic/hostname-util.c:67
testsuite-71.sh[2881]:     #2 0x7fa286a74af9 in gethostname_malloc ../src/basic/hostname-util.h:24
testsuite-71.sh[2881]:     #3 0x7fa286a756f4 in _nss_myhostname_gethostbyname4_r ../src/nss-myhostname/nss-myhostname.c:79
testsuite-71.sh[2881]:     #4 0x7fa288f17588 in getaddrinfo (/lib64/libc.so.6+0xf4588)
testsuite-71.sh[2881]:     #5 0x7fa2890a4d93 in __interceptor_getaddrinfo.part.0 (/usr/lib64/libasan.so.8.0.0+0xa4d93)
testsuite-71.sh[2881]:     #6 0x55a54b2b7159 in ahosts_keys_int.part.0 (/usr/bin/getent.orig+0x4159)
testsuite-71.sh[2881]: SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).

(cherry picked from commit 2b5e786005d8854600bb43335fd0c4067ce8da08)
(cherry picked from commit 5a29fbba6cdfdb098a9b1ed1ce60ecdbd62f12ac)
2023-07-08 10:42:52 +01:00
Luca Boccassi
79bfbb0163 TEST-55-OOMD: use swap file instead of partition
The partition seems not to work on Ubuntu for some reason, use a
swap file instead

(cherry picked from commit f434f182ccfd17a214e4b07cec033318e6c4f7b2)
(cherry picked from commit 39459a5d8065ea5ce45dbca39561bd078d801aa0)
2023-07-08 10:42:52 +01:00
Luca Boccassi
cad0dba2f8 TEST-55-OOMD: use 'stress' to create high pressure
The test fails on my machine, running Debian stable, because
testsuite-55-testbloat.service just swaps and never goes over the
limit, so it's not killed. Use 'stress' instead which seems to be
able to overwhelm the swap too.

(cherry picked from commit 937e82cb7d82dbdbd287d82f4708f15d6032eb9f)
(cherry picked from commit 9654140f342df74b8572da1fa4d5969f3d9b4617)
2023-07-08 10:42:52 +01:00
Frantisek Sumsal
4ac2071192 test: test transactions with cycles
Provides coverage for systemd/systemd#26872.

With systemd/systemd#26875 reverted:

[16444.287652] testsuite-03.sh[71]: + for i in {0..19}
[16444.287652] testsuite-03.sh[71]: + systemctl start transaction-cycle0.service
[16444.359503] systemd[1]: =================================================================
[16444.360321] systemd[1]: ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002e578e at pc 0x7f73b25ec7a6 bp 0x7ffc5531c6f0 sp 0x7ffc5531be68
[16444.360798] systemd[1]:
[16444.361044] systemd[1]: READ of size 783 at 0x6180002e578e thread T0 (systemd)
[16444.391684] systemd[1]:     #0 0x7f73b25ec7a5  (/lib64/libasan.so.5+0x557a5)
[16444.392167] systemd[1]:     #1 0x7f73b260a1d5 in __interceptor_vasprintf (/lib64/libasan.so.5+0x731d5)
[16444.392442] systemd[1]:     #2 0x7f73afa1d1e1 in log_format_iovec ../src/basic/log.c:996
[16444.392750] systemd[1]:     #3 0x7f73afa1e7b6 in log_struct_internal ../src/basic/log.c:1058
[16444.393101] systemd[1]:     #4 0x7f73b1979136 in transaction_verify_order_one ../src/core/transaction.c:392
[16444.393540] systemd[1]:     #5 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.393946] systemd[1]:     #6 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394262] systemd[1]:     #7 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394532] systemd[1]:     #8 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394812] systemd[1]:     #9 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
...

(cherry picked from commit 0651e717496aed30bcec7740286d719860995625)
(cherry picked from commit fdc6ce1d00387320b81e1a27d9bb8d5dea0171f9)
2023-07-08 10:42:52 +01:00