From 53d90f9582f96208b3674da823ad1a3d2c3b1aa4 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 2 Feb 2015 00:19:30 +0100 Subject: tests: don't hardcode systemctl path Get it from type -P instead, to support --enable-split-usr. --- Makefile.am | 2 +- test/end.service | 6 ------ test/end.service.in | 6 ++++++ test/test-functions | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 test/end.service create mode 100644 test/end.service.in diff --git a/Makefile.am b/Makefile.am index 2b980b45f0..14f682755a 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 deleted file mode 100644 index 0f04dfeb20..0000000000 --- a/test/end.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=End the test -After=testsuite.service - -[Service] -ExecStart=/usr/bin/systemctl poweroff --no-block diff --git a/test/end.service.in b/test/end.service.in new file mode 100644 index 0000000000..4857ffe02b --- /dev/null +++ b/test/end.service.in @@ -0,0 +1,6 @@ +[Unit] +Description=End the test +After=testsuite.service + +[Service] +ExecStart=@SYSTEMCTL@ poweroff --no-block diff --git a/test/test-functions b/test/test-functions index a0f1bf4eb2..42c954d565 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 -- cgit v1.2.3-54-g00ecf