Blob Blame History Raw
From 90fb011c43410958e5bda6f470137522f536adb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 28 Mar 2022 20:03:37 +0200
Subject: [PATCH] test-systemctl-enable: also use freshly-built systemd-id128

Tests were failing on centos7 because systemd-id128 is not in path.

(cherry picked from commit 2a2d002fb0913fe931b4ac903ca425a725aa79c0)

Related: #2082131
---
 meson.build                   | 21 ++++++++++++---------
 test/test-systemctl-enable.sh |  5 +++--
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index 005af872cf..4fc3e64e54 100644
--- a/meson.build
+++ b/meson.build
@@ -2371,7 +2371,7 @@ public_programs += executable(
         install_rpath : rootlibexecdir,
         install : true)
 
-exe = executable(
+systemctl = executable(
         'systemctl',
         systemctl_sources,
         include_directories : includes,
@@ -2385,13 +2385,7 @@ exe = executable(
         install_rpath : rootlibexecdir,
         install : true,
         install_dir : rootbindir)
-public_programs += exe
-if want_tests != 'false'
-        test('test-systemctl-enable',
-             test_systemctl_enable_sh,
-             # https://github.com/mesonbuild/meson/issues/2681
-             args : exe.full_path())
-endif
+public_programs += systemctl
 
 if conf.get('ENABLE_PORTABLED') == 1
         dbus_programs += executable(
@@ -3188,13 +3182,22 @@ executable(
         install : true,
         install_dir : rootlibexecdir)
 
-public_programs += executable(
+systemd_id128 = executable(
         'systemd-id128',
         'src/id128/id128.c',
         include_directories : includes,
         link_with : [libshared],
         install_rpath : rootlibexecdir,
         install : true)
+public_programs += systemd_id128
+
+if want_tests != 'false'
+        test('test-systemctl-enable',
+             test_systemctl_enable_sh,
+             # https://github.com/mesonbuild/meson/issues/2681
+             args : [systemctl.full_path(),
+                     systemd_id128.full_path()])
+endif
 
 public_programs += executable(
         'systemd-path',
diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh
index ecb433380e..8eb2828e35 100644
--- a/test/test-systemctl-enable.sh
+++ b/test/test-systemctl-enable.sh
@@ -6,6 +6,7 @@ set -ex
 export SYSTEMD_IGNORE_CHROOT=1
 
 systemctl=${1:-systemctl}
+systemd_id128=${2:-systemd-id128}
 
 unset root
 cleanup() {
@@ -606,7 +607,7 @@ check_alias o 'the-id'
 check_alias w '39a'
 check_alias W 'right'
 
-check_alias b "$(systemd-id128 boot-id)"
+check_alias b "$("$systemd_id128" boot-id)"
 
 # Specifiers not available for [Install]
 ( ! check_alias C '' )
@@ -637,7 +638,7 @@ check_alias l "$(uname -n | sed 's/\..*//')"
 test ! -e "$root/etc/machine-id"
 ( ! check_alias m '' )
 
-systemd-id128 new >"$root/etc/machine-id"
+"$systemd_id128" new >"$root/etc/machine-id"
 check_alias m "$(cat "$root/etc/machine-id")"
 
 check_alias n 'some-some-link6@.socket'