]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: update install_suse_systemd()
authorFranck Bui <fbui@suse.com>
Fri, 18 Nov 2022 09:18:19 +0000 (10:18 +0100)
committerFranck Bui <fbui@suse.com>
Fri, 18 Nov 2022 10:03:22 +0000 (11:03 +0100)
- 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

test/test-functions

index 9f6bfb21df2ac41b1ffc23b2e5477e33398688da..a35ba0e79d60e63abb55f9ea0ecdbf3016b25dff 100644 (file)
@@ -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"
 }