Commit graph

2871 commits

Author SHA1 Message Date
nl6720 0e68582323 tree-wide: link to docs.kernel.org for kernel documentation
https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520

These URLs are shorter and nicer looking.
2022-07-04 19:56:53 +02:00
Yu Watanabe 7c38952e68
Merge pull request #23104 from mrc0mmand/resolved-tests
Introduce systemd-resolved test suite
2022-07-04 23:46:16 +09:00
Frantisek Sumsal fb6f25d7b9 test: Introduce systemd-resolved test suite
Resolves: #19599
2022-07-04 12:21:55 +02:00
Frantisek Sumsal 17082e8ac1 test: resize the terminal automagically with INTERACTIVE_DEBUG=yes 2022-07-04 09:41:06 +02:00
Frantisek Sumsal 8afe2f53b2 test: install /usr/libexec/vi as well
since `/bin/vi` (at least on Fedora) is a shell wrapper which runs
either `/bin/vim` or `/usr/libexec/vi` based on availability.
2022-07-04 09:41:06 +02:00
Nick Rosbrook ddbc88188c test: copy libgcc_s.so.1 to TPM2 test image on Debian-like systems
On Ubuntu, cryptsetup does not link against libgcc_s.so.1 which leads to
the following test failure in TEST-70-TPM2:

 systemd[1]: Starting testsuite-70.service...
 systemd[329]: testsuite-70.service: Executing: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh
 testsuite-70.sh[329]: + export SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + img=/var/tmp/test.img
 testsuite-70.sh[329]: + dd if=/dev/zero of=/var/tmp/test.img bs=1024k count=20 status=none
 testsuite-70.sh[329]: + echo -n passphrase
 testsuite-70.sh[329]: + cryptsetup luksFormat -q --use-urandom /var/tmp/test.img /tmp/passphrase
 testsuite-70.sh[333]: libgcc_s.so.1 must be installed for pthread_exit to work
 testsuite-70.sh[329]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh:
     line 12: 333 Aborted (core dumped) cryptsetup luksFormat -q --use-urandom $img /tmp/passphrase

To fix this, manually install libgcc_s.so.1 to the test image if running
on Debian-like systems.
2022-07-02 15:01:30 +01:00
Frantisek Sumsal d1b1bbfbfa test: add a simple test for daemon-reexec 2022-07-02 05:23:03 +09:00
Michael Biebl 41d6f3bf4d Use https for freedesktop.org
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
2022-06-28 13:10:05 +02:00
Frantisek Sumsal 53008d0714 test: drop unnecessary || :
since we use `set +e` in the cleanup handler.
2022-06-26 22:06:02 +02:00
Frantisek Sumsal eda0e525d3 test: run TEST-21 in nspawn only if $TEST_PREFER_NSPAWN is set
so we can run it under nspawn in CIs which don't support nested KVM, but
avoid running it twice (both under nspawn and qemu) in CIs which support
both methods.
2022-06-26 22:06:02 +02:00
Frantisek Sumsal 71cde065b5 test: make TEST-21-DFUZZER work in containers
by avoiding fuzzing networkd and timesyncd when running in a container.
2022-06-26 22:06:02 +02:00
Yu Watanabe a32badc5a6 Revert "networkd: NetLabel integration"
This reverts PR #23269 and its follow-up commit. Especially,
2299b1cae3 (partially), and
3cf63830ac.

The PR was merged without final approval, and has several issues:
- The NetLabel for static addresses are not assigned, as labels are
  stored in the Address objects managed by Network, instead of Link.
- If NetLabel is specified for a static address, then the address
  section will be invalid and the address will not be configured,
- It should be implemented with Request object,
- There is no test about the feature.
2022-06-22 22:34:26 +09:00
Yu Watanabe b48ed70c79 Revert NFTSet feature
This reverts PR #22587 and its follow-up commit. More specifically,
2299b1cae3 (partially),
e176f85527,
ceb46a31a0, and
51bb9076ab.

The PR was merged without final approval, and has several issues:
- OSS fuzz reported issues in the conf parser,
- It calls synchrnous netlink call, it should not be especially in PID1,
- The importance of NFTSet for CGroup and DynamicUser may be
  questionable, at least, there was no justification PID1 should support
  it.
