test: use non-blocking systemctl calls in testsuite.service

"systemctl poweroff" called from testsuite.service will cause this unit
itself to stop. To avoid deadlock, the call must not be synchronous.
This commit is contained in:
Michal Schmidt 2013-01-25 19:49:19 +01:00
parent b44be3ecf6
commit e8a66f4af2
2 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ 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;'
ExecStopPost=/usr/bin/systemctl poweroff
ExecStopPost=/usr/bin/systemctl poweroff --no-block
Type=oneshot
EOF
mkdir -p $initdir/etc/systemd/system/testsuite.target.wants

View File

@ -140,7 +140,7 @@ 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;'
ExecStopPost=/usr/bin/systemctl poweroff
ExecStopPost=/usr/bin/systemctl poweroff --no-block
Type=oneshot
EOF
mkdir -p $initdir/etc/systemd/system/testsuite.target.wants