TEST-03-JOBS: Test cancelling a job through private bus
(cherry picked from commit 32bf5695417d0bc01a42bfab2ff22ef0ddc7d533)
This commit is contained in:
committed by
Luca Boccassi
parent
bcd08128e4
commit
3d7fd9fc37
@@ -64,6 +64,16 @@ systemctl try-restart --job-mode=fail hello.service
|
||||
systemctl try-restart hello.service
|
||||
systemctl stop hello.service sleep.service hello-after-sleep.target
|
||||
|
||||
# Test that a job can be canceled through the private bus, where messages have no sender
|
||||
systemctl start --no-block hello-after-sleep.target
|
||||
timeout 10 bash -c "until systemctl list-jobs | tee /root/list-jobs.txt | grep 'sleep\.service.*running'; do sleep .1; done"
|
||||
grep 'hello\.service.*waiting' /root/list-jobs.txt
|
||||
systemctl cancel "$(systemctl show -P Job hello.service)"
|
||||
systemctl list-jobs >/root/list-jobs.txt
|
||||
(! grep 'hello\.service' /root/list-jobs.txt)
|
||||
grep 'sleep\.service.*running' /root/list-jobs.txt
|
||||
systemctl stop sleep.service hello-after-sleep.target
|
||||
|
||||
# TODO: add more job queueing/merging tests here.
|
||||
|
||||
# Test that restart propagates to activating units
|
||||
|
||||
Reference in New Issue
Block a user