- For networkd, it should be implemented with Request object,
- There is no test for the feature.

Fixes #23711.
Fixes #23717.
Fixes #23719.
Fixes #23720.
Fixes #23721.
Fixes #23759.
2022-06-22 22:23:58 +09:00
Frantisek Sumsal dc350e78fe test: allow overriding $QEMU_MEM when running w/ ASan 2022-06-21 14:03:57 +02:00
Frantisek Sumsal 56e8ee55d5 test: make the shutdown routine a bit more "robust"
Replace the call to the `end.service` with `systemctl poweroff`, since
it seems to cause issues no matter what `--job-mode=` is used:

```
[  129.070993] testsuite-21.sh[380]: ++ systemctl start --job-mode=flush end.service
[  129.154985] testsuite-21.sh[912]: Failed to start end.service: Transaction for end.service/start is destructive (sysinit.target has 'stop' job queued, but 'start' is included in transaction).
[  129.159636] testsuite-21.sh[912]: See system logs and 'systemctl status end.service' for details.
```

Also, add a "safety net" which bypasses the manager and does the
poweroff directly, since sometimes the D-Bus call performed by
`systemctl` might timeout (as the manager might be still processing data
from the fuzzing):

```
[  115.776778] sh[894]: + systemctl poweroff --no-block
[  166.164242] testsuite-21.sh[893]: Failed to start transient service unit: Connection timed out
[  166.269289] sh[894]: Call to PowerOff failed: Connection timed out
```
2022-06-21 12:11:43 +02:00
Frantisek Sumsal 5309b56505 test: drop the at_exit() coredump check
since we don't truncate the journal anymore.
2022-06-21 10:13:48 +02:00
Frantisek Sumsal d3eb4159c9 test: make dfuzzer less verbose
Otherwise it oversaturates the journal, which in some cases can't keep
up with the load of messages (due to the performance penalty caused by
sanitizers), and gets killed by a watchdog.
2022-06-21 10:04:03 +02:00
Frantisek Sumsal 5dffa6b032 test: always force a new image for dfuzzer
Otherwise we might end up with an image containing broken service
symlinks and other things, which break certain parts of the test.
2022-06-21 10:01:30 +02:00
Frantisek Sumsal 0897048500 test: use saved process PID instead of %%
As the `%%` specifier might fail if the current job (i.e. the last
background job) already finished:

```
[   61.692196] testsuite-04.sh[656]: ++ systemd-id128 new
[   61.705407] testsuite-04.sh[263]: + ID=912cb8f8ef304153a123f772bb0fe9e0
[   61.706318] testsuite-04.sh[657]: + systemd-cat -t 912cb8f8ef304153a123f772bb0fe9e0 bash -c 'echo parent; (echo child) & wait'
[   61.720940] testsuite-04.sh[263]: + PID=657
[   61.721126] testsuite-04.sh[263]: + wait %%
[   61.723014] testsuite-04.sh[263]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 96: wait: %%: no such job
```
2022-06-20 17:56:09 +00:00
Frantisek Sumsal d768243a95 test: skip TEST-21-DFUZZER without ASan
as the test is quite time consuming and it yields more useful reports
when the target app is built with sanitizers.
2022-06-19 16:22:35 +02:00
Frantisek Sumsal 354b3364aa test: fuzz our dbus interfaces with dfuzzer 2022-06-19 16:22:35 +02:00
Frantisek Sumsal 508a7f04b3 test: make masking of supplementary services configurable 2022-06-19 11:27:41 +02:00
Yu Watanabe 297cc64bfb
Merge pull request #23771 from mrc0mmand/test-tweaks
A couple of test-output-related tweaks
2022-06-18 10:45:22 +09:00
Frantisek Sumsal 8cda7b91ff test: check journal directly instead of capturing console output 2022-06-17 17:32:41 +02:00
Frantisek Sumsal 35d2d2e61c test: run the custom check hooks before common checks
since we delete the guest journals as part of the save_journal() step in
check_result_common(), making journal inaccessible from the custom check
hooks.
2022-06-17 17:28:13 +02:00
Frantisek Sumsal 4b9a0c3aeb test: pass the initdir to check_result_{qemu,nspawn} hooks 2022-06-17 17:14:45 +02:00
Frantisek Sumsal 72f0e89c0d test: fix a couple of issues found by shellcheck 2022-06-17 15:28:17 +02:00
Frantisek Sumsal c84d1c9822 test: don't flush debug logs to the console
Let's keep the debug logs in the journal, while logging only
testsute-*.sh stdout/stderr to the console (ba7abf7). This should make
the test output log a bit more readable and potentially the tests itself
a bit faster by avoiding console oversaturation.

