From 3d7fd9fc37b11e5a9fca9a0f481b82770ac0d50c Mon Sep 17 00:00:00 2001 From: Chris Down Date: Wed, 7 Oct 2026 21:44:04 +0200 Subject: [PATCH] TEST-03-JOBS: Test cancelling a job through private bus (cherry picked from commit 32bf5695417d0bc01a42bfab2ff22ef0ddc7d533) --- test/units/TEST-03-JOBS.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/units/TEST-03-JOBS.sh b/test/units/TEST-03-JOBS.sh index 539c2b132d..8b19e13482 100755 --- a/test/units/TEST-03-JOBS.sh +++ b/test/units/TEST-03-JOBS.sh @@ -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