From 53d90f9582f96208b3674da823ad1a3d2c3b1aa4 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 2 Feb 2015 00:19:30 +0100 Subject: [PATCH] tests: don't hardcode systemctl path Get it from type -P instead, to support --enable-split-usr. --- Makefile.am | 2 +- test/{end.service => end.service.in} | 2 +- test/test-functions | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) rename test/{end.service => end.service.in} (57%) diff --git a/Makefile.am b/Makefile.am index 2b980b45f..14f682755 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1433,7 +1433,7 @@ EXTRA_DIST += \ test/c.service \ test/daughter.service \ test/d.service \ - test/end.service \ + test/end.service.in \ test/e.service \ test/f.service \ test/grandchild.service \ diff --git a/test/end.service b/test/end.service.in similarity index 57% rename from test/end.service rename to test/end.service.in index 0f04dfeb2..4857ffe02 100644 --- a/test/end.service +++ b/test/end.service.in @@ -3,4 +3,4 @@ Description=End the test After=testsuite.service [Service] -ExecStart=/usr/bin/systemctl poweroff --no-block +ExecStart=@SYSTEMCTL@ poweroff --no-block diff --git a/test/test-functions b/test/test-functions index a0f1bf4eb..42c954d56 100644 --- a/test/test-functions +++ b/test/test-functions @@ -293,7 +293,8 @@ install_terminfo() { } setup_testsuite() { - cp $TEST_BASE_DIR/{testsuite.target,end.service} $initdir/etc/systemd/system/ + cp $TEST_BASE_DIR/testsuite.target $initdir/etc/systemd/system/ + sed "s#@SYSTEMCTL@#$(type -P systemctl)#g" $TEST_BASE_DIR/end.service.in > $initdir/etc/systemd/system/end.service mkdir -p $initdir/etc/systemd/system/testsuite.target.wants ln -fs $TEST_BASE_DIR/testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service -- 2.30.2