Also, it should significantly reduce the size of artifacts kept by CIs.
2022-06-17 15:06:59 +02:00
Frantisek Sumsal 94850fb956 test: always wrap useradd/userdel when running w/ ASan
since they dlopen() PAM modules, including systemd ones.
2022-06-17 14:51:52 +02:00
Frantisek Sumsal 582547cbd3 test: make the busy loop in TEST-02 less verbose
as it unnecessarily clogs the logs.
2022-06-17 14:51:52 +02:00
Luca Boccassi 9dd98db27d
Merge pull request #23756 from yuwata/analyze-seccomp-filter
analyze: fix seccomp filter handling in security command
2022-06-17 09:58:14 +01:00
Frantisek Sumsal ba7abf79a5 test: send stdout/stderr of testsuite units to journal & console
to make debugging in CIs slightly easier.
2022-06-17 12:54:50 +09:00
Yu Watanabe cf906beaef test: add syscall filter tests for analyze security 2022-06-17 12:45:45 +09:00
Yu Watanabe 75176c7914
Merge pull request #23741 from mrc0mmand/more-asan-tweaks
test: wrap certain uninstrumented binaries to make them work w/ ASan
2022-06-16 12:10:56 +09:00
Frantisek Sumsal b727d7e02d test: don't wrap binaries built with ASan
since they should handle loading other instrumented libraries without
issues.
2022-06-16 00:02:35 +02:00
Frantisek Sumsal fa65ba6baa test: drop all LD_PRELOAD-related ASan workarounds
since they shouldn't be necessary anymore, as we tweak the "problematic"
binaries on per-binary basis.
2022-06-16 00:02:35 +02:00
Frantisek Sumsal 3917534d62 test: wrap binaries using systemd DSOs when running w/ ASan
Let's detect & wrap binaries which are linked against systemd DSOs and
we're running under ASan, since otherwise running such binaries ends
with:

```
==633==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.
```
2022-06-16 00:02:35 +02:00
Yu Watanabe 172cbcdc8b tree-wide: fix typo 2022-06-15 14:50:34 +09:00
Frantisek Sumsal aca811544e Revert "test: fix TEST-70 under sanitizers"
This reverts commit 47d81bc613.
2022-06-14 22:57:07 +02:00
Yu Watanabe 6243063824 test: use trap RETURN 2022-06-14 21:08:04 +09:00
Yu Watanabe 4627fb80bf test: move "do" at the end of line 2022-06-14 21:06:06 +09:00
Yu Watanabe 2f34ee3329 test: insert space in for loop 2022-06-14 21:05:10 +09:00
Yu Watanabe 47ba157cc0 test: import localed tests from debian/ubuntu test suite 2022-06-14 20:59:36 +09:00
Yu Watanabe 4ce68ea9b3 test: install C.UTF-8 and English locales 2022-06-14 20:59:36 +09:00
Yu Watanabe 1136175c7f test: install libxkbcommon and x11 keymaps 2022-06-14 20:59:36 +09:00
Yu Watanabe da0465dc95 test: introduce inst_recursive() helper function 2022-06-14 20:59:32 +09:00
Yu Watanabe 569c6fd1b7 test: add one more path to search keymaps
Now it also supports split-usr.
2022-06-14 20:56:23 +09:00
Yu Watanabe 39f4546199 test: import hostnamed tests from debian/ubuntu test suite 2022-06-14 20:56:18 +09:00
Yu Watanabe aab61a8c99 test: support debian/ubuntu specific timezone config file 2022-06-14 20:52:44 +09:00
Yu Watanabe 8ed2103306 test: drop unnecessary --no-pager option 2022-06-14 20:52:44 +09:00