mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
tests: various fixes
* 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
This commit is contained in:
parent
2933d599c2
commit
5c404f1ab8
@ -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 \
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
10
test/end.service
Normal file
10
test/end.service
Normal file
@ -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
|
@ -1,6 +0,0 @@
|
||||
[Unit]
|
||||
Description=End the test
|
||||
After=testsuite.service
|
||||
|
||||
[Service]
|
||||
ExecStart=@SYSTEMCTL@ poweroff --no-block
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user