From: Martin Pitt Date: Sun, 1 Feb 2015 23:19:30 +0000 (+0100) Subject: tests: don't hardcode systemctl path X-Git-Tag: v219~178 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=53d90f9582f96208b3674da823ad1a3d2c3b1aa4 tests: don't hardcode systemctl path Get it from type -P instead, to support --enable-split-usr. --- 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