chiark / gitweb /
tests: don't hardcode systemctl path
authorMartin Pitt <martin.pitt@ubuntu.com>
Sun, 1 Feb 2015 23:19:30 +0000 (00:19 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 3 Feb 2015 08:50:45 +0000 (09:50 +0100)
Get it from type -P instead, to support --enable-split-usr.

Makefile.am
test/end.service.in [moved from test/end.service with 57% similarity]
test/test-functions

index 2b980b45f0dfcefc641922ee99e00c24e35bb789..14f682755ac2a0209aade804af8b88e4626b925f 100644 (file)
@@ -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 \
similarity index 57%
rename from test/end.service
rename to test/end.service.in
index 0f04dfeb2032ab72659fa7e1681eedb2e9037881..4857ffe02bc3ba970ecd6aa6ee333a7f39477d7f 100644 (file)
@@ -3,4 +3,4 @@ Description=End the test
 After=testsuite.service
 
 [Service]
-ExecStart=/usr/bin/systemctl poweroff --no-block
+ExecStart=@SYSTEMCTL@ poweroff --no-block
index a0f1bf4eb2a3ca27bedc591cd68c58b4e9aeb68a..42c954d5658fe18773c9fbe673d0c623ed461bc5 100644 (file)
@@ -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