summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-10 19:31:22 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-10 19:31:22 +0100
commit7fa89e2fe2a6a41f139261484fd34bef596e4d46 (patch)
treecf93f1f133f1728a55b4fc2a0557598a9e5753b9
parent930a0796937402e591f42555c870713e8f5cc64a (diff)
parent5c404f1ab8e96efedb983806443ca982a1b2a372 (diff)
Merge pull request #1812 from evverx/test-fixes
tests: various fixes
-rw-r--r--Makefile.am2
-rwxr-xr-xtest/TEST-01-BASIC/test.sh2
-rwxr-xr-xtest/TEST-02-CRYPTSETUP/test.sh2
-rw-r--r--test/end.service10
-rw-r--r--test/end.service.in6
-rw-r--r--test/test-functions2
6 files changed, 14 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index 51548bb289..cec07fac27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1506,7 +1506,7 @@ EXTRA_DIST += \
test/c.service \
test/daughter.service \
test/d.service \
- test/end.service.in \
+ test/end.service \
test/e.service \
test/f.service \
test/grandchild.service \
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index d97fbe24d4..b6b474393d 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -53,7 +53,7 @@ Description=Testsuite service
After=multi-user.target
[Service]
-ExecStart=/bin/bash -c 'set -x; systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok; while : ;do echo "testsuite service waiting for journal to move to /var/log/journal" > /dev/console ; for i in /var/log/journal/*;do [ -d "\$i" ] && echo "\$i" && break 2; done; sleep 1; done; sleep 1; exit 0;'
+ExecStart=/bin/sh -x -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok'
Type=oneshot
EOF
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh
index 4be2365e2f..2997da06ff 100755
--- a/test/TEST-02-CRYPTSETUP/test.sh
+++ b/test/TEST-02-CRYPTSETUP/test.sh
@@ -59,7 +59,7 @@ Description=Testsuite service
After=multi-user.target
[Service]
-ExecStart=/bin/bash -c 'set -x; systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok; while : ;do systemd-cat echo "testsuite service waiting for /var/log/journal" ; echo "testsuite service waiting for journal to move to /var/log/journal" > /dev/console ; for i in /var/log/journal/*;do [ -d "\$i" ] && echo "\$i" && break 2; done; sleep 1; done; sleep 1; exit 0;'
+ExecStart=/bin/sh -x -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok'
Type=oneshot
EOF
diff --git a/test/end.service b/test/end.service
new file mode 100644
index 0000000000..6e1996fd02
--- /dev/null
+++ b/test/end.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=End the test
+After=testsuite.service
+OnFailure=poweroff.target
+OnFailureJobMode=replace-irreversibly
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -x -c 'systemctl poweroff --no-block'
+TimeoutStartSec=5m
diff --git a/test/end.service.in b/test/end.service.in
deleted file mode 100644
index 4857ffe02b..0000000000
--- a/test/end.service.in
+++ /dev/null
@@ -1,6 +0,0 @@
-[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 ab77576573..2f5ec9b93f 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -305,7 +305,7 @@ install_terminfo() {
setup_testsuite() {
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
+ cp $TEST_BASE_DIR/end.service $initdir/etc/systemd/system/
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