X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=test%2FTEST-03-JOBS%2Ftest-jobs.sh;h=28368b70e4b792e3e7b45ce6bd557b5ad12fa3e0;hb=56e6c2abb8f18bba2bb9d96d66ac7e633349ddfb;hp=98746c53636b93f185996688ed4a9e4932f42ed7;hpb=b5da077ddf01546c4a85688624d6957766d6c00c;p=elogind.git diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh index 98746c536..28368b70e 100755 --- a/test/TEST-03-JOBS/test-jobs.sh +++ b/test/TEST-03-JOBS/test-jobs.sh @@ -21,8 +21,30 @@ ELAPSED=$(($END_SEC-$START_SEC)) systemctl list-jobs > /root/list-jobs.txt grep 'sleep\.service.*running' /root/list-jobs.txt || exit 1 grep 'hello\.service' /root/list-jobs.txt && exit 1 +systemctl stop sleep.service hello-after-sleep.target || exit 1 + +# Test for a crash when enqueueing a JOB_NOP when other job already exists +systemctl start --no-block hello-after-sleep.target || exit 1 +# hello.service should still be waiting, so these try-restarts will collapse +# into NOPs. +systemctl try-restart --fail hello.service || exit 1 +systemctl try-restart hello.service || exit 1 +systemctl stop hello.service sleep.service hello-after-sleep.target || exit 1 # TODO: add more job queueing/merging tests here. +# Test for irreversible jobs +systemctl start unstoppable.service || exit 1 + +# This is expected to fail with 'job cancelled' +systemctl stop unstoppable.service && exit 1 +# But this should succeed +systemctl stop --irreversible unstoppable.service || exit 1 + +# We're going to shutdown soon. Let's see if it succeeds when +# there's an active service that tries to be unstoppable. +# Shutdown of the container/VM will hang if not. +systemctl start unstoppable.service || exit 1 + touch /testok exit 0