diff options
author | Franck Bui <fbui@suse.com> | 2022-11-18 10:18:19 +0100 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2022-11-18 11:03:22 +0100 |
commit | 4e8172c88a716c590c9d1cda1d40c6709ba104bb (patch) | |
tree | 0483c233601f2e357335af6b9a68becca4096649 /test/test-functions | |
parent | tests: install dmi-sysfs module on openSUSE (diff) | |
download | systemd-4e8172c88a716c590c9d1cda1d40c6709ba104bb.tar.xz systemd-4e8172c88a716c590c9d1cda1d40c6709ba104bb.zip |
tests: update install_suse_systemd()
- Use inst_recursive() and image_install() helpers where appropriate
- Update comments to explain why we need to install the test data manually in
$initdir
- Install manual/ in $initdir as TEST-35-LOGIN relies on
manual/test-session-properties
Diffstat (limited to 'test/test-functions')
-rw-r--r-- | test/test-functions | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/test/test-functions b/test/test-functions index 9f6bfb21df..a35ba0e79d 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1150,7 +1150,6 @@ install_debian_systemd() { } install_suse_systemd() { - local testsdir=/usr/lib/systemd/tests local pkgs dinfo "Install SUSE systemd" @@ -1179,15 +1178,21 @@ install_suse_systemd() { done < <(rpm -ql "$p") done - # we only need testsdata dir as well as the unit tests (for - # TEST-02-UNITTESTS) in the image. - dinfo "Install unit tests and testdata directory" - - mkdir -p "$initdir/$testsdir" - cp "$testsdir"/test-* "$initdir/$testsdir/" - cp -a "$testsdir/testdata" "$initdir/$testsdir/" - - # On openSUSE, these dirs are not created at package install for now. + # Embed the files needed by the extended testsuite at runtime. Also include + # the unit tests needed by TEST-02-UNITTESTS. This is mostly equivalent to + # what `ninja install` does for the tests when '-Dinstall-tests=true'. + # + # Why? openSUSE ships a package named 'systemd-testsuite' which contains + # the minimal set of files that allows to run the testsuite on the host (as + # long as it runs an equivalent version of systemd) getting rid of the + # hassles of fetching, configuring, building the source code. + dinfo "Install the files needed by the tests at runtime" + image_install "${SOURCE_DIR}"/test-* + inst_recursive "${SOURCE_DIR}/testdata" + inst_recursive "${SOURCE_DIR}/manual" + + # On openSUSE, this directory is not created at package install, at least + # for now. mkdir -p "$initdir/var/log/journal/remote" } |