summaryrefslogtreecommitdiff
path: root/test/test-functions
Commit message (Collapse)AuthorAgeFilesLines
* sysext: introduce ARCHITECTURE field to match host architectureKai Lueke2022-08-151-1/+2
| | | | | | | | | | | When an extension image has binaries they should match the host architecture. Currently there is no way to specify this requirement. Introduce an ARCHITECTURE field in the extension's release file that may be set to prevent loading on the wrong host architecture. Since this new field is introduced late, we don't want to make specifying it mandatory as it would break existing sysext images. See https://github.com/systemd/systemd/issues/24061
* sysext: support distribution-independent extensions using ID=_anyKai Lueke2022-08-151-0/+6
| | | | | | | | | A sysext image that merely contains static binaries has no dependency on the host distribution and should be able to be used anywhere. Support the special '_any' value for the ID field in the extension to opt-out of ID and VERSION_ID/SYSEXT_LEVEL matching. See https://github.com/systemd/systemd/issues/24061
* test: be a bit more verbose about shared library symlinksFrantisek Sumsal2022-08-021-0/+1
| | | | | | | | | | | For example: ``` D: Installing /usr/lib64/libz.so.1.2.11 D: Creating symlink /usr/lib64/libz.so.1.2.11 -> /usr/lib64/libz.so.1 D: Creating extra symlink: /lib64/libz.so D: Installing /usr/lib64/libgcc_s-12-20220507.so.1 D: Creating symlink /usr/lib64/libgcc_s-12-20220507.so.1 -> /usr/lib64/libgcc_s.so.1 ```
* test: install libgcc_s.so.1 explicitly if availableFrantisek Sumsal2022-08-021-6/+8
| | | | | | | Since the library is dlopen()ed by libpthread and required during pthread_exit()/pthread_cancel(), let's install it explicitly if available to avoid unexpected fails in tests. This also consolidates all related workarounds for this library across the test scripts.
* Merge pull request #23937 from mrc0mmand/test-tweaksYu Watanabe2022-07-081-11/+16
|\ | | | | Several ASan-related test suite tweaks
| * test: bump the data partition size if we don't strip binariesFrantisek Sumsal2022-07-071-9/+14
| | | | | | | | | | | | | | so we can run TEST-24 under sanitizers as well. Also, when at it, use the 'named-fields' sfdisk format to make the code a bit more descriptive without needing a manual.
| * test: create an ASan wrapper for `getent` and `su`Frantisek Sumsal2022-07-071-2/+2
| | | | | | | | | | since they "suffer" from the same issue as `login` and other binaries that load PAM stuff
* | test: allow multiple handlers for the EXIT signalFrantisek Sumsal2022-07-071-1/+28
|/ | | | | | Bash allows only one handler per signal, so let's overcome this limitation by having one dedicated EXIT signal which runs all registered handlers from all over the place.
* test: several cleanups for TEST-35-LOGINYu Watanabe2022-07-071-10/+0
| | | | | | | | | - use test_append_files() to install additional commands - drop use of expect - include assert.sh and use assertions at several places - use timeout command at several places - always use logind-test-user - etc
* tests: add test for handling of background sessionsMichal Sekletar2022-07-071-0/+1
|
* Merge pull request #23396 from msekletar/fix-idle-action-lockYu Watanabe2022-07-071-0/+7
|\ | | | | logind: remember our idle state and use it to detect idle level transitions
| * tests: verify that Lock D-Bus signal is sent when IdleAction=lockMichal Sekletar2022-07-041-0/+7
| |
* | test: resize the terminal automagically with INTERACTIVE_DEBUG=yesFrantisek Sumsal2022-07-041-7/+5
| |
* | test: install /usr/libexec/vi as wellFrantisek Sumsal2022-07-041-0/+1
|/ | | | | since `/bin/vi` (at least on Fedora) is a shell wrapper which runs either `/bin/vim` or `/usr/libexec/vi` based on availability.
* Use https for freedesktop.orgMichael Biebl2022-06-281-1/+1
| | | | grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
* test: allow overriding $QEMU_MEM when running w/ ASanFrantisek Sumsal2022-06-211-3/+2
|
* test: fuzz our dbus interfaces with dfuzzerFrantisek Sumsal2022-06-191-0/+1
|
* test: make masking of supplementary services configurableFrantisek Sumsal2022-06-191-3/+3
|
* test: run the custom check hooks before common checksFrantisek Sumsal2022-06-171-8/+8
| | | | | | 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.
* test: pass the initdir to check_result_{qemu,nspawn} hooksFrantisek Sumsal2022-06-171-4/+4
|
* test: always wrap useradd/userdel when running w/ ASanFrantisek Sumsal2022-06-171-2/+2
| | | | since they dlopen() PAM modules, including systemd ones.
* test: send stdout/stderr of testsuite units to journal & consoleFrantisek Sumsal2022-06-171-0/+12
| | | | to make debugging in CIs slightly easier.
* Merge pull request #23741 from mrc0mmand/more-asan-tweaksYu Watanabe2022-06-161-56/+46
|\ | | | | test: wrap certain uninstrumented binaries to make them work w/ ASan
| * test: don't wrap binaries built with ASanFrantisek Sumsal2022-06-161-3/+7
| | | | | | | | | | since they should handle loading other instrumented libraries without issues.
| * test: drop all LD_PRELOAD-related ASan workaroundsFrantisek Sumsal2022-06-161-53/+1
| | | | | | | | | | since they shouldn't be necessary anymore, as we tweak the "problematic" binaries on per-binary basis.
| * test: wrap binaries using systemd DSOs when running w/ ASanFrantisek Sumsal2022-06-161-1/+39
| | | | | | | | | | | | | | | | | | | | 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. ```
* | test: move "do" at the end of lineYu Watanabe2022-06-141-6/+3
| |
* | test: install C.UTF-8 and English localesYu Watanabe2022-06-141-0/+24
| |
* | test: install libxkbcommon and x11 keymapsYu Watanabe2022-06-141-1/+18
| |
* | test: introduce inst_recursive() helper functionYu Watanabe2022-06-141-0/+14
| |
* | test: add one more path to search keymapsYu Watanabe2022-06-141-19/+40
|/ | | | Now it also supports split-usr.
* test: import logind test from debian/ubuntu test suiteYu Watanabe2022-06-101-0/+8
|
* test: set $ASAN_RT_PATH along with $LD_PRELOAD to the ASan runtime DSOFrantisek Sumsal2022-06-061-1/+1
| | | | | | Since we unset $LD_PRELOAD in the testsuite-* units (due to another issue), let's store the path to the ASan DSO in another env variable, so we can easily access it in the testsuite scripts when needed.
* test: enable virtio-rng device for QEMU guestsFranck Bui2022-06-031-0/+1
| | | | | | | | | | If rngd is included in the host initrd, QEMU guests need at least one source of entropy otherwise rngd will refuse to start. Hence this patch enables the virtio RNG device in QEMU guests (exposed as a HW RNG device available at /dev/hwrng). As a safety measure, the patch limits the data sent to the guest to 1KB per second in order to not let the guest starve the host entropy.
* test: generate a custom initrd for TEST-24 if $INITRD is unsetFrantisek Sumsal2022-05-261-0/+5
| | | | Co-Authored-By: Yu Watanabe <watanabe.yu+github@gmail.com>
* tests: ignore dbus-broker-launcherEvgeny Vereshchagin2022-05-121-0/+1
| | | | | | | | | | There are memory leaks there https://github.com/bus1/dbus-broker/issues/289 and it crashes from time to time https://github.com/matusmarhefka/dfuzzer/issues/20#issuecomment-1114097840 so let's just skip it by analogy with dbus-daemon to avoid reports that have nothing to do with systemd itself. It's kind of a part of https://github.com/systemd/systemd/pull/22547
* docs: use lowercase "qemu" and other minor tweaks to test docsZbigniew Jędrzejewski-Szmek2022-05-041-9/+9
| | | | | | | | | We used both "qemu" and "QEMU", let's use the lower-case version everywhere since it's also the name of the binary and the version that people are most familiar with. The stuff under test/ is not only for the integeration tests, but also for various other test-related stuff, so adjust the docs a bit.
* tests: make valgrind_wrapper track file descriptorsEvgeny Vereshchagin2022-05-031-1/+1
|
* tests: make it possible to install valgrindEvgeny Vereshchagin2022-05-031-7/+7
|
* test: use cp for journal copying when systemd-journal-remote non-existentwangyuhang2022-04-251-2/+6
|
* Merge pull request #23021 from fbuihuu/tmpfiles-fix-precedence-with-plus-signYu Watanabe2022-04-161-1/+1
|\ | | | | Tmpfiles fix precedence with plus sign
| * test: adapt install_pam() for openSUSEFranck Bui2022-04-111-1/+1
| | | | | | | | limits.conf is installed in /usr/etc/security for openSUSE.
* | test: add MD-related tests to TEST-64Frantisek Sumsal2022-04-141-0/+23
| |
* | test: ignore missing coverage in TEST-02Frantisek Sumsal2022-04-071-2/+2
|/ | | | | | | Since c6552ad we now try to collect coverage even in situations where it's basically impossible (like in test-mount-util where the whole / is mounted as read-only). As dealing with this is not worth the trouble, let's ignore the missing coverage errors thrown by gcov in such cases.
* test: use flock when calling mkfs.btrfsFrantisek Sumsal2022-03-251-0/+1
| | | | | | | | | As stated in https://github.com/systemd/systemd/issues/21819#issuecomment-1064377645 `mkfs.btrfs` doesn't hold the lock for the whole duration of `mkfs.btrfs`, thus causing unexpected races & test fails. Let's wrap the `mkfs.btrfs` calls in an flock wrapper to mitigate this. Hopefully fixes: #21819
* cryptenroll: add tests for TPM2 unlockingGrigori Goronzy2022-03-151-1/+1
| | | | | | | | | | | Add tests for enrolling and unlocking. Various cases are tested: - Default PCR 7 policy w/o PIN, good and bad cases (wrong PCR) - PCR 7 + PIN policy, good and bad cases (wrong PCR, wrong PIN) - Non-default PCR 0+7 policy w/o PIN, good and bad cases (wrong PCR 0) v2: rename test, fix tss2 library installation, fix CI failures v3: fix ppc64, load module
* TEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8Luca Boccassi2022-03-081-4/+4
|
* TEST-29: trim output a bitZbigniew Jędrzejewski-Szmek2022-03-071-4/+4
| | | | | | IIUC, pipefail doesn't matter for a sequence of commands joined with &&, and we don't have any pipes. And such a failing expression also does not trigger an exit, so the set +e/set -e were noops.
* test: set `ReadWritePaths=` only for units from TEST-20Frantisek Sumsal2022-02-171-3/+8
| | | | | | as setting it system-wide has some undesirable side-effects. Follow-up to b6fc524.
* tests: allow running all the services with SYSTEMD_LOG_LEVELEvgeny Vereshchagin2022-02-161-0/+3
| | | | | | | | | | | | | | | It should make it easier to figure out what exactly services do there. For example, with SYSTEMD_LOG_LEVEL=debug userdbd (v249) prints ``` varlink-5: New incoming message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{}} ``` before it crashes and systemd-resolved prints ``` varlink-21: New incoming message: {"method":"io.systemd.Resolve.ResolveAddress","parameters":{"address":[127,0,0,1],"flags":0,"ifindex":1000000,"family":0}} ``` and those messages are helpful (especially when scripts causing them aren't clever enough to keep track of random stuff they send to systemd :-))