From 3adac701fbfbde305938a6ed35e6c5eb5710e50b Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 8 Nov 2022 16:01:59 +0100 Subject: [PATCH 1/5] tests: install systemd-resolved on openSUSE It's needed since systemd-resolved has its own test suite (commit fb6f25d7b979134adf57). --- test/test-functions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index ff0cc963ce..82516dd6e6 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1159,6 +1159,9 @@ install_suse_systemd() { systemd-coredump systemd-experimental systemd-journal-remote + # Since commit fb6f25d7b979134a, systemd-resolved, which is shipped by + # systemd-network sub-package on openSUSE, has its own testsuite. + systemd-network systemd-portable udev ) @@ -1182,7 +1185,7 @@ install_suse_systemd() { cp "$testsdir"/test-* "$initdir/$testsdir/" cp -a "$testsdir/testdata" "$initdir/$testsdir/" - # On openSUSE, these dirs are not created at package install for now on. + # On openSUSE, these dirs are not created at package install for now. mkdir -p "$initdir/var/log/journal/remote" } From b75a210ad0417a5273004fd09c474db0d1fad28c Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 11 Nov 2022 18:34:06 +0100 Subject: [PATCH 2/5] tests: install dmi-sysfs module on openSUSE Required by TEST-54-CREDS. --- test/test-functions | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-functions b/test/test-functions index 82516dd6e6..9f6bfb21df 100644 --- a/test/test-functions +++ b/test/test-functions @@ -955,6 +955,8 @@ install_modules() { if get_bool "$LOOKS_LIKE_SUSE"; then instmods ext4 + # for TEST-54-CREDS + instmods dmi-sysfs fi } From 4e8172c88a716c590c9d1cda1d40c6709ba104bb Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 18 Nov 2022 10:18:19 +0100 Subject: [PATCH 3/5] 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 --- test/test-functions | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 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" + # 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" - 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. + # On openSUSE, this directory is not created at package install, at least + # for now. mkdir -p "$initdir/var/log/journal/remote" } From cc77a56532ddb59770e8312fc1b9954b0b135e72 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 15 Nov 2022 09:04:42 +0100 Subject: [PATCH 4/5] meson: install test-kernel-install only when -Dkernel-install=true This patch fixes the following build failure: meson.build:3853:8: ERROR: Unknown variable "test_kernel_install_sh". Fixes #25432. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 00daeac1b6..0fd0129820 100644 --- a/meson.build +++ b/meson.build @@ -3968,7 +3968,7 @@ exe = custom_target( install_dir : bindir) public_programs += exe -if want_tests != 'false' +if want_tests != 'false' and want_kernel_install test('test-kernel-install', test_kernel_install_sh, args : [exe.full_path(), loaderentry_install]) From eb1f60230a06e92f4586ffaa5a6878a0e2126342 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 15 Nov 2022 11:00:22 +0100 Subject: [PATCH 5/5] test: fix the default timeout values described in README.testsuite Unlike it was described, the default is 30 min. --- test/README.testsuite | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/README.testsuite b/test/README.testsuite index 40240599a0..2136800ff5 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -88,10 +88,10 @@ NSPAWN_ARGUMENTS='...' Specify additional arguments for systemd-nspawn QEMU_TIMEOUT=infinity - Set a timeout for tests under qemu (defaults to infinity) + Set a timeout for tests under qemu (defaults to 1800 sec) NSPAWN_TIMEOUT=infinity - Set a timeout for tests under systemd-nspawn (defaults to infinity) + Set a timeout for tests under systemd-nspawn (defaults to 1800 sec) INTERACTIVE_DEBUG=1 Configure the machine to be more *user-friendly* for interactive debuggung