]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: various fixes 1812/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Sun, 8 Nov 2015 22:00:34 +0000 (22:00 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Tue, 10 Nov 2015 18:01:15 +0000 (18:01 +0000)
* remove journal flushing (systemd-journal-flush.service runs journalctl --flush on boot)
* use sh -c and PATH instead of @SYSTEMCTL@ expansion
* remove unnecessary semicolons etc

Makefile.am
test/TEST-01-BASIC/test.sh
test/TEST-02-CRYPTSETUP/test.sh
test/end.service [new file with mode: 0644]
test/end.service.in [deleted file]
test/test-functions

index 51548bb28928a93290ef433119ccd00f044a81da..cec07fac27e6142637f99932b25f3850ebf16f8f 100644 (file)
@@ -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 \
index d97fbe24d492a71b49084ae630dd6780f6a81728..b6b474393daa8c7c049d9f093a9f17523b88ea6b 100755 (executable)
@@ -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
 
index 4be2365e2f00c89ce0513e20cf6be7f881dc04bc..2997da06ff1e42855376e841dee147044181a9f0 100755 (executable)
@@ -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 (file)
index 0000000..6e1996f
--- /dev/null
@@ -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 (file)
index 4857ffe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-[Unit]
-Description=End the test
-After=testsuite.service
-
-[Service]
-ExecStart=@SYSTEMCTL@ poweroff --no-block
index ab77576573555f52c57185003a39469121671196..2f5ec9b93f71a8a1a0a22793a4e429d5bf461c62 100644 (file)
@@ -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