From: Franck Bui Date: Fri, 18 Nov 2022 09:18:19 +0000 (+0100) Subject: tests: update install_suse_systemd() X-Git-Tag: v253-rc1~493^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e8172c88a716c590c9d1cda1d40c6709ba104bb;p=thirdparty%2Fsystemd.git 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 --- diff --git a/test/test-functions b/test/test-functions index 9f6bfb21df2..a35ba0e79d6 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" }