summaryrefslogtreecommitdiffstats
path: root/test (follow)
Commit message (Collapse)AuthorAgeFilesLines
* TEST-15: add daemon-reload in one placeZbigniew Jędrzejewski-Szmek2022-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Quoting https://github.com/systemd/systemd/pull/25050#discussion_r998721845: This part seems to be quite racy, at least in the C8S job: [ 1767.520856] H testsuite-15.sh[35]: *** test transient slice drop-ins [ 1767.520856] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/slice.d [ 1767.522480] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-.slice.d [ 1767.524992] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-.slice.d [ 1767.526799] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-c.slice.d [ 1767.528302] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop1' [ 1767.528434] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop2' [ 1767.528519] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop3' [ 1767.528595] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop4' [ 1767.528676] H testsuite-15.sh[35]: + systemctl cat a-b-c.slice [ 1767.541321] H systemctl[1042]: No files found for a-b-c.slice. [ 1767.542854] H systemd[1]: testsuite-15.service: Main process exited, code=exited, status=1/FAILURE [ 1767.542995] H systemd[1]: testsuite-15.service: Failed with result 'exit-code'. [ 1767.543360] H systemd[1]: Failed to start testsuite-15.service. [ 1767.543542] H systemd[1]: testsuite-15.service: Consumed 1.586s CPU time. [ 1767.543938] H systemd[1]: Reached target testsuite.target. [ 1767.545737] H systemd[1]: Starting end.service...
* Merge pull request #25050 from keszybz/transient-drop-ins-2Luca Boccassi2022-10-181-0/+48
|\ | | | | TEST-15: add one more variant of the test for drop-ins on transient services
| * TEST-15: add test that shows slice dropin issueZbigniew Jędrzejewski-Szmek2022-10-181-0/+48
| | | | | | | | | | This should be fixed by single-unit reloads. We already have a TODO entry for this.
* | Merge pull request #25004 from keszybz/transient-drop-insLuca Boccassi2022-10-181-33/+152
|\| | | | | Allow drop-ins for transient units
| * TEST-15: add one more test for drop-in precedenceZbigniew Jędrzejewski-Szmek2022-10-161-0/+36
| |
| * TEST-15: add test for transient units with drop-insZbigniew Jędrzejewski-Szmek2022-10-161-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | We want to test four things: - that the transient units are successfully started when drop-ins exist - that the transient setings override the defaults - the drop-ins override the transient settings (the same as for a normal unit) - that things are the same before and after a reload To make things more fun, we start and stop units in two different ways: via systemctl and via a direct busctl invocation. This gives us a bit more coverage of different code paths.
| * TEST-15: also test hierarchical drop-ins for slicesZbigniew Jędrzejewski-Szmek2022-10-161-3/+34
| | | | | | | | | | | | | | Slices are worth testing too, because they don't need a fragment path so they behave slightly differently than service units. I'm making this a separate patch from the actual tests that I wanted to add later because it's complex enough on its own.
| * TEST-15: allow helper functions to accept other unit typesZbigniew Jędrzejewski-Szmek2022-10-161-24/+26
| | | | | | | | | | | | | | | | | | | | | | clear_services() is renamed to clear_units() and now takes a full unit name including the suffix as an argument. _clear_service() is renamed to clear_unit() and changed likewise. create_service() didn't have the same underscore prefix, and I don't think it's useful or needed for a local function, so it is removed. No functional change.
* | test: call sync() before checking the test logsFrantisek Sumsal2022-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we might hit a race where we read the test log just before it's fully written to the disk: ``` ====================================================================== FAIL: test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/systemd/test/test-exec-deserialization.py", line 170, in test_interleaved self.check_output(expected_output) File "/root/systemd/test/test-exec-deserialization.py", line 111, in check_output self.assertEqual(output, expected_output) AssertionError: 'foo\n' != 'foo\nbar\n' foo + bar ``` With some debug: ``` test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ... Assertion failed; file contents just after the assertion: b'foo\n' File contents 5 seconds later: b'foo\nbar\n' FAIL ``` Seen quite often in CentOS CI on the fast baremetal machines.
* | Merge pull request #25039 from mrc0mmand/test-tewaksLuca Boccassi2022-10-173-13/+18
|\ \ | | | | | | A couple of minor tweaks for recent CI fails
| * | test: use SIGKILL to kill the container if necessaryFrantisek Sumsal2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | TEST-69 uses a Python wrapper around the systemd-nspawn call, which on error calls the `spawn.terminate()` method. However, with no arguments it will only use SIGHUP and SIGINT signals - this might leave a stuck container around, causing fails if the test is run again. With `force=True` SIGKILL is used as well (if necessary).
| * | test: drop one layer of escapingFrantisek Sumsal2022-10-171-12/+12
| | |
| * | test: ignore gcov errors in TEST-34Frantisek Sumsal2022-10-171-0/+5
| | | | | | | | | | | | | | | | | | | | | TEST-34 complains in `test_check_writable` when running with gcov, as the build directory tree is not writable with DynamicUser=true. As I had no luck with $GCOV_PREFIX and other runtime gcov configuration, let's just ignore the gcov errors for this test.
* | | Merge pull request #24992 from yuwata/sd-device-monitor-receive-bufferZbigniew Jędrzejewski-Szmek2022-10-171-0/+70
|\ \ \ | | | | | | | | sd-device-monitor: dynamically allocate receive buffer
| * | | test: add test for large uevent messageYu Watanabe2022-10-171-0/+70
| | | |
* | | | Merge pull request #25036 from keszybz/pluralsLuca Boccassi2022-10-173-5/+5
|\ \ \ \ | |/ / / |/| | | Remove usage of "noun(s)" in messages and docs
| * | | tree-wide: replace "plural(s)" by "plurals"Zbigniew Jędrzejewski-Szmek2022-10-173-5/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | (s) is just ugly with a vibe of DOS. In most cases just using the normal plural form is more natural and gramatically correct. There are some log_debug() statements left, and texts in foreign licenses or headers. Those are not touched on purpose.
* / / tests: add nspawn's rootidmap integration testQuentin Deslandes2022-10-173-2/+42
|/ / | | | | | | | | Add integration test to testsuite-13.sh to ensure rootidmap option map user IDs as expected.
* / shared/install: rename UnitFileChange to InstallChangeZbigniew Jędrzejewski-Szmek2022-10-131-15/+14
|/ | | | | It's shorter and more generic. The struct can contain info about changes to unit files, but also symlinks and errors.
* test: introduce __eq__() and __ne__()Yu Watanabe2022-10-131-0/+6
| | | | Suggested by CodeQL#160 (https://github.com/systemd/systemd/security/code-scanning/160).
* test: drop unused modulesYu Watanabe2022-10-131-2/+0
| | | | | Suggested by CodeQL#167 (https://github.com/systemd/systemd/security/code-scanning/167) and CodeQL#168 (https://github.com/systemd/systemd/security/code-scanning/168).
* test: improve assertion message on failureYu Watanabe2022-10-131-1/+1
| | | | Suggested by CodeQL#169 (https://github.com/systemd/systemd/security/code-scanning/169).
* test: disable LSan in the ASan env wrapperFrantisek Sumsal2022-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wrapper is used in situations where we don't care about *San reports, we just want to make things work. However, with enabled LSan we might trigger some bogus reports we're definitely not interested in, causing unexpected test fails. Spotted on C8S in TEST-34-DYNAMICUSERMIGRATE: ``` [10654.804162] testsuite-34.sh[56]: + systemctl start testservice-34-check-writable.service Starting testservice-34-check-writable.service... [10655.055969] bash[546]: + set -o pipefail [10655.056127] bash[546]: + declare -a writable_dirs [10655.056234] bash[546]: + readarray -t writable_dirs [10655.060838] bash[548]: ++ find / '(' -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o -path /sys/fs/bpf -o -path /dev/.lxc -o -path /sys/devices/system/cpu ')' -prune -o -type d -writable -print [10655.061534] bash[549]: ++ sort -u [10655.688740] bash[547]: ================================================================= [10655.689075] bash[547]: ==547==ERROR: LeakSanitizer: detected memory leaks [10655.689246] bash[547]: Direct leak of 112 byte(s) in 1 object(s) allocated from: [10655.743851] bash[547]: #0 0x7ffff752d364 (/usr/lib64/clang/14.0.0/lib/libclang_rt.asan-powerpc64le.so+0x13d364) (BuildId: 321f4ed1caea6a1a4c37f9272e07275cf16f034d) [10655.744060] bash[547]: #1 0x1000b5d20 in xmalloc (/usr/bin/bash+0xb5d20) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.744224] bash[547]: #2 0x100083338 (/usr/bin/bash+0x83338) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.744393] bash[547]: #3 0x10008847c (/usr/bin/bash+0x8847c) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.744552] bash[547]: #4 0x1000af6ec in redirection_expand (/usr/bin/bash+0xaf6ec) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.744728] bash[547]: #5 0x1000b005c (/usr/bin/bash+0xb005c) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.744886] bash[547]: #6 0x1000b1388 in do_redirections (/usr/bin/bash+0xb1388) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745051] bash[547]: #7 0x100050484 (/usr/bin/bash+0x50484) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745208] bash[547]: #8 0x100052160 in execute_command_internal (/usr/bin/bash+0x52160) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745376] bash[547]: #9 0x100052a10 in execute_command_internal (/usr/bin/bash+0x52a10) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745536] bash[547]: #10 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745711] bash[547]: #11 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.745870] bash[547]: #12 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746038] bash[547]: #13 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746198] bash[547]: #14 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746367] bash[547]: #15 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746548] bash[547]: #16 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746741] bash[547]: #17 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.746897] bash[547]: #18 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747067] bash[547]: #19 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747227] bash[547]: #20 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747414] bash[547]: #21 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747573] bash[547]: #22 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747741] bash[547]: #23 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.747896] bash[547]: #24 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748064] bash[547]: #25 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748225] bash[547]: #26 0x100053e38 in execute_command (/usr/bin/bash+0x53e38) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748390] bash[547]: #27 0x1000529d8 in execute_command_internal (/usr/bin/bash+0x529d8) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748553] bash[547]: #28 0x1000bf91c in parse_and_execute (/usr/bin/bash+0xbf91c) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748717] bash[547]: #29 0x1000311ec (/usr/bin/bash+0x311ec) (BuildId: da38eb38f6870bdc2a6ef51c52aa6ce20921fe40) [10655.748883] bash[547]: Direct leak of 17 byte(s) in 1 object(s) allocated from: ... ```
* portable: allow caller to override extension-release name checkLuca Boccassi2022-10-121-0/+12
| | | | | When the --force flag is used, do not insist that the extension-release file has to match the extension image name
* Merge pull request #24784 from yuwata/core-exec-directoryZbigniew Jędrzejewski-Szmek2022-10-122-25/+149
|\ | | | | core: do not create symlink to private directory if parent already exists
| * test: add more tests for StateDirectory= with DynamicUser=Yu Watanabe2022-10-032-25/+149
| | | | | | | | | | | | This also moves the check for writable paths from test-execute to TEST-34. Closes #10337.
* | test: add coverage for the nvme-subsystemFrantisek Sumsal2022-10-112-0/+42
| | | | | | | | | | | | | | Specifically for: - https://github.com/systemd/systemd/pull/24748 - https://github.com/systemd/systemd/pull/24766 - https://github.com/systemd/systemd/pull/24946
* | fuzz: shorten name of fuzz test caseZbigniew Jędrzejewski-Szmek2022-10-071-0/+0
| | | | | | | | Wide fuzzer case names make meson test output very wide…
* | test: configure ldconfig's cache in the minimal verity imagesFrantisek Sumsal2022-10-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glibc stuff on ppc64le C8S is a little bit wild, as there are two versions: ``` $ ldconfig -p | grep libc.so libc.so.6 (libc6,64bit, hwcap: "power9", OS ABI: Linux 3.10.0) => /lib64/glibc-hwcaps/power9/libc-2.28.so libc.so.6 (libc6,64bit, OS ABI: Linux 3.10.0) => /lib64/libc.so.6 ``` and with `/etc/ld.so.cache` present all binaries use the first one: ``` $ ldd /bin/cat linux-vdso64.so.1 (0x00007fffa8070000) libc.so.6 => /lib64/glibc-hwcaps/power9/libc-2.28.so (0x00007fffa7e20000) /lib64/ld64.so.2 (0x00007fffa8090000) ``` However, without the cache the binaries will fall back to `/lib64/libc.so.6` which breaks tests that use the minimal verity images (like TEST-29), because we install only the first version (that's shown by `ldd` at the time the images are created): ``` [ 91.595343] testsuite-29.sh[747]: + portablectl --profile=trusted attach --now --runtime /usr/share/minimal_0.raw minimal-app0 Starting systemd-portabled.service... [ OK ] Started systemd-portabled.service. Starting minimal-app0-foo.service... Starting minimal-app0.service... [ 104.432217] cat[858]: cat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory [ 104.435080] cat[857]: cat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory [FAILED] Failed to start minimal-app0.service. See 'systemctl status minimal-app0.service' for details. ``` ``` $ chroot /var/tmp/systemd-test.nMHPfc/minimal/ /bin/bash: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory ``` With the ldconfig's cache it seems to work as expected: ``` $ chroot /var/tmp/systemd-test.gVtYLg/minimal bash-4.4# cat --version cat (GNU coreutils) 8.30 ... ```
* | test-70: check if LUKS2 plugins are actually installed, not just supportedLuca Boccassi2022-10-031-1/+2
|/ | | | We don't build them in Debian/Ubuntu yet, even though cryptsetup supports them
* test: pre-load ASan's DSO for iscsi-init.serviceFrantisek Sumsal2022-10-021-0/+8
| | | | | | | The iscsi-init.service calls `sh` which might, in certain circumstances, pull in instrumented systemd NSS modules causing `sh` to fail. Let's mitigate this by pulling in an env file crafted by `create_asan_wrapper()` that (among others) pre-loads ASan's DSO.
* test: introduce a simple environment file for test serviceFrantisek Sumsal2022-10-021-1/+9
|
* test: expand the expression in `cleanup_initdir()`Frantisek Sumsal2022-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we might unexpectedly return 1 if the `get_bool` call fails. If the `get_bool` part in `get_bool "$TEST_SETUP_CLEANUP_ROOTDIR" && _umount_dir "${initdir:?}"` fails, the whole expression will short-circuit evaluate to 1, and since it's the last expression in the function it's also it's return value, which doesn't reflect the original intent of the expression: ``` # BUILD_DIR=$PWD/build make -C test/TEST-64-UDEV-STORAGE/ setup run TESTCASES=testcase_always_skip make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE' TEST-64-UDEV-STORAGE SETUP: systemd-udev storage tests Reusing existing image /var/tmp/systemd-test.uPbJZ9/default.img → /var/tmp/systemd-test.uPbJZ9/default.img TEST-64-UDEV-STORAGE RUN: systemd-udev storage tests ------ testcase_always_skip: BEGIN ------ Skipping... ------ testcase_always_skip: END (SKIP) ------ Passed tests: 0 * Skipped tests: 1 * testcase_always_skip Failed tests: 0 * TEST-64-UDEV-STORAGE RUN: systemd-udev storage tests [OK] make: Leaving directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE' # BUILD_DIR=$PWD/build make -C test/TEST-64-UDEV-STORAGE/ setup run TESTCASES=testcase_always_skip make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE' TEST-64-UDEV-STORAGE SETUP: systemd-udev storage tests Reusing existing image /var/tmp/systemd-test.uPbJZ9/default.img → /var/tmp/systemd-test.uPbJZ9/default.img make: *** [Makefile:4: setup] Error 1 make: Leaving directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE' ```
* test: drop the explicit bus assignment for the pci-bridgeFrantisek Sumsal2022-10-021-1/+1
| | | | | as it doesn't work with the Q35 chipset due to a different topology. Auto-assignment seems to work with both Q35 and i440FX chipsets.
* Merge pull request #24853 from poettering/resolved-monitor-fixesLuca Boccassi2022-09-301-81/+22
|\ | | | | resolved: various monitor fixes
| * test: rework resolved monitoring testLennart Poettering2022-09-301-81/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Let's remove some sleep loops, and instead: 1. Use Type=notify to wait until "resolvectl monitor" successfully installed its monitor, so that we know that queries enqueued later will definitely be seen. 2. Use "grep -m1" to watch "journalctl -f" output to wait precisely for the RR data we want to see, and immediately exit. This shortens code quite a bit, and should make it more robust.
* | portablectl: add --force attach/detachLuca Boccassi2022-09-301-1/+10
|/ | | | | | | | | | Allows to skip check that ensures units must not be running. I have a use case that would use reattach, except the orchestrator is using a non-standard versioning scheme, so image matching cannot work. As a workaround, need to be able to detach and then attach manually, without stopping the units to avoid extended downtimes and loss of FD store.
* test: wait until the unit finishes before checking the logFrantisek Sumsal2022-09-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we might read an incomplete log and fail: ``` test_added_after (__main__.ExecutionResumeTest) ... FAIL test_added_before (__main__.ExecutionResumeTest) ... ok test_interleaved (__main__.ExecutionResumeTest) ... ok test_issue_6533 (__main__.ExecutionResumeTest) ... ok test_no_change (__main__.ExecutionResumeTest) ... ok test_removal (__main__.ExecutionResumeTest) ... ok test_swapped (__main__.ExecutionResumeTest) ... ok ====================================================================== FAIL: test_added_after (__main__.ExecutionResumeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/build/./test/test-exec-deserialization.py", line 152, in test_added_after self.check_output(expected_output) File "/build/./test/test-exec-deserialization.py", line 107, in check_output self.assertEqual(output, expected_output) AssertionError: 'foo\n' != 'foo\nbar\n' foo + bar ---------------------------------------------------------------------- Ran 7 tests in 27.470s ```
* test: kill the machine on oops/panic/soft_lockupFrantisek Sumsal2022-09-301-1/+6
| | | | | Otherwise the machine will hang on the panic until the timeout happens, which might waste quite a considerable amount of time in certain cases.
* Merge pull request #24865 from yuwata/udevadm-tweaksFrantisek Sumsal2022-09-301-4/+6
|\ | | | | udevadm: fix misleading error message
| * test-64-udev-storage: use wait command instead of hackish "udevadm lock true"Yu Watanabe2022-09-291-4/+6
| | | | | | | | | | Otherwise, "udevadm lock true" may lock a block device earlier than "udevadm lock sfdisk &".
* | test: bump the `reattach` timeout when running w/ plain QEMUFrantisek Sumsal2022-09-291-9/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it might sometimes take slightly longer without the acceleration: ``` [ 176.805681] testsuite-29.sh[534]: + cp /usr/share/app1.raw /tmp/app1_2.raw [ 176.885365] testsuite-29.sh[534]: + timeout 30 portablectl reattach --now --runtime --extension /tmp/app1_2.raw /usr/share/minimal_1.raw app1 [ 177.053358] portablectl[993]: (Matching unit files with prefixes 'app1'.) [ 177.138770] kernel: loop0: detected capacity change from 0 to 2965504 [ 177.343137] kernel: loop1: detected capacity change from 0 to 4096 ... [ 201.932062] systemd[1]: app1.service: Deactivated successfully. [ 202.009310] systemd[1]: Stopped app1.service. [ 202.053776] systemd[1]: app1.service: Consumed 2.183s CPU time. [ 202.125061] systemd[1]: Stopping app1.service... [ 202.611760] systemd[1]: Starting modprobe@dm_mod.service... [ 202.851031] systemd[1]: Starting modprobe@dm_verity.service... [ 202.909352] systemd[1]: Starting modprobe@loop.service... [ 203.198918] systemd[1]: Starting app1.service... [ 207.145494] kernel: audit: type=1130 audit(1663770336.105:428): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=testsuite-29 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed' [ 207.652545] systemd[1]: testsuite-29.service: Main process exited, code=exited, status=124/n/a [ 207.665088] systemd[1]: testsuite-29.service: Failed with result 'exit-code'. [ 207.830522] systemd[1]: Failed to start testsuite-29.service. ... [ 208.889449] script1.sh[1035]: ID="centos" [ 208.889449] script1.sh[1035]: VERSION_ID="8" [ 208.889449] script1.sh[1035]: SYSEXT_SCOPE=portable [ 208.889449] script1.sh[1035]: PORTABLE_PREFIXES=app1 ... [ 214.155097] systemd[1]: app1.service: Deactivated successfully. ``` Spotted in Ubuntu CI and CentOS CI. Follow-up to 706c9a30ac.
* test: wrap `ls` and `stat` to make it work w/ sanitizers in specific casesFrantisek Sumsal2022-09-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `/etc/nsswitch.conf` uses `systemd` together with `[SUCCESS=merge]`, `ls -l` will pull in `libnss_systemd` causing `SIGABRT`, as `ls` is not instrumented (by default): ``` -bash-5.1# strace -f -e %file ls -l /dev execve("/usr/bin/ls", ["ls", "-l", "/dev"], 0x7ffc3bb211c8 /* 24 vars*/) = 0 ... openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=1896, ...}, AT_EMPTY_PATH) = 0 newfstatat(AT_FDCWD, "/etc/nsswitch.conf", {st_mode=S_IFREG|0644, st_size=359, ...}, 0) = 0 openat(AT_FDCWD, "/etc/group", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=965, ...}, AT_EMPTY_PATH) = 0 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=10779, ...}, AT_EMPTY_PATH) = 0 openat(AT_FDCWD, "/usr/lib/libnss_systemd.so.2", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=16195176, ...}, AT_EMPTY_PATH) = 0 openat(AT_FDCWD, "/usr/lib/libasan.so.8", O_RDONLY|O_CLOEXEC) = 3 ... readlink("/proc/self/exe", "/usr/bin/ls", 4096) = 11 open("/proc/self/cmdline", O_RDONLY) = 3 open("/proc/self/environ", O_RDONLY) = 3 ==620==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=620, si_uid=0} --- +++ killed by SIGABRT (core dumped) +++ Aborted (core dumped) ``` This also happens with `stat`. Let's add both `ls` and `stat` to the "wrap list" to work around this. Spotted on Arch Linux.
* test: fix a copy-paste errorFrantisek Sumsal2022-09-281-1/+1
|
* resolved notifications: follow-up fixesLuca Boccassi2022-09-271-2/+2
| | | | Further review comments from: https://github.com/systemd/systemd/pull/22845
* Merge pull request #24832 from mrc0mmand/more-TEST-64-tweaksYu Watanabe2022-09-271-12/+28
|\ | | | | A couple of performance tweaks for TEST-64 under QEMU
| * test: use fewer partitions/LVs when running with plain QEMUFrantisek Sumsal2022-09-271-6/+11
| |
| * test: make the symlink helpers a bit more quietFrantisek Sumsal2022-09-271-3/+0
| | | | | | | | and show only errors/warnings.
| * test: ignore tty* devices when checking device unitsFrantisek Sumsal2022-09-271-1/+1
| | | | | | | | | | This lower the runtime of `check_device_units()` in a plain QEMU VM from ~45 seconds to ~25 seconds.
| * test: lower the # of iterations when running with plain QEMUFrantisek Sumsal2022-09-271-3/+17
| |