summaryrefslogtreecommitdiffstats
path: root/test (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: backup /etc/udev/udev.conf only if it existsFrantisek Sumsal2023-12-081-8/+8
| | | | | | | | | | | 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] https://src.fedoraproject.org/rpms/systemd/c/29eb35530b29232eed65718d0cd96d67cd7ffd6b?branch=rawhide
* test: reset systemd-udevd.service restart counterFrantisek Sumsal2023-12-081-0/+1
| | | | | | | | | | | | | | | | | 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
* core: create workdir/upperdir when mounting a Type=overlay mount unitLuca Boccassi2023-12-081-0/+6
| | | | | | | | So far we created the target directory, and the source for bind mounts, but not workdir/upperdir for overlays, so it has to be done separately and strictly before the unit is started, which is annoying. Check the options when creating directories, and if upper/work directories are specified, create them.
* install: don't translate unit instances to paths when reenabling themFrantisek Sumsal2023-12-081-1/+29
| | | | | | | | | | | | | | | | | | | | | | For unit instances install_info_discover() returns path to the template, which then generates confusing errors when passed to do_unit_file_enable(): ~# build/systemctl --root=/tmp/systemctl-test.N9ysbz reenable templ1@two.service Unit name: templ1@two.service; p: /etc/systemd/system/templ1@.service Removed "/tmp/systemctl-test.N9ysbz/etc/systemd/system/services.target.wants/templ1@two.service". Failed to reenable templ1@.service, destination unit services.target is a non-template unit. This can also be seen with a different reproducer using getty@.service and a simple bind mount to / - there's no error this time, but it tries to create a symlink for the default instance (from DefaultInstance=tty1), which is also incorrect: ~# SYSTEMD_LOG_LEVEL=debug systemctl --root /mnt/bindroot/ reenable getty@test.service Symlink /mnt/bindroot/etc/systemd/system/getty.target.wants/getty@tty1.service → /usr/lib/systemd/system/getty@.service already exists Follow-up to: 29a7c59abbe Resolves: #24740
* core: relax dependency on RootImage= storage from Requires= to Wants=Luca Boccassi2023-12-082-0/+23
| | | | | | | If a unit is running in an image and wants to survive a soft-reboot, then it can't be deactivated by the storage of the image going away. Relax the dependency to a Wants=. Access to the image is not needed when the unit is running anyway, so downgrade to Wants=.
* core: do not make private /dev/ read-only too soonLuca Boccassi2023-12-081-0/+10
| | | | | | | | The read-only bit is flipped after setting up all the mounts, so that bind mounts can be added. Remove the early config, and add a unit test. Fixes https://github.com/systemd/systemd/issues/30372
* Merge pull request #30060 from poettering/analyze-archsYu Watanabe2023-12-071-0/+7
|\ | | | | analyze: add "archs" verb that lists all known architectures
| * analyze: add "architectures" verb that lists all known architecturesLennart Poettering2023-12-061-0/+7
| |
* | journalctl: don't skip over messages not matching the cursorFrantisek Sumsal2023-12-071-0/+24
| | | | | | | | | | | | | | | | | | | | | | When --after-cursor=/--cursor-file= is used together with a journal filter, we still skipped over the first matching entry even if it wasn't the entry the cursor points at, thus missing one "valid" entry completely. Let's fix this by checking if the entry cursor after seeking matches the user provided cursor, and skip to the next entry only when the cursors match. Resolves: #30288
* | Merge pull request #30316 from mrc0mmand/revert-journal-upload-userZbigniew Jędrzejewski-Szmek2023-12-062-5/+7
|\ \ | | | | | | Revert "sysusers.d: create the user for systemd-journal-upload.service"
| * | test: set correct group for systemd-journal-upload testsFrantisek Sumsal2023-12-052-5/+7
| | | | | | | | | | | | | | | | | | We can't use the systemd-journal-upload user here, since it's created dynamically by DynamicUser=yes. However, we can use the group specified in SupplementaryGroups=, so do exactly that.
* | | Merge pull request #30302 from keszybz/systemd-edit-stdinZbigniew Jędrzejewski-Szmek2023-12-061-0/+16
|\ \ \ | | | | | | | | systemctl edit --stdin
| * | | TEST-26: add test for systemctl edit --stdinZbigniew Jędrzejewski-Szmek2023-12-051-0/+16
| |/ /
* | | Merge pull request #30085 from YHNdnzj/networkctl-edit-runtimeZbigniew Jędrzejewski-Szmek2023-12-061-2/+10
|\ \ \ | | | | | | | | networkctl: introduce --runtime for editing network config under /run/
| * | | networkctl: introduce --runtime for editing network config under /run/Mike Yuan2023-12-021-2/+10
| |/ /
* | | Merge pull request #29987 from yuwata/network-bridge-vlanZbigniew Jędrzejewski-Szmek2023-12-069-11/+162
|\ \ \ | | | | | | | | network: remove unnecessary bridge vlan IDs
| * | | test-network: extend tests for [BridgeVLAN] settingsYu Watanabe2023-11-129-11/+162
| | | |
* | | | Merge pull request #29853 from YHNdnzj/sleep-automatedZbigniew Jędrzejewski-Szmek2023-12-062-0/+21
|\ \ \ \ | | | | | | | | | | logind: support Sleep() that automatically choose a sleep operation
| * | | | logind: introduce Sleep() call and action that automatically choose a sleep ↵Mike Yuan2023-12-052-0/+21
| | | | | | | | | | | | | | | | | | | | operation
* | | | | journal-gatewayd: add since/until parameters for /entriesSamuel BF2023-12-061-0/+25
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Request with Range header like 'entries=<cursor>:' (with a colon at the end, invalid syntax per the doc), is now rejected with error 400 Bad Request. fix #4883
* | | | Merge pull request #30214 from bluca/wants_mounts_forLuca Boccassi2023-12-063-1/+25
|\ \ \ \ | | | | | | | | | | Add WantsMountsFor= and use it in the cryptsetup generator
| * | | | cryptsetup: use WantsMountsFor= for key/header when nofail is setLuca Boccassi2023-11-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header and keyfile are necessary only for opening the device, not for closing, so it is not necessary to deactivate the generated cryptsetup unit when the header or keyfile backing store are removed. This is especially useful in the case of softreboot, when the new mount root is setup under /run/nextroot/ but we don't want to close the cryptsetup devices for encrypted /var/ or so, and we simply mount it directly on /run/nextroot/var/ before the soft-reboot.
| * | | | core: add WantsMountsFor=Luca Boccassi2023-11-292-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the equivalent of RequiresMountsFor=, but adds Wants= instead of Requires=. It will be useful for example for the autogenerated systemd-cryptsetup units. Fixes https://github.com/systemd/systemd/issues/11646
* | | | | test: Add test case for --make-ddi=sysextDaan De Meyer2023-12-061-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Also make sure that the sysext is big enough to not fit in the minimum partition size so we know Minimize= is being used.
* | | | | test: load the io controller before checking if io.latency existsFrantisek Sumsal2023-12-051-1/+2
| |/ / / |/| | | | | | | | | | | Otherwise the following test gets always skipped.
* | | | test: reenable TEST-30 on i*86Frantisek Sumsal2023-12-041-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | The original reason for deny-listing it was that it's flaky there. I'm not sure if that's still the case, but the Ubuntu CI jobs for i*86 are gone, so this file shouldn't be needed anymore anyway.
* | | | test: skip TEST-36 on s390x and powerpcFrantisek Sumsal2023-12-042-0/+5
| | | | | | | | | | | | | | | | | | | | As QEMU there doesn't support NUMA nodes. Also, drop the now unneeded deny-list file for Ubuntu CI.
* | | | test: check if 'btrfs filesystem' supports 'mkswapfile'Frantisek Sumsal2023-12-042-0/+5
| | | | | | | | | | | | | | | | | | | | Instead of deny-listing the test on Ubuntu CI, so it gets enabled automagically once btrfs-progs is updated to a newer version there.
* | | | test: reenable TEST-25-IMPORT in Ubuntu CIFrantisek Sumsal2023-12-041-0/+0
| |_|/ |/| | | | | | | | Let's see if #13973 is still an issue.
* | | core: do not drop CAP_SETUID if it is in AmbientCapabilities=Luca Boccassi2023-12-011-0/+10
| | | | | | | | | | | | Follow-up for 24832d10b604848cf46624bb439c7fac27f3ce3f
* | | sd-journal: fix corrupted journal handling of generic_array_bisect()Yu Watanabe2023-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's consider the following case: - the direction is down, - no cached entry, - the array has 5 entry objects, - the function test_object() reutns TEST_LEFT for the 1st object, - the 2nd, 3rd, and 4th objects are broken, so generic_array_bisect_step() returns TEST_RIGHT for the object. Then, previously, generic_array_bisect_step() updated the values like the following: 0th: (m = 5, left = 0, right = 4, i = 4) -> (m = 4, left = 0, right = 3, RIGHT) 1st: (m = 4, left = 0, right = 3, i = 1) -> (m = 4, left = 2, right = 3, LEFT) 2nd: (m = 4, left = 2, right = 3, i = 2) -> (m = 2, left = 2, right = 1, RIGHT) <- ouch!! So, assert(left < right) in generic_array_bisect() was triggered. See issue #30210. In such situation, there is no matching entry in the array. By returning TEST_GOTO_PREVIOUS, generic_array_bisect() handles the result so. Fixes a bug introduced by ab8f553d1e09088fb1f633e014299e7bf6c30c9e. Fixes #30210.
* | | test: ignore gcov errors with RestrictFileSystems=Frantisek Sumsal2023-11-291-2/+5
|/ / | | | | | | | | | | | | The errors are valid, since the file system is indeed not writable, but we don't care about the missing coverage data in this case. Follow-up to 4a43c2b3a1.
* | rules: go to the end of rules indeed when dm is suspendedjanana2023-11-291-1/+3
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #30203 from yuwata/resolve-dump-cacheLuca Boccassi2023-11-2811-14/+19
|\ \ | | | | | | resolve: fix varlink message verification
| * | test: verify json format passed through varlinkYu Watanabe2023-11-273-4/+11
| | | | | | | | | | | | | | | | | | | | | This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal, as the expected logs from test-varlink-idl makes the post script fail. Saving logs in journal is simply noisy, and we will output anyway after qemu or nspawn finished by check_result_{qemu,nspawn}_unittests().
| * | test: show saved journal files after TEST-02-UNITTESTSYu Watanabe2023-11-271-0/+2
| | |
| * | test: drop remaining console outputYu Watanabe2023-11-276-10/+1
| | | | | | | | | | | | | | | | | | | | | Follow-up for fa6f37c04391d0103c95e24813ad345c2d5c4b67. Partially reverts d5ab23aa54229e9e89427e7d20883bd8c93fd976 and 3540ce8587cbd21ce9c2dbec72ea7fa3d1b38a5f.
| * | test: add simple coverity test for 'resolvectl show-cache'Yu Watanabe2023-11-271-0/+5
| | |
* | | Merge pull request #30216 from poettering/loginctl-table-tweaksLuca Boccassi2023-11-281-1/+1
|\ \ \ | | | | | | | | loginctl: minor tweaks to tabular output
| * | | loginctl: set appropriate ersatz strings for all tablesLennart Poettering2023-11-281-1/+1
| |/ /
* / / test: check journal files are not corrupted after soft-rebootYu Watanabe2023-11-281-0/+7
|/ /
* | Merge pull request #30170 from bluca/exec_bpf_fdLuca Boccassi2023-11-272-0/+50
|\ \ | | | | | | core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set
| * | test: add a couple of tests for RestrictFileSystems=Frantisek Sumsal2023-11-242-0/+50
| | |
* | | test: drop 'noearly' from crypttabFrantisek Sumsal2023-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | test: drop invalid LogTarget= assignmentFrantisek Sumsal2023-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | | 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.
* | | test: remove the reboot counter just before spawning container/VMFrantisek Sumsal2023-11-251-3/+4
| | | | | | | | | | | | | | | Doing that in test_run() is not enough, since it's called only once and spawns all QEMU/nspawn jobs.
* | | test: don't redirect stdout/stderr to consoleFrantisek Sumsal2023-11-241-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that redirecting a lot of output to the console can have some funny effects, like random kernel soft lockups. I spotted this in various CIs, but it remained almost entirely hidden thanks to `softlockup_panic=1`, until 1a36d2672f which introduced a couple of tests that log quite a lot in a short amount of time. This, in combination with newer kernel version, which, for some reason, seem to be more susceptible to such soft lockups, made the Arch Linux jobs soft lockup quite a lot, see [0]. While debugging this I also noticed that runs which don't redirect stdout/stderr to the console are noticeably faster, e.g.: # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal+console Elapsed (wall clock) time (h:mm:ss or m:ss): 0:24.64 # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal Elapsed (wall clock) time (h:mm:ss or m:ss): 0:17.95 # TEST-71 nspawn + QEMU, StandardOutput=journal+console Elapsed (wall clock) time (h:mm:ss or m:ss): 2:04.70 # TEST-71 nspawn + QEMU, StandardOutput=journal Elapsed (wall clock) time (h:mm:ss or m:ss): 1:44.48 # TEST-04 QEMU, StandardOutput=journal+console Elapsed (wall clock) time (h:mm:ss or m:ss): 4:22.70 # TEST-04 QEMU, StandardOutput=console Elapsed (wall clock) time (h:mm:ss or m:ss): 5:04.67 Given all this, let's effectively revert ba7abf79a5, and dump the testsuite-related journal messages only after the test finishes, so they don't go through the slow console. Resolves: systemd/systemd-centos-ci#660 [0] https://github.com/systemd/systemd-centos-ci/issues/660
* | | test: don't make the final vacuum multiple of 8MFrantisek Sumsal2023-11-241-1/+1
| | | | | | | | | | | | | | | As this would usually mean we'd nuke everything, since there are two open journals - system and user - both being 8M in size.
* | | test: clean up the save_journal() stuff a bitFrantisek Sumsal2023-11-241-26/+31
|/ / | | | | | | | | | | Let's save all journals from the test machine instead of calling export on each journal file separately, which makes the code less complicated (and probably faster).
* | Merge pull request #30024 from keszybz/one-doc-thingyLuca Boccassi2023-11-222-0/+6
|\ \ | | | | | | Serialize units ratelimits and document StartLimitIntervalSec=infinity