From: Frantisek Sumsal Date: Mon, 31 Jan 2022 13:19:09 +0000 (+0100) Subject: test: copy portable profiles into the image if they don't exist there X-Git-Tag: v251-rc1~405 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f73ef8b30803ac1be1b2607aec1a89d778caa9a;p=thirdparty%2Fsystemd.git test: copy portable profiles into the image if they don't exist there If we're built with `-Dportable=false`, the portable profiles won't get installed into the image. Since we need only the profile files and nothing else, let's copy them into the image explicitly in such case. --- diff --git a/test/test-functions b/test/test-functions index ac8bf8883b9..3ae8caed3fb 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1163,6 +1163,17 @@ install_systemd() { mkdir -p "$initdir/etc/systemd/system/service.d/" echo -e "[Service]\nProtectSystem=no\nProtectHome=no\n" >"$initdir/etc/systemd/system/service.d/gcov-override.conf" fi + + # If we're built with -Dportabled=false, tests with systemd-analyze + # --profile will fail. Since we need just the profile (text) files, let's + # copy them into the image if they don't exist there. + local portable_dir="${initdir:?}${ROOTLIBDIR:?}/portable" + if [[ ! -d "$portable_dir/profile/strict" ]]; then + dinfo "Couldn't find portable profiles in the test image" + dinfo "Copying them directly from the source tree" + mkdir -p "$portable_dir" + cp -frv "${SOURCE_DIR:?}/src/portable/profile" "$portable_dir" + fi } get_ldpath() {