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 2b980b4..14f6827 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 0f04dfe..4857ffe 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 a0f1bf4..42c954d 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